Handbook:Source Code Install
Contents
Should I Do This?
In general, if you're not sure you should be building from source, you probably shouldn't. Chance are, someone has already invested a lot of time to build a binary package for you, and some popular distributions offer their own official packages. Before deciding to 'roll your own' HylaFAX server from source, you might want to check the Binary_Packages page.
Before you begin - Prerequisites
A variety of C++ compiler utilities and image manipulation tools must be installed before HylaFAX can be compiled. Each OS/platform will have a slightly different list of prerequisites and recommended installation procedures, but the following is a general list of the most commonly required ones:
- C++ Compiler - You need a contemporary C++ compiler to build this system, which in most cases means gcc. The native/proprietary C++ compilers that ship with some UNIX variants such as Solaris have been reported to work, and the HylaFAX development team is always receptive to bug reports and patches that help them make HylaFAX build on as many platforms as possible.
- C++ Runtime Libraries - HylaFAX requires only minimal C++ runtime support; basic dynamic memory allocation facilities and support for creating global static objects; it does not use any of the newer C++ runtime facilities such as exception handling. Most C++ compiler packages include everything that you need in the way of a runtime library. When using GNU gcc you may also need the libg++ distribution which is packaged separately from gcc. On some systems where gcc is used these facilities can be satisfied without linking against -lg++ or -liberty, but on others one or both of these libraries are needed for certain library routines that are normally found in the C runtime library. The configuration procedure will abort if libg++ is needed but is not present on the build system. If libg++ is required you should use the version that is appropriate for the compiler. For instance, when using gcc version 2.6.3, libg++2.6.2 is the recommended version to use.
- libtiff - HylaFAX requires version 3.4 or later of the freely available TIFF software distribution. The master site for this distribution is http://www.remotesensing.org/libtiff/. Note that the TIFF distribution must be installed before building HylaFAX from source code or HylaFAX must be specially configured to search for TIFF include files and libraries in non-standard locations. One word of warning - do not use an unpatched version 3.6.1.
- Ghostscript - If you are not on a Silicon Graphics machine (and maybe even if you are), then you will need the Ghostscript PostScript interpreter software to build a PostScript imaging engine to be used by the facsimile server. (This imaging engine is frequently referred to as a Raster Image Processor or RIP.) Ghostscript comes in three flavors, two of which are important to us: GNU PostScript, a version governed by the GNU Public License (GPL), and Aladdin Ghostscript, a version covered by the Aladdin Free Public License. Both versions are copyrighted work and are not shareware or in the public domain. Aladdin Ghostscript is free for use by end users but does not allow commercial distribution; to do this you must arrange for a commercial license. Versions of GNU Ghostscript are distributed approximately a year following the corresponding Aladdin Ghostscript version. For more information on these and other issues consult the information located at http://www.cs.wisc.edu/~ghost/.
- awk (or gawk, mawk, nawk etc) - most distributions ship with at least one of these
- MTA - A mail transport agent such as sendmail or postfix is required in order to deliver faxes, reports, and errors by email. Again, we don't know of a distro that ships without one of these.
- metamail, uuencode, or base64-encode - For optional use in fax-to-email gateways.
Quick Build & Install
Download and Extract the Source Code
Get and extract the HylaFAX source from: ftp://ftp.hylafax.org/source/.Change directories to to /usr/src/ and extract the tarball via 'tar xzvf hylafax-version.tar.gz'. The tarball can now be deleted if so desired.
Compile and Install
In most cases it's as simple as:
cd hylafax-version ./configure (uses default values) make make install (must be root or equivalent)
If you want to override any of the defaults, the configure script is your friend. For instance, here's the configure line used when building a Red Hat RPM Package:
./configure \ --with-DIR_BIN=/usr/bin \ --with-DIR_SBIN=/usr/sbin \ --with-DIR_LIB=/usr/lib \ --with-DIR_LIBEXEC=/usr/sbin \ --with-DIR_LIBDATA=/etc/hylafax \ --with-DIR_LOCKS=/var/lock \ --with-LIBDIR=/usr/lib \ --with-TIFFBIN=/usr/bin \ --with-DIR_MAN=/usr/man \ --with-PATH_GSRIP=/usr/bin/gs \ --with-DBLIBINC=/usr/include \ --with-LIBTIFF="-ltiff -ljpeg -lz" \ --with-DIR_SPOOL=/var/spool/hylafax \ --with-AFM=no \ --with-AWK=/usr/bin/gawk \ --with-PATH_VGETTY=/sbin/vgetty \ --with-PATH_GETTY=/sbin/mgetty \ --with-HTML=no \ --with-PAGESIZE=A4 \ --with-PATH_DPSRIP=/var/spool/hylafax/bin/ps2fax \ --with-PATH_IMPRIP="" \ --with-SYSVINIT=/etc/init.d/hylafax \ --with-INTERACTIVE=no
If you are using an environment that supports DSOs and HylaFAX supports DSOs in your environment (i.e. Linux), then you might need to ensure that your /etc/ld.so.conf (or equivalent) file contains a reference to /usr/local/lib or wherever libfaxserver.so and libfaxutil.so were installed. (Remember that if you alter /etc/ld.so.conf you must run ldconfig afterwards.)
Run faxsetup and faxaddmodem
With root permissions, execute '/usr/local/sbin/faxsetup'. When finished, faxsetup will automatically run faxaddmodem for you. Generally, you can follow all of the defaults except those for FaxMaster, the local fax number(s), TSI, and any modem-specific information in faxaddmodem.
Starting the hfaxd, faxq, and faxgetty Daemons
This procedure may vary depeding on your specific operating system and init type. Be cautious to follow what is appropriate for your environment.
On BSD-init (non-SysV-init) systems, you may need to edit etc/setup.cache and change the appropriate lines to read:
FAXQ_SERVER='yes' HFAXD_SERVER='yes' SYSVINIT='/usr/local/sbin/hylafax'
Edit /etc/rc.d/rc.local and add the lines:
# Starting the HylaFAX hfaxd and faxq Daemons at Boot. /usr/local/sbin/hylafax start
Edit /etc/inittab and add a line(s) similar to:
m0:2345:respawn:/usr/local/sbin/faxgetty ttyS0
where 'm0' is unique in inittab and 'ttyS0' matches the device name(s) used at the outset of the faxaddmodem script.
faxcron and faxqclean
It would be wise to run faxcron and faxqclean regularly from cron so that the queue directories do not clutter up and fill the storage device. Many installations run faxqclean every hour and faxcron every day. Insert something like this into your uucp or root crontab file:
0 * * * * /usr/local/sbin/faxqclean 0 0 * * * /usr/local/sbin/faxcron | mail -s "HylaFAX Usage Report" faxmaster
Finishing Up
Either restart the system, or alternatively, execute the following commands:
/usr/local/sbin/hylafax start /sbin/init q
Now you're done with a basic HylaFAX installation. Check things out with faxstat and various other tests as noted in this document. You'll also likely want to configure faxcron and faxqclean. See General Tweaking and Customization Hints for those instructions.