# Maintainer: Stephan Eisvogel pkgname=hylafax-plus-custom pkgver=7.0.7 pkgrel=1 pkgdesc="Enterprise Fax Server" arch=($CARCH) url='http://hylafax.sourceforge.net' license=('custom') groups=('custom') install=hylafax.install #options=('emptydirs' 'debug' '!strip') options=('emptydirs') makedepends=('jbigkit' 'git' 'subversion') depends=('ghostscript' 'gawk') optdepends=( 'smtp-server: Notifications by e-mail' 'smtp-forwarder: Notifications by e-mail' ) # HylaFAX+ https://sourceforge.net/p/hylafax/HylaFAX+/HEAD/tree/trunk/ _hfsvndir="hylafax-plus-svn" _hfrev="2695" # URW+ Postscript core35 Type 1 fonts https://github.com/ArtifexSoftware/urw-base35-fonts _t1gitdir="urw-base35-fonts-git" _t1commit="c15105598aa7eb256b1ebfcecd3d078801521e73" # VSI-FAX output code helper https://github.com/severach/sendfaxvsi _vsigitdir="sendfaxvsi-git" _vsicommit="18fabc74490362cd26690331d546d727c727db25" # Global package destination _dest="/opt/hylafax" source=( "${_hfsvndir}::svn://svn.code.sf.net/p/hylafax/HylaFAX+/trunk#revision=${_hfrev}" "${_t1gitdir}::git+https://github.com/ArtifexSoftware/urw-base35-fonts.git#commit=${_t1commit}" "${_vsigitdir}::git+https://github.com/severach/sendfaxvsi.git#commit=${_vsicommit}" hylafax.tmpfile hylafax.sysusers hylafax.sh setup.modem setup.cache Fontmap.HylaFAX faxgetty@.service hfaxd.service faxq.service FaxNotify.example FaxDispatch.example FaxWedged.example faxqclean.service faxqclean.timer faxcron.service faxcron.timer 001-cover-templ.patch 197-spool.patch # svn diff -r 2647:2646 > ../197-spool.patch 198-spool.patch # svn diff -r 2574:2573 > ../198-spool.patch 199-spool.patch # svn diff -r 2569:2568 > ../199-spool.patch ) sha256sums=( 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' ) backup=( 'opt/hylafax/spool/etc/dialrules' 'opt/hylafax/spool/etc/dialrules-pabx.be' 'opt/hylafax/spool/etc/dialrules.europe' 'opt/hylafax/spool/etc/dialrules.ext' 'opt/hylafax/spool/etc/dialrules.sf-ba' 'opt/hylafax/spool/etc/dialrules.uk' 'opt/hylafax/spool/etc/dialrules.world' 'opt/hylafax/spool/etc/hfaxd.conf' 'opt/hylafax/spool/etc/hosts.hfaxd' 'opt/hylafax/spool/etc/pagesizes' 'opt/hylafax/spool/etc/typerules' ) prepare() { cd "${srcdir}/${_hfsvndir}" # Apply patches patch -Np0 < "${srcdir}/001-cover-templ.patch" patch -Np0 < "${srcdir}/197-spool.patch" patch -Np0 < "${srcdir}/198-spool.patch" patch -Np0 < "${srcdir}/199-spool.patch" # Fix LDFLAGS for lockname, ondelay, libfaxutil.so and libfaxserver.so sed -i 's/${CCF}/${CCF} ${VLDOPTS}/g' etc/Makefile.in sed -i 's/${DSOOPTS}/${DSOOPTS} ${VLDOPTS}/g' util/Makefile.LINUXdso sed -i 's/${DSOOPTS}/${DSOOPTS} ${VLDOPTS}/g' faxd/Makefile.LINUXdso # Move lastrun, xferfaxlog and clientlog sed -i 's/etc\/lastrun/log\/lastrun/g' \ man/faxcron.1m \ util/faxcron.sh.in sed -i 's/${SPOOL}\/etc\/xferfaxstats/${SBIN}\/xferfaxstats/g' man/faxcron.1m sed -i 's/FAX_ETCDIR "\/xferfaxlog"/FAX_LOGDIR "\/xferfaxlog"/g' config.h.in sed -i 's/\/etc\/clientlog/\/log\/clientlog/g' \ hfaxd/hfaxd.conf \ hfaxd/HylaFAXServer.c++ \ man/hfaxd.1m sed -i 's/etc\/xferfaxlog/log\/xferfaxlog/g' \ util/recvstats.sh.in \ util/faxcron.sh.in \ util/xferfaxstats.sh.in \ man/recvstats.1m \ man/xferfaxlog.4f \ man/xferfaxstats.1m \ man/hylafax-server.4f } build() { cd "${srcdir}/${_hfsvndir}" ./configure \ --nointeractive \ --target="${CARCH}-arch-linux" \ --with-OPTIMIZER="${CFLAGS}" \ --with-STRIP="/usr/bin/true" \ --with-DIR_BIN="${_dest}/bin" \ --with-DIR_SBIN="${_dest}/bin" \ --with-DIR_LIBEXEC="${_dest}/bin" \ --with-DIR_LIB="${_dest}/lib" \ --with-DIR_SPOOL="${_dest}/spool" \ --with-DIR_LIBDATA="${_dest}/spool/etc" \ --with-FONTMAP="${_dest}/spool/etc" \ --with-PATH_AFM="${_dest}/lib/fonts" \ --with-DIR_MAN="${_dest}/man" \ --with-DIR_LOCKS="/run/hylafax" \ --with-FAXUID="hylafax" \ --with-FAXGID="hylafax" \ --with-SYSUID="root" \ --with-SYSGID="root" \ --with-PATH_GETTY="${_dest}/bin/getty" \ --with-PATH_VGETTY="${_dest}/bin/vgetty" \ --with-PATH_EGETTY="${_dest}/bin/egetty" \ --with-SYSVINIT="no" \ --with-PAGESIZE=A4 \ --with-DEFVRES=196 make VLDOPTS=${LDFLAGS} -j1 cd "${srcdir}/${_vsigitdir}" make CFLAGS="${CFLAGS} ${LDFLAGS}" } package() { cd "${srcdir}/${_hfsvndir}" _uid=$(id -u) _gid=$(id -g) make \ FAXUSER=$_uid \ FAXGROUP=$_gid \ SYSUSER=$_uid \ SYSGROUP=$_gid \ INSTALLROOT="${pkgdir}" \ install install -Dt "${pkgdir}/usr/share/licenses/${pkgname}" -m644 COPYRIGHT # Configuration files previously generated by 'faxsetup' cd "${srcdir}" install -Dt "${pkgdir}/${_dest}/spool/etc" -m644 Fontmap.HylaFAX setup.cache setup.modem install -Dt "${pkgdir}/${_dest}/spool/etc" -m644 FaxDispatch.example FaxNotify.example FaxWedged.example # Symlinks pushd "${pkgdir}${_dest}/spool/bin" >/dev/null ln -s ps2fax.gs ps2fax ln -s pdf2fax.gs pdf2fax popd >/dev/null # Type 1 fonts cd "${srcdir}/${_t1gitdir}/fonts" install -Dt "${pkgdir}/${_dest}/lib/fonts" -m644 *.{afm,t1} COPYING LICENSE # System information echo -e "HylaFAX version ${pkgver} built $(date) for ${CARCH}-arch-linux-gnu\n" > \ "${pkgdir}${_dest}/spool/status/any.info" # Add IPv6 localhost echo "::1" >> "${pkgdir}${_dest}/spool/etc/hosts.hfaxd" # Add sendfaxvsi helper cd "${srcdir}/${_vsigitdir}" make \ DESTDIR="${pkgdir}" \ BINDIR="${_dest}/bin" \ install # Remove unneeded parts rm "${pkgdir}${_dest}/man/man1/sgi2fax.1" rm "${pkgdir}${_dest}/bin/faxsetup."{irix,bsdi} rm "${pkgdir}${_dest}/spool/COPYRIGHT" rm "${pkgdir}${_dest}/spool/bin/ps2fax."{imp,dps} rm "${pkgdir}${_dest}/spool/etc/"{dpsprinter.ps,xferfaxlog} # System integration install -Dm755 "${srcdir}/hylafax.sh" "${pkgdir}/etc/profile.d/hylafax.sh" install -Dm644 "${srcdir}/hylafax.sysusers" "${pkgdir}/usr/lib/sysusers.d/hylafax.conf" install -Dm644 "${srcdir}/hylafax.tmpfile" "${pkgdir}/usr/lib/tmpfiles.d/hylafax.conf" install -Dm644 "${srcdir}/faxgetty@.service" "${pkgdir}/usr/lib/systemd/system/faxgetty@.service" install -Dm644 "${srcdir}/hfaxd.service" "${pkgdir}/usr/lib/systemd/system/hfaxd.service" install -Dm644 "${srcdir}/faxq.service" "${pkgdir}/usr/lib/systemd/system/faxq.service" install -Dm644 "${srcdir}/faxqclean.service" "${pkgdir}/usr/lib/systemd/system/faxqclean.service" install -Dm644 "${srcdir}/faxqclean.timer" "${pkgdir}/usr/lib/systemd/system/faxqclean.timer" install -Dm644 "${srcdir}/faxcron.service" "${pkgdir}/usr/lib/systemd/system/faxcron.service" install -Dm644 "${srcdir}/faxcron.timer" "${pkgdir}/usr/lib/systemd/system/faxcron.timer" }