diff options
Diffstat (limited to 'PKGBUILD')
-rw-r--r-- | PKGBUILD | 251 |
1 files changed, 208 insertions, 43 deletions
@@ -177,17 +177,31 @@ _opt_pagesize="Letter" # A4, Letter, Legal # http://lists.opensuse.org/opensuse/2009-09/msg00269.html # Re: [opensuse] Update Hylafax 4.4 to 6.03 with src.rpm on OpenSuSE 10.3 +# 0 use external libtiff package (libtiff5 or libtiff-hylafaxplus) +# 1 include libtiff in hylafaxplus +_opt_Integrated_LIBTIFF=0 + +# 0 link hylafaxplus executables to external libtiff (libtiff5 or libtiff-hylafaxplus) +# 1 link to system libtiff. New versions are often incompatible. +_opt_HF_System_LIBTIFF=1 + set -u pkgname='hylafaxplus' _pkgnick='hylafax' -pkgver='7.0.4' -pkgrel='1' +pkgver='7.0.7' +pkgrel='3' _sendfaxvsicommit='18fabc74490362cd26690331d546d727c727db25' pkgdesc='Enterprise Fax Server' arch=('i686' 'x86_64') url='http://hylafax.sourceforge.net/' license=('custom') -depends=('dash' 'libtiff' 'pam' 'ghostscript' 'sharutils' 'jbigkit' 'lcms2' 'gawk') # 'gsfonts-type1') # 'cron' +depends=('glibc' 'gcc-libs' 'bash' 'perl' 'dash' 'libtiff' 'pam' 'ghostscript' 'sharutils' 'jbigkit' 'lcms2' 'gawk' 'libjpeg-turbo' 'libldap' 'libxcrypt' 'openssl' 'zlib') # 'gsfonts-type1') # 'cron' +depends[1]='libtiff>=4.6.0' # 'libtiff<4.6.0' https://sourceforge.net/p/hylafax/mailman/message/38259441/ +if [ "${_opt_Integrated_LIBTIFF}" -eq 0 ]; then + depends+=('libtiff5-hylafaxplus') +else + provides=('libtiff5') # no =version +fi # BASE64 is the default so HylaFAX+ doesn't need uuencode but I put it in anyways to placate configure and the bin finder in faxsetup! optdepends=( 'smtp-server: email support' # this must be configured if installed or Hylafax will spam the process table with orphaned sendmail processes @@ -211,9 +225,11 @@ optdepends=( provides=("hylafax=${pkgver}") conflicts=('hylafax') # backup=(var/spool/hylafax/bin/{faxrcvd,notify}) +options=('!buildflags') # get rid of Class 1 errors No response to PPS MPS, RSPREC DCN, No receiver protocol, Failure to train remote modem install="${_pkgnick}.install" # 'var/spool/hylafax/etc/hosts.hfaxd') # This is better handled with a .default file. _verwatch=("${url}" 'news/\([0-9\.]\+\)\.php' 'l') +_srcdir="${_pkgnick}-${pkgver}" source=( "https://downloads.sourceforge.net/hylafax/${_pkgnick}-${pkgver}.tar.gz" "sendfaxvsi-1.0.0.tgz::https://github.com/severach/sendfaxvsi/archive/${_sendfaxvsicommit}.tar.gz" @@ -228,29 +244,29 @@ source=( '0006-hylafaxplus-jobfmt-assigned-modem-to-used-modem.patch' '1000-hylafaxplus-modem-support.patch' ) -md5sums=('af3e1c241965891fedaa5ce2e7b266e7' +md5sums=('17ec4957f66ef422afe928eeb4a879d9' '3af38f1eaa4f9fb92cac2f0cf9544321' '916f2c100eb2b41ef6b35f96bdb9444a' - 'c1d54ea1f50abfb3834488b428754714' + 'ae0a86260ab7ed94187a5d8e560a82ac' '0edd9dbf9b745437a5a4c174d6418e96' 'a2d08cfd91be2aa608dd3bc9ef6c69bc' 'c8c3aab59725c20eddc7d31d21c7b31e' 'fd0395521f6c2b8681e5fbcfd943043d' 'a14922b05223f703c41dff8035477706' '0de848f554e2a93c09352eadb2b2e260' - 'f6692d5cb0033abe7865c47ec581ea87' + '151567ca960d860c88ff0e5154cb5b78' 'dd1e2859dd1cc13db863ba74bc539ca0') -sha256sums=('2512e93d23bd04c12304c67fefb1646735c4bcb5d75b866adf91a89ed1098bf8' +sha256sums=('8b9bcd4fe25f08b658e6cfcb3514183c22cbbfdf7166fa092510011a8228f88d' '0aed186ab30fdb7cf36895a0ff50b03bd4a68db63cf4f19763995dabd9caffb0' '466ab17cdaa1eb1f1f0b5bdc444a90df5835a1896b1363584264920bbc3929f2' - '80d2e28ee7a7d8f93501e32c96e9895e242409da1326761d36dbf28e5a0e3677' + '8b2dbf38d13d0c25e6164e691187b4f45ae971c009e80911cd96aac0f61cf871' 'dd4728f8204d0bba2a026768f0e0216778ed26583c3f799f6266554e21b48fe2' '5f19fa1f3b12fd480f4c28a9a2bdf041359d5510e1040b735d5f312071dcbd04' 'b4b93c149164ed7c96f4f04373c32198c1e19c89ca9e2ab6e92e17c0a48bd1af' '989d6f71a8cfe99a3ca983981f8d8e9368776e2fc7667a809755d8d7292d52ad' '528f267805203b792741423f46114fee7b48664f1aab35a0edff7d519555ccc2' 'e2b43c19705ce112dd3a08ecd0cae4c5558910366291524566cdd5890b2c6095' - '96d106278ac68b95f0d1916f76066904c2108a2bb0c97651c22d025d989f4acb' + '4efef67287b2b5ebaa2485ac5be5a62d2a86b2830b416f7a6905cfe17d6e76bb' '98e79e16e9cda5bb853501daaac7734cd5a367eb7543990f6a3c16fef49d0968') # The HylaFAX binaries work very well. The scripts need major fixes! @@ -271,6 +287,121 @@ sha256sums=('2512e93d23bd04c12304c67fefb1646735c4bcb5d75b866adf91a89ed1098bf8' # Note: I only send faxes. Fax receiving might need a bunch more patches. +if [ "${_opt_Integrated_LIBTIFF}" -ne 0 ]; then +_libtiff_top() { +set -u +local _pkgname=tiff +#pkgname=libtiff +#pkgname+='5' +local pkgver=4.4.0 +#pkgrel=2 +#pkgdesc='Library for manipulation of TIFF images' +#arch=('x86_64' 'aarch64') +#url='http://www.simplesystems.org/libtiff' +license+=('custom') +depends+=('gcc-libs' 'glibc' 'libjpeg-turbo' 'libjpeg.so' 'zlib' 'xz' 'zstd') +#depends+=('libtiff>=4.6.0') +conflicts+=('libtiff<4.6.0' 'libtiff5') +_libtiff_srcdir="${_pkgname}-${pkgver}" +source+=( + "https://download.osgeo.org/libtiff/tiff-${pkgver}.tar.gz" + # fix CVE-2022-2056 / CVE-2022-2057 / CVE-2022-2058: https://bugs.archlinux.org/task/75360 + "${pkgname}-4.4.0-fpe_tiffcrop.patch::https://gitlab.com/libtiff/libtiff/-/commit/dd1bcc7abb26094e93636e85520f0d8f81ab0fab.patch" + # fix CVE-2022-34526: https://bugs.archlinux.org/task/75608 + "${pkgname}-4.4.0-CVE-2022-34526.patch::https://gitlab.com/libtiff/libtiff/-/commit/275735d0354e39c0ac1dc3c0db2120d6f31d1990.patch" +) +} +_libtiff_top + +_libtiff_prepare() { + set -u + cd "${_libtiff_srcdir}" + # apply patch from the source array (should be a pacman feature) + local _src + for _src in "${source[@]}"; do + _src="${_src%%::*}" + _src="${_src##*/}" + if [[ "${_src}" = libtiff*.patch ]]; then + echo "Applying patch ${_src}..." + patch -Np1 -i "../${_src}" + fi + done + set +u +} + +_libtiff_incdir='libtiff-hylafaxplus' +_libtiff_libdir='libtiff-hylafaxplus' + +_libtiff_build() { + set -u + local _configure_options=( + --prefix=/usr + #--sysconfdir=/etc + #--enable-ld-version-script + #--mandir=/usr/share/man + #--with-docdir=/usr/share/doc/${pkgname} + --includedir="/usr/include/${_libtiff_incdir}" + #--libdir="/usr/lib/${_libtiff_libdir}" + #--bindir='/usr/bin/hylafax' # how will all the scripts work if we move the binaries + ) + cd "${_libtiff_srcdir}" + if [ ! -s 'Makefile' ]; then + #CFLAGS+=' -fpic' + ./configure "${_configure_options[@]}" + fi + make -s + set +u +} + +_libtiff_check() { + set -u + cd "${_libtiff_srcdir}" + make check + set +u +} + +_libtiff_package() { + set -u + cd "${_libtiff_srcdir}" + make DESTDIR="${pkgdir}" install + install -Dm644 'COPYRIGHT' -t "${pkgdir}/usr/share/licenses/${pkgname}" + + cd "${pkgdir}" + local _f + for _f in tiffcp; do + mv "usr/bin/${_f}"{,.hylafax} + mv "usr/share/man/man1/${_f}"{.1,.hylafax.1} + done + for _f in tiffdump tiffinfo tiffset tiffsplit; do + rm "usr/bin/${_f}" + rm "usr/share/man/man1/${_f}.1" + done + shopt -s failglob + rm -r usr/share/{doc,man/man3} usr/lib/libtiff*.a + if :; then + rm -r 'usr/lib/pkgconfig' + install -d "usr/lib/${_libtiff_libdir}" + pushd "usr/lib/${_libtiff_libdir}" > /dev/null + mv ../libtiff*.so . + local _f + for _f in ../*.so*; do + ln -s "${_f}" + done + popd > /dev/null + fi + shopt -u failglob + #sed -e 's:^TIFFBIN=.*$:TIFFBIN=/usr/bin:g' -i "${pkgdir}/usr/bin/faxsetup" # not needed if we change TIFFBIN detection to tiffcp + set +u +} +else +_libtiff_incdir='libtiff5' +_libtiff_libdir='libtiff5' +_libtiff_prepare() { :; } +_libtiff_build() { :; } +_libtiff_check() { :; } +_libtiff_package() { :; } +fi + _pkginit() { if [ "${SOURCEONLY:-0}" -ne 0 ]; then # see makepkg -S if this var changes if [ "${_opt_FAXNumber}" != '+1.517.555.0101' ] || [ "${_opt_LocalIdentifier}" != 'ArchLinuxFAX' ]; then @@ -284,20 +415,31 @@ _pkginit unset -f _pkginit prepare() { + _libtiff_prepare; cd "${srcdir}" set -u - cd "${_pkgnick}-${pkgver}" + cd "${_srcdir}" # sbin is deprecated and should not be used. We'll obliterate # all uses of /sbin. Some /sbin not applicable to our OS are left alone. #cp -p 'configure'{,.Arch} - sed -e 's:^\(DIR_SBIN=/usr/local/\)sbin$:\1bin:g' \ - -e 's|:/sbin:\($PATH\)|:\1|g' \ - -e 's|\(findApp [^ ]\+ \)/sbin:\($PATH\)|\1\2|g' \ - -e 's|\(findAppDef [^ ]\+ \)/sbin:\($PATH\)|\1\2|g' \ - -e 's|^\(PATH=$PATH:/bin:/usr/bin\)\(:/etc\)$|\1 # \2 # it was an insanely stupid choice for some UNIX systems to put /etc in the path!|g' \ - -e 's:^\(test -d /usr/sbin &&\):#\1:g' \ - -e 's:^#!/bin/sh$:#!/usr/bin/dash:g' \ - -i 'configure' + local _seds=( + -e 's:^\(DIR_SBIN=/usr/local/\)sbin$:\1bin:g' + -e 's|:/sbin:\($PATH\)|:\1|g' + -e 's|\(findApp [^ ]\+ \)/sbin:\($PATH\)|\1\2|g' + -e 's|\(findAppDef [^ ]\+ \)/sbin:\($PATH\)|\1\2|g' + -e 's|^\(PATH=$PATH:/bin:/usr/bin\)\(:/etc\)$|\1 # \2 # it was an insanely stupid choice for some UNIX systems to put /etc in the path!|g' + -e 's:^\(test -d /usr/sbin &&\):#\1:g' + -e 's:^#!/bin/sh$:#!/usr/bin/dash:g' + -e '# pretend, that libtiff 4.x is similar to 4.0' + -e '/tiff_runlen_t/ s:4\..\+):4.[0123456789]):' + ) + if [ "${_opt_Integrated_LIBTIFF}" -ne 0 ]; then + _seds+=( + -e '# change TIFFBIN detection to a binary still in libtiff 4.6.0 avoiding the need for -with-TIFFBIN' + -e 's:tiff2ps:tiffcp:g' + ) + fi + sed "${_seds[@]}" -i 'configure' test ! -s 'configure.Arch' || echo "${}" # Ghostscript dropped Type1 from the font path. @@ -313,13 +455,13 @@ prepare() { #cp -p 'etc/faxsetup.sh.in'{,.Arch} # diff -pNau5 'etc/faxsetup.sh.in'{.Arch,} > '0004a-hylafaxplus-systemd.patch' - patch -Nbup0 -i "${srcdir}/0004a-hylafaxplus-systemd.patch" + patch -Nup0 -i "${srcdir}/0004a-hylafaxplus-systemd.patch" sed -e 's:/bin/systemctl:/usr/bin/systemctl:g' -i 'etc/faxsetup.sh.in' test ! -s 'etc/faxsetup.sh.in.Arch' || echo "${}" #cp -p 'etc/faxsetup.sh.in'{,.Arch} # diff -pNau5 'faxsetup.sh.in'{.Arch,} > '0005-hylafaxplus-faxsetup.patch' - patch -Nbup0 -i "${srcdir}/0005-hylafaxplus-faxsetup.patch" + patch -Nup0 -i "${srcdir}/0005-hylafaxplus-faxsetup.patch" sed -Ee "# Remove ' for mcedit syntax highlighter" \ -e "s:([dD]on)'t:"'\1t:g' \ -e '# Branding' \ @@ -329,7 +471,7 @@ prepare() { #cp -p 'hfaxd/Jobs.c++'{,.Arch} # diff -pNau5 'hfaxd/Jobs.c++'{.Arch,} > '0006-hylafaxplus-jobfmt-assigned-modem-to-used-modem.patch' - patch -Nbup0 -i "${srcdir}/0006-hylafaxplus-jobfmt-assigned-modem-to-used-modem.patch" + patch -Nup0 -i "${srcdir}/0006-hylafaxplus-jobfmt-assigned-modem-to-used-modem.patch" test ! -s 'hfaxd/Jobs.c++.Arch' || echo "${}" #cp -pr 'config'{,.Arch} @@ -393,8 +535,8 @@ prepare() { printf '#\nInclude:\t\t"etc/config-modems"\n' >> "${_cfg}" done - # pretend, that libtiff 4.x is similar to 4.0 - sed -E -e '/tiff_runlen_t/ s:4\..+\):4.[0123456789]):' -i 'configure' + # Switch tiffcp to old version that supports tiffcp -i + sed -e 's:\btiffcp\b:tiffcp.hylafax:g' -i $(grep --include 'configure' --include '*.sh*' -lr -e '\btiffcp\b' .) set +u @@ -403,27 +545,45 @@ prepare() { } build() { + _libtiff_build; cd "${srcdir}" set -u - cd "${_pkgnick}-${pkgver}" + cd "${_srcdir}" if [ ! -s 'Makefile' ]; then + local _conf=( + --nointeractive + --with-OPTIMIZER="${CFLAGS:-}" + --target="${CARCH}-arch-linux" + --with-DIR_BIN='/usr/bin' + --with-DIR_LIB='/usr/lib' + --with-DIR_LIBDATA='/usr/lib/fax' + --with-DIR_LIBEXEC='/usr/bin' + --with-DIR_MAN='/usr/share/man' + --with-DIR_SBIN='/usr/bin' + --with-SYSVINIT='no' + --with-PAGESIZE="${_opt_pagesize}" + --with-SCRIPT_SH='/usr/bin/dash' + #--with-PATH_AFM='/usr/share/fonts/Type1' #gs ignores this + ) + local _LDPATH='' + if [ "${_opt_Integrated_LIBTIFF}" -ne 0 ]; then + _conf+=( + --with-TIFFINC="-I${srcdir}/${_libtiff_srcdir}/libtiff" + --with-LIBTIFF="-L${srcdir}/${_libtiff_srcdir}/libtiff/.libs -ltiff" + #--with-TIFFBIN="${srcdir}/${_libtiff_srcdir}/tools" # not needed if we change TIFFBIN detection to tiffcp and require libtiff>=4.6.0 + ) + _LDPATH="${srcdir}/${_libtiff_srcdir}/libtiff/.libs" + elif [ "${_opt_HF_System_LIBTIFF}" -eq 0 ]; then + _conf+=( + --with-TIFFINC="-I/usr/include/${_libtiff_incdir}" + --with-LIBTIFF="-L/usr/lib/${_libtiff_libdir} -ltiff" + ) + fi # On my system LN has something in it. Short variable names should be avoided in scripts. + LD_LIBRARY_PATH="${_LDPATH}" LN= \ CHOWN="${srcdir}/chown" \ CHGRP="${srcdir}/chgrp" \ - ./configure \ - --nointeractive \ - --with-OPTIMIZER="${CFLAGS}" \ - --target="${CARCH}-arch-linux" \ - --with-DIR_BIN='/usr/bin' \ - --with-DIR_LIB='/usr/lib' \ - --with-DIR_LIBDATA='/usr/lib/fax' \ - --with-DIR_LIBEXEC='/usr/bin' \ - --with-DIR_MAN='/usr/share/man' \ - --with-DIR_SBIN='/usr/bin' \ - --with-SYSVINIT='no' \ - --with-PAGESIZE="${_opt_pagesize}" \ - --with-SCRIPT_SH='/usr/bin/dash' -# --with-PATH_AFM='/usr/share/fonts/Type1' gs ignores this + ./configure "${_conf[@]}" fi make -s -j1 # hylafax is not multi threaded make compatible @@ -431,9 +591,13 @@ build() { set +u } +check() { + _libtiff_check; cd "${srcdir}" +} + package() { set -u - cd "${_pkgnick}-${pkgver}" + cd "${_srcdir}" local _chown="${pkgdir}/_install_chown.sh" @@ -633,7 +797,7 @@ if [ -s "\${QFILE}" ]; then [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]*) echo "RejectNotice: \"Invalid number (\${#number} digits)\"";; [0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]-*) echo "RejectNotice: \"Invalid number (\${#number} digits)\"";; ???111*|000*|111*|???000*) echo 'RejectNotice: "Invalid number"';; - #5175551214-*) echo 'ModemGroup: "Rockwell"';; # not compatible with Lucent + #5175551214-*) echo 'Modem: "Rockwell"';; # not compatible with Lucent #2705551214-*) # bad lines at this location won't let the fax complete # # man sendq # echo 'DesiredBR: 0' # 0 for 2400 bps, 1 for 4800 bps, 2 for 7200 bps, 3 for 9600 bps, 4 for 12000 bps, 5 for 14400 bps, 6 for 16800 bps, 7 for 19200 bps, 8 for 21600 bps, 9 for 24000 bps, 10 for 26400 bps, 11 for 28800 bps, 12 for 31200 bps, and 13 for 33600 bps (default). @@ -725,12 +889,12 @@ EOF # https://aur.archlinux.org/ [Unit] -Description=HylaFAX+ faxgetty on %i +Description=HylaFAX+ faxgetty on %I Documentation=man:faxgetty(8) After=faxq.service hfaxd.service [Service] -ExecStart=/usr/bin/faxgetty %i +ExecStart=/usr/bin/faxgetty %I Nice=-10 Type=simple Restart=always @@ -869,7 +1033,7 @@ if [ "\${EUID}" -ne 0 ]; then exit 1 fi -cd /usr/share/ghostscript/[0-9]*/Resource/Font +cd '/usr/share/ghostscript/Resource/Font' _fn_build() { local f fa fm @@ -901,5 +1065,6 @@ EOF install -Dpm644 'COPYRIGHT' "${pkgdir}/usr/share/licenses/${_pkgnick}/COPYRIGHT" set +u + cd "${srcdir}"; _libtiff_package } set +u |