diff options
author | Chris Severance | 2017-07-21 22:35:34 -0400 |
---|---|---|
committer | Chris Severance | 2017-07-21 22:35:34 -0400 |
commit | 6cf7d3c8253a1276178e839e388bdb529ba09c40 (patch) | |
tree | 044d5be9401d7d113d38acb95dface0de3ff3270 | |
parent | a865c67c8b9c898889bf05ee4e27947745cb36a3 (diff) | |
download | aur-6cf7d3c8253a1276178e839e388bdb529ba09c40.tar.gz |
coverpage hook font dialrules
-rw-r--r-- | .SRCINFO | 36 | ||||
-rw-r--r-- | 0001-dialrules.7-10.digits.USA.patch | 15 | ||||
-rw-r--r-- | 0002-typerules.vertical.margins.patch | 28 | ||||
-rw-r--r-- | 0003-graphic.logo.instructions.patch | 32 | ||||
-rw-r--r-- | 0004-hylafaxplus-systemd.patch | 157 | ||||
-rw-r--r-- | PKGBUILD | 609 | ||||
-rw-r--r-- | faxgetty@.service | 23 | ||||
-rw-r--r-- | faxq.service | 11 | ||||
-rwxr-xr-x | fmfix.pl | 84 | ||||
-rw-r--r-- | hfaxd.service | 11 | ||||
-rw-r--r-- | hylafax.install | 101 | ||||
-rw-r--r-- | hylafax.service | 13 | ||||
-rw-r--r-- | hylafax.timer | 11 | ||||
-rwxr-xr-x | localnxxtoregex.sh | 61 | ||||
-rw-r--r-- | sendfaxvsi-1.0.tgz | bin | 6097 -> 0 bytes |
15 files changed, 819 insertions, 373 deletions
@@ -1,46 +1,46 @@ # Generated by mksrcinfo v8 -# Thu Feb 23 08:00:43 UTC 2017 +# Sat Jul 22 02:33:52 UTC 2017 pkgbase = hylafaxplus pkgdesc = Enterprise Fax Server pkgver = 5.5.9 - pkgrel = 1 + pkgrel = 2 url = http://hylafax.sourceforge.net/ install = hylafax.install arch = i686 arch = x86_64 - license = custom:SGI + license = custom depends = dash depends = libtiff depends = pam depends = ghostscript - depends = gsfonts depends = sharutils depends = jbigkit depends = lcms2 depends = smtp-server + depends = gsfonts-type1 optdepends = avantfax: manage HylaFAX+ through web browser optdepends = t38modem: sip/voip fax modem pool interface optdepends = fax4cups: CUPS fax printer optdepends = faxfrontend: CUPS fax printer optdepends = 2Fax: ascii to fax generator including pictures and fonts - provides = hylafax + provides = hylafax=5.5.9 conflicts = hylafax source = https://downloads.sourceforge.net/hylafax/hylafax-5.5.9.tar.gz - source = hylafax.timer - source = hylafax.service + source = sendfaxvsi-1.0.0.tgz::https://github.com/severach/sendfaxvsi/archive/18fabc74490362cd26690331d546d727c727db25.tar.gz source = fmfix.pl - source = faxq.service - source = hfaxd.service - source = faxgetty@.service - source = sendfaxvsi-1.0.tgz + source = localnxxtoregex.sh + source = 0001-dialrules.7-10.digits.USA.patch + source = 0002-typerules.vertical.margins.patch + source = 0003-graphic.logo.instructions.patch + source = 0004-hylafaxplus-systemd.patch sha256sums = 22e6b98ae008a37b44136b4d08c85bdc2ef8f90629de424e06ec308063a47e30 - sha256sums = ad13d5171f5a8eb55a5773fc429dcef8418db90a8742cec18484534e86198da8 - sha256sums = 7b481d783f3c18303acd7d650321313302401e780616dce1f80b71a210bb58cf - sha256sums = cff7250310dd278554be61ca25539a9ee6da663e14562bdbc9914df4527ff14b - sha256sums = 55505ff501e36281aa2b9c85fe0609d9cd04428a4b6d36e2754919411b615d2d - sha256sums = be96cf8c5fc14fde96c7d37dc9ba2e604aeebe57ce8d5c95dd7567d7e794f3b0 - sha256sums = 3f4cddd872be106041ecc460b7d738a5612668f447c783d5c9e71d9c1b7f62bb - sha256sums = e80c6ffcb5f48bc1bf746b12d40abb94fe5ae79558edfad9c509ade6778cf2cf + sha256sums = 0aed186ab30fdb7cf36895a0ff50b03bd4a68db63cf4f19763995dabd9caffb0 + sha256sums = 613140010f9373998b441eaf7408b59877d00e1f4edb379740d27ccb93250272 + sha256sums = 80d2e28ee7a7d8f93501e32c96e9895e242409da1326761d36dbf28e5a0e3677 + sha256sums = dd4728f8204d0bba2a026768f0e0216778ed26583c3f799f6266554e21b48fe2 + sha256sums = 0a24bee3159a74440a00783c5da1ee2a5e529e46a26a9a91b6be72a5167f40f3 + sha256sums = b4b93c149164ed7c96f4f04373c32198c1e19c89ca9e2ab6e92e17c0a48bd1af + sha256sums = 989d6f71a8cfe99a3ca983981f8d8e9368776e2fc7667a809755d8d7292d52ad pkgname = hylafaxplus diff --git a/0001-dialrules.7-10.digits.USA.patch b/0001-dialrules.7-10.digits.USA.patch new file mode 100644 index 000000000000..6d2f0d35ed77 --- /dev/null +++ b/0001-dialrules.7-10.digits.USA.patch @@ -0,0 +1,15 @@ +--- dialrules.default 2017-07-18 21:05:12.000000000 -0400 ++++ dialrules 2017-07-19 00:07:56.458123090 -0400 +@@ -54,6 +54,12 @@ DialString := [ + [jklJKL] = 5 + [mnoMNO] = 6 + [prsPRS] = 7 + [tuvTUV] = 8 + [wxyWXY] = 9 ++! ^[0-9]{7}$ = ${AreaCode}& ! add area code for USA 7-digit dialers ++! ^[0-9]{10}$ = ${Country}& ! add country code for USA 10-digit dialers ++! Trim to local calls with lines like these ++! local NNX list generated by localnxxtoregex.sh from Arch Linux HylaFax+ package ++! ^${Country}${Area}(20[156]) = \1 ! USA NXX local Big Town calls ++! ^${Country}${Area}(240) = \1 ! USA NXX local Small Town calls + ] diff --git a/0002-typerules.vertical.margins.patch b/0002-typerules.vertical.margins.patch new file mode 100644 index 000000000000..2921b6c7c3ff --- /dev/null +++ b/0002-typerules.vertical.margins.patch @@ -0,0 +1,28 @@ +--- typerules.orig 2017-07-19 00:24:44.000000000 -0400 ++++ typerules 2017-07-19 01:02:17.200865735 -0400 +@@ -148,11 +148,11 @@ + # + 0 string WNGZWZSS error Wingz spreadsheet support not configured + 0 string #Inventor V error IRIS Inventor file support not configured + >15 string binary error binary IRIS Inventor file support not configured + >15 string ascii ps %F/textfmt -B -f Courier-Bold\ +- -Ml=0.4in -p 11 -s %s >%o <%i ++ -Ml=0.30in,r=0.30in,t=0.1in,b=0.1in -p 11 -s %s >%o <%i + + # The following image types are not handled natively, but + # can be used when a converter is installed. Enable the + # conversion match and disable the corresponding error. + 0 string GIF error filetype conversion support not configured +@@ -209,11 +209,11 @@ + + # + # This causes anything else with ascii-only data to be treated as text. + # + 0 ascii x ps %F/textfmt -B -f Courier-Bold\ +- -Ml=0.4in -p 11 -s %s >%o <%i ++ -Ml=0.30in,r=0.30in,t=0.1in,b=0.1in -p 11 -s %s >%o <%i + + # + # Use enscript, instead of HylaFAX textfmt, for converting text into ps. + # 1) Comment out the 2 lines above referring to textfmt + # 2) Un-comment the following 3 lines diff --git a/0003-graphic.logo.instructions.patch b/0003-graphic.logo.instructions.patch new file mode 100644 index 000000000000..b977410652d6 --- /dev/null +++ b/0003-graphic.logo.instructions.patch @@ -0,0 +1,32 @@ +--- cover.templ.default 2017-07-20 17:39:15.000000000 -0400 ++++ cover.templ 2017-07-21 00:04:11.587625035 -0400 +@@ -281,12 +281,27 @@ grestore + } loop + breakLines + end + } def + +-drawlogo +-drawtext ++% Graphic logo: ++% Comment out one or both SGI lines below. ++% Uncomment gsave and grestore. ++% Load logo into Gimp, export as .ps or .eps and paste most ++% between gsave and grestore in place of the sample lines. ++% Adjust translate line for page placement. ++%%% gsave ++ ++% Translate to begin of first scanline ++%%% 60 760 translate ++%%% ... ++%%EndData ++ ++%%% grestore ++ ++drawlogo % SGI logo ++drawtext % SGI text + + 0 0 0 setrgbcolor + /Helvetica-Bold-SHOWISO findfont 24 scalefont setfont + %164.063 644 M 168.356 644 M (Applications Consulting) S + %gsave 164.063 642 M 442 642 L stroke grestore diff --git a/0004-hylafaxplus-systemd.patch b/0004-hylafaxplus-systemd.patch new file mode 100644 index 000000000000..dbbc2608074c --- /dev/null +++ b/0004-hylafaxplus-systemd.patch @@ -0,0 +1,157 @@ +--- etc/faxsetup.sh.in.Arch 2017-02-17 20:03:09.000000000 -0500 ++++ etc/faxsetup.sh.in 2017-07-21 20:06:57.802780575 -0400 +@@ -113,11 +113,11 @@ PATH_IMPRIP=@IMPRIP@ # pathname of IRIX + POSIXLY_CORRECT=1; export POSIXLY_CORRECT # disable GNU extensions + + # + # Location of sysv init script + # +-DIR_SYSVINIT=@SYSVINITDIR@ ++DIR_SYSVINIT="systemd" + FAXQ_SERVER=@FAXQ_SERVER@ + HFAXD_SERVER=@HFAXD_SERVER@ + HFAXD_SNPP_SERVER=@HFAXD_SNPP_SERVER@ + + # +@@ -1892,11 +1892,20 @@ fi + # + # Check that for servers being started at system boot. + # + if onServer; then + signalINETD=no +- if [ -f ${DIR_SYSVINIT}/hylafax ]; then ++ ishylaInit () ++ { ++ if [ "${DIR_SYSVINIT}" = "systemd" ]; then ++ systemctl -q is-active hfaxd.service ++ else ++ [ -f ${DIR_SYSVINIT}/hylafax ] ++ fi ++ } ++ ++ if ishylaInit; then + # started by init at boot time + if [ $FAXQ_SERVER = no ]; then + cat <<EOF + + Warning faxq will NOT be automatically started on reboot! +@@ -2389,11 +2398,13 @@ if onServer; then + else + x= + echo + fi + if isOK "$x"; then +- if kill $HFAXD; then ++ if [ "${DIR_SYSVINIT}" = "systemd" ]; then ++ systemctl stop hfaxd.service ++ elif kill $HFAXD; then + echo "Sent a SIGTERM to processes $HFAXD." + else + echo "Unable to send a SIGTERM to processes $HFAXD." + fi + while true; do +@@ -2407,11 +2418,14 @@ if onServer; then + + Warning: hfaxd is still running! + + Something is hung. The command + +- kill $HFAXD ++ kill $HFAXD (SysV) ++or ++ systemctl stop hfaxd.service (systemd) ++ + + did not terminate the hfaxd processes as expected. + EOF + prompt "Should we continue to wait [no]?"; + if [ "$INTERACTIVE" != "no" ]; then +@@ -2437,11 +2451,15 @@ EOF + else + x= + echo + fi + if isOK "$x"; then +- $DIR_SBIN/faxquit >/dev/null 2>&1 ++ if [ "$DIR_SYSVINIT" = "systemd" ]; then ++ systemctl stop faxq.service ++ else ++ $DIR_SBIN/faxquit >/dev/null 2>&1 ++ fi + while true; do + for delay in 1 1 2 2 5 5; do + FAXQ="`findproc faxq`" + test "$FAXQ" || break + sleep $delay +@@ -2524,11 +2542,21 @@ EOF + x= + echo + fi + if isOK "$x"; then + echo "" +- if [ -x ${DIR_SYSVINIT}/hylafax ]; then ++ # The systemd code does not adequately duplicate the functionality of SysV ++ if [ "$DIR_SYSVINIT" = "systemd" ]; then ++ if isOK "$FAXQ_SERVER"; then systemctl start faxq.service; fi ++ if isOK "$HFAXD_SNPP_SERVER"; then ++ sed -i -e 's|^\(ExecStart=/usr/bin/hfaxd -i hylafax\)\(.*\)$|\1 -s snpp|g' /usr/lib/systemd/system/hfaxd.service ++ else ++ sed -i -e 's|^\(ExecStart=/usr/bin/hfaxd -i hylafax\)\(.*\)$|\1|g' /usr/lib/systemd/system/hfaxd.service ++ fi ++ systemctl daemon-reload ++ if isOK "$HFAXD_SERVER"; then systemctl start hfaxd.service; fi ++ elif [ -x ${DIR_SYSVINIT}/hylafax ]; then + echo ${DIR_SYSVINIT}/hylafax start + ${DIR_SYSVINIT}/hylafax start + else + echo $DIR_SBIN/faxq; $DIR_SBIN/faxq + hfaxdopts= +@@ -2582,17 +2610,24 @@ EOF + fi + if isOK "$x"; then + for x in $DEVS; do + devid="`expr $x : 'config.\(.*\)'`" + if [ -w $DIR_SPOOL/FIFO.$devid ]; then +- echo $DIR_SBIN/faxquit $devid +- $DIR_SBIN/faxquit $devid >/dev/null 2>&1 ++ if [ "$DIR_SYSVINIT" = "systemd" ]; then ++ systemctl enable "faxgetty@$devid.service" ++ systemctl restart "faxgetty@$devid.service" ++ else ++ echo $DIR_SBIN/faxquit $devid ++ $DIR_SBIN/faxquit $devid >/dev/null 2>&1 ++ fi + fi + done + fi + else +- if [ -f /etc/inittab ]; then ++ if [ "$DIR_SYSVINIT" = "systemd" ]; then ++ FAXGETTY="`cd /etc/systemd/system/multi-user.target.wants; echo faxgetty@*.service`"; test "$FAXGETTY" = "faxgetty@*.service" && unset FAXGETTY ++ elif [ -f /etc/inittab ]; then + FAXGETTY="`$GREP '[^#].*:respawn:faxgetty.*' /etc/inittab`" + elif [ -f /etc/ttys ]; then + FAXGETTY="`$GREP '[^#].*faxgetty.*' /etc/ttys`" + fi + if [ "$FAXGETTY" ]; then +@@ -2610,11 +2645,19 @@ EOF + x= + echo + fi + if isOK "$x"; then + init="`findproc init`" +- if [ "$init" ]; then ++ if [ "$DIR_SYSVINIT" = "systemd" ]; then ++ for x in $DEVS; do ++ devid="`expr $x : 'config.\(.*\)'`" ++ if [ -w $DIR_SPOOL/FIFO.$devid ]; then ++ systemctl enable "faxgetty@$devid.service" ++ systemctl restart "faxgetty@$devid.service" ++ fi ++ done ++ elif [ "$init" ]; then + if kill -HUP $init; then + echo "Sent init a SIGHUP; the faxgetty processes should be started." + else + echo "Unable to send init a SIGHUP; you may need to do this yourself." + fi @@ -1,6 +1,5 @@ # Maintainer: Chris Severance aur.severach aATt spamgourmet dott com # Contributor: vicks <aur-hylafaxplus@p.lalouisianaise.com> -# Category: daemons # Note: These TODO may not be things I'm planning to fix. Some of them are just # notes to be fixed by someone else who wants that functionality and warnings @@ -17,24 +16,39 @@ # WANT: faxstat how to show only the last n days, like tail? # WANT: a faxmovemodem: to rename or remove modem without shutting fax system down, compatible with faxmodem and faxgetty. -# TODO: Automatically fix font path in /usr/lib/fax/hyla.conf whenever ghostscript upgrades. -# TODO: Cover pages in PKGBUILD for ready made installs. # TODO: faxcron timer run as uucp. faxqclean must run as root. # TODO: find more optional dependencies +# TODO: Better default font. +# TODO: Fix faxd-makefile-bug on make install +# TODO: Improve systemd code now that it's out of sed and in patch -# Setup these parameters +# Setting these skel defaults will make adding modems easier. _opt_AreaCode="517" -_opt_FAXNumber="+1.517.555.0001" # Default: +1.517.555.0001 +_opt_FAXNumber="+1.517.555.0101" # Default: +1.517.555.0101 _opt_LocalIdentifier="ArchLinuxFAX" # Default: ArchLinuxFAX _opt_RingsBeforeAnswer="1" # set to 0 to make faxgetty send only + +# Configuration parameters + _opt_MaintenanceTime="06:10:00" # Cleanup will run every 12 hours starting at this time _opt_hosts_hfaxd="192.168.[0-9]+.[0-9]+" # Default "", hosts to add to hosts.hfaxd _opt_pagesize="Letter" # A4, Letter, Legal +# Recommended modems + +# http://hylafax.sourceforge.net/howto/intro.php#ss1.4 + +# Some fax documentation recommend against Ethernet serial servers +# because of the unpredictable delays inherent in Ethernet communication. + +# Most PCI, PCIe, and USB serial ports are supported. I'm using USB. +# USB is self powered, does not compete for high performance slots, +# and does not create the highly contested /dev/ttyS* or +# /dev/ttyUSB* nodes. + # How to install: -# Recommended build command: makepkg -scCfi # Before running faxsetup, let's see which daemons we want to run. # man faxq # used only if modems are present on this system @@ -48,7 +62,7 @@ _opt_pagesize="Letter" # A4, Letter, Legal # faxsetup will ask to run faxaddmodem only if there are no modems set up. # Answer yes if you like but you might as well answer no to # Do you want to run faxaddmodem to configure a modem [yes]? no -# because you'll need to run faxaddmodem anyways to add more modems. +# because you'll need to run faxaddmodem anyways to add more than one modem. # You can run with or without faxgetty # faxgetty makes your setup more reliable and easier to manage. @@ -58,8 +72,11 @@ _opt_pagesize="Letter" # A4, Letter, Legal # and enable/start your modems. # faxmodem systemd support is incomplete. Modems will not autostart on boot. +# What modems are configured? +# ls /var/spool/hylafax/etc/config.tty* + # sudo faxaddmodem -# Add as many modems as you like. See below for some untested high speed techniques. +# Add as many modems as you like. See below for some minimally high speed techniques. # Enable one of the modems with some of the following commands. @@ -76,109 +93,78 @@ _opt_pagesize="Letter" # A4, Letter, Legal # sudo faxsetup # HylaFAX recommends you run faxsetup to restart the servers after every -# upgrade. This PKGBUILD is programmed to not require this. You need to run -# faxsetup whenever ghostscript upgrades or the fonts won't be found. This -# needs to be fixed if anyone can figure out how. +# upgrade. This PKGBUILD is programmed to not require this. # Are the services running? # systemctl status faxq # systemctl status hfaxd -# systemctl list-units "faxgetty@*.service" -# systemctl list-timers +# systemctl list-units 'faxgetty@*.service' +# systemctl list-timers 'hylafax.timer' # Once you have a modem set up with phone line unplugged -# sendfax -n -d 5175551212 /etc/passwd +# sendfax -n -d 5175550113 /etc/passwd # Once you see that the modem is trying to send, let's see the job. -# faxstat -s +# faxstat -s # Let's delete that job (change the id as necessary) -# faxrm 1 +# faxrm 1 # Be patient. This can take a minute if the job is active on a modem in faxq. # Let's see what happened to that job. -# faxstat -sd +# faxstat -sd +# Try sending a real fax. +# sendfax -n -d 5175550113 file +# If this doesn't work you'll need to modify dial rules: +# man dialrules +# dialtest -a 517 '/var/spool/hylafax/etc/dialrules' +# http://www.hylafax.org/archive/2007-10/msg00152.php +# https://www.allareacodes.com/517 +# http://localcallingguide.com/ +# dialrules modifications apply immediately, no restarting necessary. + +# To remove SGI logo and add your own see +# /var/spool/hylafax/etc/cover.templ + # After you get a few real faxes sent, let's see how we're performing. -# xferfaxstats +# xferfaxstats # Let's see a log file -# less /var/spool/hylafax/etc/xferfaxlog +# less -S '/var/spool/hylafax/etc/xferfaxlog' # Avoid restarting the daemons manually with systemctl. Too many commands, and # too tricky. Use faxsetup to restart the daemons and enable the modems. # If the skel defaults are correct and prefab modem configs are available a # large number of modems could be automatically set up this way. -# cd /dev; for i in ttyUSB[1-3]; do faxaddmodem -nointeractive -s 38400 $i; done +# cd /dev; for i in ttyUSB[1-3]; do faxaddmodem -nointeractive -s 38400 $i; done -# Once the first one is set up, a fast, loose, and untested method for a very +# Once the first one is set up, a fast, loose, and minimally tested method for a very # large number of identical modems could work like this: -# cd /dev -# mdmlist=`echo ttyUSB* ttyS* ttya[a-m]*` # example 8 USB, 4 serial, 13*16=832 Digi PortServer (dgrp). +# cd '/dev' +# mdmlist=(ttyUSB* ttyS* ttya[a-m]*) # example 8 USB, 4 serial, 13*16=832 Digi PortServer (dgrp). # # This is ridiculous of course since there's no single computer with enough # # power to run 844 fax modems. -# cd /var/spool/hylafax -# for ttymdm in $mdmlist; do -# if [ "$ttymdm" != "ttyUSB0" ]; then -# cp -p /etc/config.ttyUSB0 /etc/config.$ttymdm -# mkfifo FIFO.$ttymdm -# # faxmodem $ttymdm -# systemctl enable faxgetty@$ttymodem.service -# systemctl start faxgetty@$ttymodem.service +# cd '/var/spool/hylafax' +# for ttymdm in "${mdmlist[@]}"; do +# if [ "${ttymdm}" != 'ttyUSB0' ]; then +# cp -p 'etc/config.ttyUSB0' "etc/config.${ttymdm}" +# mkfifo "FIFO.${ttymdm}" +# chmod 600 "${ttymdm}" +# chown 'uucp:uucp' "${ttymdm}" +# # faxmodem "${ttymdm}" +# systemctl enable "faxgetty@${ttymdm}.service" +# systemctl start "faxgetty@${ttymdm}.service" # fi # done # Helpful guides # Arch Wiki: https://wiki.archlinux.org/index.php/Hylafax # Debian Wiki: https://wiki.debian.org/HylaFax -# Gentoo Wiki: http://www.gentoo-wiki.info/HylaFAX +# Gentoo Wiki: http://www.gentoo-wiki.info/HylaFAX (defunct) # Univention Wiki: http://wiki.univention.com/index.php?title=HylaFAX_setup # HylaFAX user contributions: ftp://ftp.hylafax.org/contrib/ +# http://aplawrence.com/Linux/hylafax-scripts.html # VGETTY: http://www.cril.ch/anciens_projets.html.html#vgetty_voice_mail_and_extensions Vgetty Documentation Center # VGETTY: http://alpha.greenie.net/vgetty/ -# Linux modem support is troublesome. Serial based products all create ttys -# which requires them to be kernel modules. Linux changes the kernel interface -# constantly for peak functionality and performance. This means that many -# modem products work for a while then quit working as of a certain kernel -# version. Manufacturers much prefer Windows where driver compatibility is -# maintained over many versions rather than going back to revise the driver -# each time the Linux kernel devs change something. Arch Linux as a rolling -# release is on the front lines of this constant change. Modems are a -# declining market so manufacturers have little interest in continuously -# revising drivers. The solution for us is to stick to interfaces that are -# actively maintained either by the manufacturers or by the Linux kernel devs. - -# Here are the ones that continue to work even on the latest kernels. I'm only -# listing brands with 2 or more ports and modems I've tried. Multi port serial -# products is sorted by number of lights. I'm only listing products similar -# to those I've tried. There may be other well supported products. - -# Ethernet serial: Digi PortServer dgrp -# Note: Some fax documentation recommend against Ethernet serial servers -# because of the unpredictable delays inherent in Ethernet communication. -# I don't see any other way to support hundreds of modems. -# FTDI USB Serial 2: VSCOM -# FTDI USB Serial 2: Perle Ultraport -# FTDI USB Serial 2: Sewell -# FTDI USB Serial 2: BrainBoxes US -# FTDI USB Serial 2: B&B Electronics ULINX -# FTDI USB Serial 2: Startech -# FTDI USB Serial 2: SIIG -# FTDI USB Serial 2: SerialGear -# FTDI USB Serial 2: EasySYNC -# FTDI USB Serial 2: Shentek -# FTDI USB Serial 1: SeaLevel SeaLINK -# FTDI USB Serial 0: Digi Edgeport -# FTDI USB Serial 0: Comtrol RocketPort -# FTDI USB Serial 0: Hightek HK -# ACM USB Serial: Zyxel Multitech MT5634ZBA-USB-V.92-AV -# (This modem is properly supported by usbserial & udev in Linux 4.0+. You -# don't need the mknod instructions found at the Multitech web site.) - -# I prefer USB over PCI, PCIe, or Ethernet. Ethernet has timing issues. -# No reason to compete for a limited number of high performance PCIe slots -# with low performance serial devices. ISA, EISA, VESA, PCI, PCIe are all -# temporary technologies that will be replaced eventually. USB will last -# essentially forever with no changes. - # For an interesting discussion of Hylafax vs Hylafax+ vs vsi-fax see: # 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 @@ -187,12 +173,13 @@ set -u pkgname='hylafaxplus' _pkgnick='hylafax' pkgver='5.5.9' -pkgrel='1' +pkgrel='2' +_sendfaxvsicommit='18fabc74490362cd26690331d546d727c727db25' pkgdesc='Enterprise Fax Server' arch=('i686' 'x86_64') url='http://hylafax.sourceforge.net/' -license=('custom:SGI') -depends=('dash' 'libtiff' 'pam' 'ghostscript' 'gsfonts' 'sharutils' 'jbigkit' 'lcms2' 'smtp-server') # 'cron' +license=('custom') +depends=('dash' 'libtiff' 'pam' 'ghostscript' 'sharutils' 'jbigkit' 'lcms2' 'smtp-server' 'gsfonts-type1') # 'cron' # 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=('avantfax: manage HylaFAX+ through web browser' #'HERMESfax: manage HylaFAX+ through web browser' # Way too old @@ -201,35 +188,37 @@ optdepends=('avantfax: manage HylaFAX+ through web browser' 'faxfrontend: CUPS fax printer' # https://www.vitki.net/book/page/integrating-hylafax-cups '2Fax: ascii to fax generator including pictures and fonts' # http://www.atbas.org/2fax/ascii.php #'cypheus: (Windows) manage HylaFAX+' # Pretty old -# Too ad like... We'll leave them here for avid readers. +# Too ad like and will show in red as not found packages... We'll leave them here for avid readers. #'Winprint-HylaFAX-Reloaded: (Windows) print to fax' # http://nerdvittles.com/?p=738 Incredible Fax: Free Faxing Returns to Incredible PBX 1.8 #'WinPrint-Hylafax-for-Windows: (Windows) print to fax' #'Hylafax-support: iFax Solutions can help configure your fax system' +# 'sambafax' +# 'gfax: fax from Gnome (X)' ) -provides=('hylafax') +provides=("hylafax=${pkgver}") conflicts=('hylafax') # backup=(var/spool/hylafax/bin/{faxrcvd,notify}) -install='hylafax.install' +install="${_pkgnick}.install" # 'var/spool/hylafax/etc/hosts.hfaxd') # This is better handled with a .default file. _verwatch=("${url}" 'news/\([0-9\.]\+\)\.php' 'l') -source=("https://downloads.sourceforge.net/hylafax/${_pkgnick}-${pkgver}.tar.gz" - hylafax.{timer,service} - 'fmfix.pl' - 'faxq.service' - 'hfaxd.service' - 'faxgetty@.service' - 'sendfaxvsi-1.0.tgz') +source=( + "https://downloads.sourceforge.net/hylafax/${_pkgnick}-${pkgver}.tar.gz" + "sendfaxvsi-1.0.0.tgz::https://github.com/severach/sendfaxvsi/archive/${_sendfaxvsicommit}.tar.gz" + 'fmfix.pl' + 'localnxxtoregex.sh' + '0001-dialrules.7-10.digits.USA.patch' + '0002-typerules.vertical.margins.patch' + '0003-graphic.logo.instructions.patch' + '0004-hylafaxplus-systemd.patch' +) sha256sums=('22e6b98ae008a37b44136b4d08c85bdc2ef8f90629de424e06ec308063a47e30' - 'ad13d5171f5a8eb55a5773fc429dcef8418db90a8742cec18484534e86198da8' - '7b481d783f3c18303acd7d650321313302401e780616dce1f80b71a210bb58cf' - 'cff7250310dd278554be61ca25539a9ee6da663e14562bdbc9914df4527ff14b' - '55505ff501e36281aa2b9c85fe0609d9cd04428a4b6d36e2754919411b615d2d' - 'be96cf8c5fc14fde96c7d37dc9ba2e604aeebe57ce8d5c95dd7567d7e794f3b0' - '3f4cddd872be106041ecc460b7d738a5612668f447c783d5c9e71d9c1b7f62bb' - 'e80c6ffcb5f48bc1bf746b12d40abb94fe5ae79558edfad9c509ade6778cf2cf') -# 'sambafax' -# 'gfax: fax from Gnome (X)' - + '0aed186ab30fdb7cf36895a0ff50b03bd4a68db63cf4f19763995dabd9caffb0' + '613140010f9373998b441eaf7408b59877d00e1f4edb379740d27ccb93250272' + '80d2e28ee7a7d8f93501e32c96e9895e242409da1326761d36dbf28e5a0e3677' + 'dd4728f8204d0bba2a026768f0e0216778ed26583c3f799f6266554e21b48fe2' + '0a24bee3159a74440a00783c5da1ee2a5e529e46a26a9a91b6be72a5167f40f3' + 'b4b93c149164ed7c96f4f04373c32198c1e19c89ca9e2ab6e92e17c0a48bd1af' + '989d6f71a8cfe99a3ca983981f8d8e9368776e2fc7667a809755d8d7292d52ad') # The HylaFAX binaries work very well. The scripts need major fixes! # HylaFAX+ is pretty much completely broken for any Linux install, # and some parts are broken for other Unix too. The original HylaFAX @@ -250,7 +239,7 @@ sha256sums=('22e6b98ae008a37b44136b4d08c85bdc2ef8f90629de424e06ec308063a47e30' _pkginit() { if [ "${SOURCEONLY:-0}" -ne 0 ]; then # see makepkg -S if this var changes - if [ "${_opt_FAXNumber}" != '+1.517.555.0001' -o "${_opt_LocalIdentifier}" != 'ArchLinuxFAX' ]; then + if [ "${_opt_FAXNumber}" != '+1.517.555.0113' ] || [ "${_opt_LocalIdentifier}" != 'ArchLinuxFAX' ]; then echo 'Our fax info must be removed from the PKGBUILD' 1>&2 echo 'to produce a source package.' 1>&2 exit 1 @@ -258,84 +247,66 @@ _pkginit() { fi } _pkginit +unset -f _pkginit prepare() { set -u - cd "${srcdir}/${_pkgnick}-${pkgver}" + cd "${_pkgnick}-${pkgver}" # 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. - sed -i -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' \ - 'configure' + 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' # Eliminate all uses of /bin/sh which on Arch Linux is bash. configure gets # some of them. dash is partly for performance on high volume fax servers # and partly to ensure my changes to scripts conform to strict POSIX. # Upstream is more likely to accept the patches if they don't need to # remove bashishms. - sed -i -e 's:^#! */bin/sh$:#!/usr/bin/dash:g' \ - 'config.'{guess,sub} faxmail/mailfax.sh* dist/new* - sed -i -e 's:execl("/bin/sh":execl("/usr/bin/dash":g' \ - faxd/{faxApp.c++,faxGettyApp.c++} - - # apply PKGBUILD defaults to default etc/skel for hands free multi modem setup - sed -i -e 's/^\(AreaCode:\s\+\)[^#\t]\+\(.*\)$'"/\1${_opt_AreaCode}\2/g" \ - -e 's/^\(FAXNumber:\s\+\)[^#\t]\+\(.*\)$'"/\1${_opt_FAXNumber}\2/g" \ - -e 's/^\(LocalIdentifier:\s\+\)[^#\t]\+\(.*\)$'"/\1\"${_opt_LocalIdentifier}\"\2/g" \ - -e 's/^\(RingsBeforeAnswer:\s\+\)[^#\t]\+\(.*\)$'"/\1${_opt_RingsBeforeAnswer}\2/g" \ - 'config/skel' - - sed -i -e '# More sbin fixes' \ - -e 's:^\(test -d /usr/sbin &&\):#\1:g' \ - -e "# Add crude systemd support. faxmodem init on boot is still missing but I'm using faxgetty so I don't care" \ - -e 's/^\(DIR_SYSVINIT\)=@SYSVINITDIR@$/\1="systemd"/g' \ - -e 's:^\(\s\+\)if \[ -f ${DIR_SYSVINIT}/hylafax \]; then$:\1ishylaInit ()\n\1{\n\1if [ "${DIR_SYSVINIT}" = "systemd" ]; then\n\1 systemctl -q is-active hfaxd.service\n\1else\n\1 [ -f ${DIR_SYSVINIT}/hylafax ]\n\1fi\n\1}\n\n\1if ishylaInit; then:g' \ - -e 's/^\(\s\+\)\(if kill $HFAXD; then\)$/\1if [ "${DIR_SYSVINIT}" = "systemd" ]; then\n\1 systemctl stop hfaxd.service\n\1el\2/g' \ - -e 's:^\(\s\+\)\($DIR_SBIN/faxquit >/dev/null 2>&1\)$:\1if [ "$DIR_SYSVINIT" = "systemd" ]; then\n\1 systemctl stop faxq.service\n\1else\n\1 \2\n\1fi:g' \ - -e 's/^\( \)\(kill $HFAXD\)$/\1\2 (SysV)\nor\n\1systemctl stop hfaxd.service (systemd)\n/g' \ - -e 's:^\(\s\+\)\(if \[ -x ${DIR_SYSVINIT}/hylafax \]; then\)$:\1# The systemd code does not adequately duplicate the functionality of SysV\n\1if [ "$DIR_SYSVINIT" = "systemd" ]; then\n\1 if isOK "$FAXQ_SERVER"; then systemctl start faxq.service; fi\n\1 if isOK "$HFAXD_SNPP_SERVER"; then\n\1 sed -i -e '"'"'s|^\\(ExecStart=/usr/bin/hfaxd -i hylafax\\)\\(.*\\)$|\\1 -s snpp|g'"'"' /usr/lib/systemd/system/hfaxd.service\n\1 else\n\1 sed -i -e '"'"'s|^\\(ExecStart=/usr/bin/hfaxd -i hylafax\\)\\(.*\\)$|\\1|g'"'"' /usr/lib/systemd/system/hfaxd.service\n\1 fi\n\1 systemctl daemon-reload\n\1 if isOK "$HFAXD_SERVER"; then systemctl start hfaxd.service; fi\n\1el\2:g' \ - -e '# Fix FAXD= typo' \ - -e 's:^\(\s\+\)\(FAXD="`findproc hfaxd`"\)$:\1H\2:g' \ - -e "# Remove ' for mcedit syntax highlighter" \ - -e 's:\([dD]on\)'"'"'t:\1t:g' \ - -e "# This would have been easier to fix if the error wasn't hidden" \ - -e 's:^\(\s\+\)\($DIR_SBIN/faxmodem $devid\)\( >/dev/null 2>&1\)$:\1\2 #\3 # Hiding these errors is counter productive!:g' \ - -e '# Fix LN for anyone who has LN in their environment' \ - -e 's:^\(LN=\):unset LN\n\1:g' \ - -e '# vgetty and egetty are not readily available on Arch Linux so kill the warning.' \ - -e '# Supress warning: /bin/vgetty does not exist or is not an executable program!' \ - -e '# Supress warning: /bin/egetty does not exist or is not an executable program!' \ - -e 's|^\(\s\+\)\(test -x $PATH_\)\([VE]GETTY\)\(.\+\)$|\1echo "\3 not available for Arch Linux" # \2\3\4 # http://www.hylafax.org/site2/HylaFAQ/Q360.html Q360: The truth about egetty/vgetty|g' \ - -e '# The gsfonts are likely to never be again placed in this folder.' \ - -e '# Why does gs report the folder in the search path?' \ - -e '# Supress warning: /usr/share/ghostscript/fonts does not exist or is not a directory!' \ - -e 's|^\(\s\+\)\(if \[ -d $FDIR \]; then\)$|\1if [ ! -d "$FDIR" -a "$FDIR" = "/usr/share/ghostscript/fonts" ]; then\n\1 echo -n ""\n\1el\2|g' \ - -e '# Branding' \ - -e 's|^\(Note "Setup program for HylaFAX (tm) $VERSION\)."$|\1-Arch Linux."|g' \ - -e '# Improve display for 25 line screens. I skipped one that would take too much regex to get.' \ - -e 's|^\(\t\t\)\(Note ""\)$|\1# \2|g' \ - -e 's|^\(\t \)\(Note ""\)$|\1# \2|g' \ - -e '# Fix genfontmap output to get rid of glyph metric error.' \ - -e 's:\($DIR_SPOOL/bin/genfontmap.ps\) \(> $DIR_SPOOL/etc/Fontmap.HylaFAX\):\1 | $DIR_SPOOL/bin/fmfix.pl \2:g' \ - -e '# Fix some typos. Clarify SNPP.' \ - -e 's|\(\[2\] Init script starts hfaxd\)|\1:|g' \ - -e 's|\(\[3\] Start paging protocol\):\t|\1 (SNPP):|g' \ - -e '# systemd handling of faxgetty. Using sed limits how nice I can make the hacks.' \ - -e 's|^\(\s\+\)\(echo $DIR_SBIN/faxquit $devid\)$|\1if [ "$DIR_SYSVINIT" = "systemd" ]; then\n\1 systemctl enable "faxgetty@$devid.service"\n\1 systemctl restart "faxgetty@$devid.service"\n\1else\n\1 \2|g' \ - -e 's|^\(\s\+\)\($DIR_SBIN/faxquit $devid >/dev/null 2>&1\)$|\1 \2\n\1fi|g' \ - -e 's|^\(\s\+\)\(if \[ -f /etc/inittab \]; then\)$|\1if [ "$DIR_SYSVINIT" = "systemd" ]; then\n\1 FAXGETTY="`cd /etc/systemd/system/multi-user.target.wants; echo faxgetty@*.service`"; test "$FAXGETTY" = "faxgetty@*.service" \&\& unset FAXGETTY\n\1el\2|g' \ - -e 's|^\(\s\+\)\(if \[ "$init" \]; then\)$|\1if [ "$DIR_SYSVINIT" = "systemd" ]; then\n\1 for x in $DEVS; do\n\1 devid="`expr $x : '"'"'config.\\(.*\\)'"'"'`"\n\1 if [ -w $DIR_SPOOL/FIFO.$devid ]; then\n\1 systemctl enable "faxgetty@$devid.service"\n\1 systemctl restart "faxgetty@$devid.service"\n\1 fi\n\1 done\n\1el\2|g' \ - -e '# Remove /etc from path' \ - -e 's|^\(PATH\)=.\+$|\1=/usr/bin:/usr/local/sbin|g' \ - -e '# Apply default area code for easier setup' \ - -e 's|^\(AREACODE\)=.\+$'"|\1=${_opt_AreaCode}|g" \ - 'etc/faxsetup.sh.in' + sed -e 's:^#! */bin/sh$:#!/usr/bin/dash:g' -i 'config.'{guess,sub} faxmail/mailfax.sh* dist/new* + sed -e 's:execl("/bin/sh":execl("/usr/bin/dash":g' -i faxd/{faxApp.c++,faxGettyApp.c++} + + #cp -p 'etc/faxsetup.sh.in'{,.Arch} + # diff -pNau5 'etc/faxsetup.sh.in'{.Arch,} > '0004-hylafaxplus-systemd.patch' + patch -Nup0 < "${srcdir}/0004-hylafaxplus-systemd.patch" + + sed -e '# Fix FAXD= typo' \ + -e 's:^\(\s\+\)\(FAXD="`findproc hfaxd`"\)$:\1H\2:g' \ + -e "# Remove ' for mcedit syntax highlighter" \ + -e 's:\([dD]on\)'"'"'t:\1t:g' \ + -e "# This would have been easier to fix if the error wasn't hidden" \ + -e 's:^\(\s\+\)\($DIR_SBIN/faxmodem $devid\)\( >/dev/null 2>&1\)$:\1\2 #\3 # Hiding these errors is counter productive!:g' \ + -e '# Fix LN for anyone who has LN in their environment' \ + -e 's:^\(LN=\):unset LN\n\1:g' \ + -e '# vgetty and egetty are not readily available on Arch Linux so kill the warning.' \ + -e '# Supress warning: /bin/vgetty does not exist or is not an executable program!' \ + -e '# Supress warning: /bin/egetty does not exist or is not an executable program!' \ + -e 's|^\(\s\+\)\(test -x $PATH_\)\([VE]GETTY\)\(.\+\)$|\1echo "\3 not available for Arch Linux" # \2\3\4 # http://www.hylafax.org/site2/HylaFAQ/Q360.html Q360: The truth about egetty/vgetty|g' \ + -e '# The gsfonts are likely to never be again placed in this folder.' \ + -e '# Why does gs report the folder in the search path?' \ + -e '# Supress warning: /usr/share/ghostscript/fonts does not exist or is not a directory!' \ + -e 's|^\(\s\+\)\(if \[ -d $FDIR \]; then\)$|\1if [ ! -d "$FDIR" -a "$FDIR" = "/usr/share/ghostscript/fonts" ]; then\n\1 echo -n ""\n\1el\2|g' \ + -e '# Branding' \ + -e 's|^\(Note "Setup program for HylaFAX (tm) $VERSION\)."$|\1-Arch Linux."|g' \ + -e '# Improve display for 25 line screens. I skipped one that would take too much regex to get.' \ + -e 's|^\(\t\t\)\(Note ""\)$|\1# \2|g' \ + -e 's|^\(\t \)\(Note ""\)$|\1# \2|g' \ + -e '# Fix genfontmap output to get rid of glyph metric error.' \ + -e 's:\($DIR_SPOOL/bin/genfontmap.ps\) \(> $DIR_SPOOL/etc/Fontmap.HylaFAX\):\1 | $DIR_SPOOL/bin/fmfix.pl \2:g' \ + -e '# Fix some typos. Clarify SNPP.' \ + -e 's|\(\[2\] Init script starts hfaxd\)|\1:|g' \ + -e 's|\(\[3\] Start paging protocol\):\t|\1 (SNPP):|g' \ + -e '# More sbin fixes' \ + -e 's:^\(test -d /usr/sbin &&\):#\1:g' \ + -e '# Remove /etc from path' \ + -e 's|^\(PATH\)=.\+$|\1=/usr/bin:/usr/local/sbin|g' \ + -i 'etc/faxsetup.sh.in' # Var $TTY clashes with the Arch Linux environment and likely all other Linux # too. $TTY contains the terminal device from `tty`. With this already set @@ -363,102 +334,114 @@ prepare() { # same as faxaddmodem ttyUSB0. # With all these bugs fixed you can install HylaFAX+ the way it was # originally designed, and it's not very hard. - sed -s -i -e 's:$TTY\>:$MDMTTY:g' \ - -e 's:\<TTY=:MDMTTY=:g' \ - -e 's:\<read TTY\>:read MDMTTY:g' \ - -e 's:^\(DEVPATH="/dev/"\)$:\1\ncleanMDM () {\n if [ "$1" = "`dirname "$2"`/" ]; then\n MDMTTY="`basename $2`"\n else\n MDMTTY="$2"\n fi\n case "$MDMTTY" in\n /*)SHOWTTY="$MDMTTY";;\n "")SHOWTTY=;;\n *)SHOWTTY="$1$MDMTTY";;\n esac\n}\ncleanMDM "$DEVPATH" "$MDMTTY"\n:g' \ - -e 's?^\(\s\+\)\(prompt "Serial port that modem is connected to .\+\)$?\1echo ""\n\1echo "Leave /dev off if your device is in /dev"\n\1echo "Examples: ttyUSB0, ttyACM0, ttyS0"\n\1\2\n\1test "$MDMTTY" || (cd /dev; ls tty[^0-9]*)\n\1cleanMDM "$DEVPATH" "$MDMTTY"?g' \ - -e 's?$DEVPATH$MDMTTY?$SHOWTTY?g' \ - etc/{faxaddmodem,probemodem}.sh.in + sed -e 's:$TTY\>:$MDMTTY:g' \ + -e 's:\<TTY=:MDMTTY=:g' \ + -e 's:\<read TTY\>:read MDMTTY:g' \ + -e 's:^\(DEVPATH="/dev/"\)$:\1\ncleanMDM () {\n if [ "$1" = "`dirname "$2"`/" ]; then\n MDMTTY="`basename $2`"\n else\n MDMTTY="$2"\n fi\n case "$MDMTTY" in\n /*)SHOWTTY="$MDMTTY";;\n "")SHOWTTY=;;\n *)SHOWTTY="$1$MDMTTY";;\n esac\n}\ncleanMDM "$DEVPATH" "$MDMTTY"\n:g' \ + -e 's?^\(\s\+\)\(prompt "Serial port that modem is connected to .\+\)$?\1echo ""\n\1echo "Leave /dev off if your device is in /dev"\n\1echo "Examples: ttyUSB0, ttyACM0, ttyS0"\n\1\2\n\1test "$MDMTTY" || (cd /dev; ls tty[^0-9]*)\n\1cleanMDM "$DEVPATH" "$MDMTTY"?g' \ + -e 's?$DEVPATH$MDMTTY?$SHOWTTY?g' \ + -i etc/{faxaddmodem,probemodem}.sh.in + # It is not necessary to add faster baud rates to the 2 modem scripts. # 38400 is only the speed at which the script will test the modem. # The modem config will set the proper speed during use. # quick grammar error fix - sed -i -e 's:^a \(modem device \):\1:g' 'man/ondelay.1m' - - #exit 1 - unset LN # On my system this has something in it. The script should - # probably be fixed to prefix _var_ on all variables. Like TTY in Linux, - # given enough systems and enough time eventually a variable conflict will - # occur. Prefixing should prevent this. The idea is to pick a prefix so obtuse - # that no sane person would ever pick it. What does that make us? - if [ ! -s 'Makefile' ]; then - ./configure --nointeractive --with-OPTIMIZER="${CFLAGS}" \ - --target="${CARCH}-arch-linux" \ - --nointeractive \ - --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' - fi - -# --with-PATH_AFM='/usr/share/fonts/Type1' gs ignores this + sed -e 's:^a \(modem device \):\1:g' -i 'man/ondelay.1m' # unknown isn't good enough for me. Let's brand! # We don't brand any of the build files which just get deleted anyways. - #sed -s -i -e 's:-unknown-linux-:-arch-linux-:g' \ - # etc/{faxaddmodem,probemodem,faxsetup}.sh + # sed -e 's:-unknown-linux-:-arch-linux-:g' -s -i etc/{faxaddmodem,probemodem,faxsetup}.sh.in # This crude branding was eliminated by the configure option above. # A patch from the Gentoo hylafaxplus ebuild. hostname -f produces a useless result on my system - # sed -i -e "s:hostname:hostname -f:g" util/{faxrcvd,pollrcvd}.sh.in + # sed -e 's:hostname:hostname -f:g' -i util/{faxrcvd,pollrcvd}.sh.in # More patches from the Gentoo hylafaxplus ebuild # Respect LDFLAGS(at least partially) - # sed -i -e "/^LDFLAGS/s/LDOPTS}/LDOPTS} ${LDFLAGS}/" defs.in - # sed -i -e "s|-fpic|-fPIC|g" configure + # sed -e "/^LDFLAGS/s/LDOPTS}/LDOPTS} ${LDFLAGS}/" -i 'defs.in' + # sed -e 's|-fpic|-fPIC|g' -i 'configure' + + # A serious error that needs a bit more explanation before somebody gets fired for crashing the fax server. + sed -e 's|\(emsg = fxStr::format("Unable to open scheduler FIFO: %s\)\(",\)$|\1 (try running faxsetup)\2|g' \ + -i 'hfaxd/FIFO.c++' + + # Provide clear instructions to remove and replace the SGI logo + # diff -pNau5 cover.templ{.default,} > '0003-graphic.logo.instructions.patch' + patch -d 'util' -Nup0 < "${srcdir}/0003-graphic.logo.instructions.patch" - # A serious error that needs a bit more explanation before somebody gets fired. - sed -s -i -e 's|\(emsg = fxStr::format("Unable to open scheduler FIFO: %s\)\(",\)$|\1 (try running faxsetup)\2|g' \ - 'hfaxd/FIFO.c++' - #exit 1 set +u + + echo 'Checking for fonts missing from fmfix.pl' + ! grep -o $'\t/[A-Z].*;$' <(gs -q -sDEVICE='tiffg3' -sFONTPATH='/usr/share/fonts/Type1' 'util/genfontmap.ps' | perl '../fmfix.pl') } build() { set -u - cd "${srcdir}/${_pkgnick}-${pkgver}" - make -s # -j $(nproc) # hylafax is not multi threaded make compatible - cd "${srcdir}/sendfaxvsi-1.0" - sh -u 'make.sh' + cd "${_pkgnick}-${pkgver}" + if [ ! -s 'Makefile' ]; then + # On my system LN has something in it. Short variable names should be avoided in scripts. + LN= \ + ./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 + fi + + make -s -j1 # hylafax is not multi threaded make compatible + make -C "${srcdir}/sendfaxvsi-${_sendfaxvsicommit}" -j1 set +u } package() { set -u - cd "${srcdir}/${_pkgnick}-${pkgver}" - make INSTALLROOT="${pkgdir}" install + cd "${_pkgnick}-${pkgver}" + make -j1 INSTALLROOT="${pkgdir}" install # My crude VSI-FAX tag support - install -Dpm755 "${srcdir}/sendfaxvsi-1.0/sendfaxvsi" "${pkgdir}/usr/bin/sendfaxvsi" + make -C "${srcdir}/sendfaxvsi-${_sendfaxvsicommit}" -j1 install DESTDIR="${pkgdir}" BINDIR='/usr/bin' - # Thanks to mc I can see that these files have the wrong permissions. + # Thanks to looking at everything in mc I can see that these files have the wrong permissions. chmod 644 "${pkgdir}/var/spool/hylafax/bin/"*.ps # Remove files that are not needed on Linux (from RPM .spec) - rm -f "${pkgdir}/usr/bin/"{faxsetup.irix,faxsetup.bsdi} + rm "${pkgdir}/usr/bin/"{faxsetup.irix,faxsetup.bsdi} rm -f "${pkgdir}/usr/bin/"{ps2fax.imp,ps2fax.dps} - rm -f "${pkgdir}/usr/share/man/man1/sgi2fax.1" + rm "${pkgdir}/usr/share/man/man1/sgi2fax.1" # Huge screwup! We don't want to lose this log file on every upgrade. - rm -f "${pkgdir}/var/spool/hylafax/etc/xferfaxlog" + rm "${pkgdir}/var/spool/hylafax/etc/xferfaxlog" + + # apply PKGBUILD defaults to default etc/skel for hands free multi modem setup + sed -e 's/^\(AreaCode:\s\+\)[^#\t]\+\(.*\)$'"/\1${_opt_AreaCode}\2/g" \ + -e 's/^\(FAXNumber:\s\+\)[^#\t]\+\(.*\)$'"/\1${_opt_FAXNumber}\2/g" \ + -e 's/^\(LocalIdentifier:\s\+\)[^#\t]\+\(.*\)$'"/\1\"${_opt_LocalIdentifier}\"\2/g" \ + -e 's/^\(RingsBeforeAnswer:\s\+\)[^#\t]\+\(.*\)$'"/\1${_opt_RingsBeforeAnswer}\2/g" \ + -i "${pkgdir}/var/spool/hylafax/config/skel" + sed -e '# Apply default area code for easier setup' \ + -e 's|^\(AREACODE\)=.\+$'"|\1=${_opt_AreaCode}|g" \ + -i "${pkgdir}/usr/bin/faxsetup" # Leaving this FIFO in the package makes it so that an accidental upgrade to # a live production system immediately shuts down all fax traffic - # therby forcing the admin to quickly run faxsetup to restore operation, + # thereby forcing the admin to quickly run faxsetup to restore operation, # and that's only if the admin knows what to do because the errors on # sendfax don't reveal much about the problem. # 460 Failed to submit job 6: Unable to open scheduler FIFO: No such file or directory. - # See above for where we amend this error. - # Removing the FIFO ensures that the system will continue to run + # See above for where we amend this error to give the poor admin a chance. + # Removing the FIFO here ensures that the system will continue to run # after an upgrade until it is convenient to run faxsetup to restart the - # daemons. Besides, the package doesn't create the FIFO correctly anyways. - rm -f "${pkgdir}/var/spool/hylafax/FIFO" || : + # daemons. Besides, the FIFO from the package is not made correctly. + rm -f "${pkgdir}/var/spool/hylafax/FIFO" # My fixer tool to get rid of the glyph metrics warning. Look above for where sed hacks this in. # Alternate solution: ftp://ftp.hylafax.org/contrib/fontmap/fontmap.pl @@ -497,48 +480,180 @@ package() { cat >> "${_outfile}" << EOF # The .default of this file will always be overwritten by upgrades. Modify the non .default copies! # The following hosts were added by an install option in the ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR -# http://aur.archlinux.org/ +# https://aur.archlinux.org/ EOF fi echo "${_host}" >> "${_outfile}" done + # Add dial rules for USA 7 and 10 digit numbers. The posted examples have them in the wrong order. + # diff -pNau5 dialrules{.default,} > '0001-dialrules.7-10.digits.USA.patch' + patch -d "${pkgdir}/var/spool/hylafax/etc" -Nup0 < "${srcdir}/0001-dialrules.7-10.digits.USA.patch" + install -Dpm755 "${srcdir}/localnxxtoregex.sh" -t "${pkgdir}/usr/bin" + + # top and bottom margin patch because fax doesn't do page layout like a regular printer + # http://aplawrence.com/Linux/hylafax-scripts.html + # diff -pNau5 typerules{.orig,} > '0002-typerules.vertical.margins.patch' + patch -d "${pkgdir}/usr/lib/fax" -Nup0 < "${srcdir}/0002-typerules.vertical.margins.patch" + # More user customizable files from the Slackbuild - cd "${pkgdir}/var/spool/hylafax/etc" + pushd "${pkgdir}/var/spool/hylafax/etc" > /dev/null for _outfile in dialrules* 'cover.templ' 'dpsprinter.ps'; do mv "${_outfile}" "${_outfile}.default" done + popd > /dev/null - cd "${srcdir}/${_pkgnick}-${pkgver}" - # Extended name .default for these files allowing AvantFAX and others + # Extended name .default for these files allowing AvantFAX and others # to Install their own versions. for _outfile in 'archive' 'faxrcvd' 'notify' 'pollrcvd'; do mv "${pkgdir}/var/spool/hylafax/bin/${_outfile}" "${pkgdir}/var/spool/hylafax/bin/${_outfile}.hylafaxplus.default" done + # Don't want a fax cover at two different places. Modified versions are preserved in install. + ln -sf '/var/spool/hylafax/etc/cover.templ' "${pkgdir}/usr/lib/fax/faxcover.ps" + # add systemd files - install -D -m644 "${srcdir}/hfaxd.service" "${pkgdir}/usr/lib/systemd/system/hfaxd.service" - install -D -m644 "${srcdir}/faxq.service" "${pkgdir}/usr/lib/systemd/system/faxq.service" - install -D -m644 "${srcdir}/faxgetty@.service" "${pkgdir}/usr/lib/systemd/system/faxgetty@.service" - install -D -m644 'COPYRIGHT' "${pkgdir}/usr/share/licenses/${_pkgnick}/COPYRIGHT" + install -Dm644 <(cat << EOF +# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR +# https://aur.archlinux.org/ + +[Unit] +Description=HylaFAX+ client-server protocol server +Documentation=man:hfaxd(8) + +[Service] +Type=forking +ExecStart=/usr/bin/hfaxd -i hylafax +ExecReload=/bin/kill -HUP \$MAINPID + +[Install] +WantedBy=multi-user.target +EOF + ) "${pkgdir}/usr/lib/systemd/system/hfaxd.service" + install -Dm644 <(cat << EOF +# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR +# https://aur.archlinux.org/ + +[Unit] +Description=HylaFAX+ queue manager +Documentation=man:faxq(8) + +[Service] +Type=forking +ExecStart=/usr/bin/faxq +ExecReload=/bin/kill -HUP \$MAINPID + +[Install] +WantedBy=multi-user.target +EOF + ) "${pkgdir}/usr/lib/systemd/system/faxq.service" + install -Dm644 <(cat << EOF +# This file is part of systemd. +# +# systemd is free software; you can redistribute it and/or modify it +# under the terms of the GNU Lesser General Public License as published by +# the Free Software Foundation; either version 2.1 of the License, or +# (at your option) any later version. + +# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR +# https://aur.archlinux.org/ + +[Unit] +Description=HylaFAX+ faxgetty on %i +Documentation=man:faxgetty(8) +After=faxq.service hfaxd.service + +[Service] +ExecStart=/usr/bin/faxgetty %i +Type=simple +Restart=always +RestartSec=0 +KillMode=process + +KillSignal=SIGTERM + +[Install] +WantedBy=multi-user.target +EOF + ) "${pkgdir}/usr/lib/systemd/system/faxgetty@.service" # systemd timer (from the HylaFAX PKGBUILD). No need to install cron. This should be split into two timers. - install -D -m644 "${srcdir}/hylafax.timer" "${pkgdir}/usr/lib/systemd/system/hylafax.timer" + install -Dm644 <(cat << EOF +# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR +# https://aur.archlinux.org/ + +[Unit] +Description=HylaFAX+ daily fax queue cleanup and deletion of 30 days old faxes +Documentation=man:faxqclean(8) man:faxcron(8) + +[Timer] +OnCalendar=*-*-* ${_opt_MaintenanceTime} +AccuracySec=3h +Persistent=true + +[Install] +WantedBy=multi-user.target +EOF + ) "${pkgdir}/usr/lib/systemd/system/hylafax.timer" # insert the selected maintenance time - sed -i -e 's/^\(OnCalendar\)=.\+$'"/\1=*-*-* ${_opt_MaintenanceTime}/g" "${pkgdir}/usr/lib/systemd/system/hylafax.timer" - install -D -m644 "${srcdir}/hylafax.service" "${pkgdir}/usr/lib/systemd/system/hylafax.service" - install -d -m755 "${pkgdir}/usr/lib/systemd/system/multi-user.target.wants" - # ln -s '../hylafax.timer' "${pkgdir}/usr/lib/systemd/system/multi-user.target.wants/hylafax.timer" # better done in install with systemctl enable + install -Dm644 <(cat << EOF +# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR +# https://aur.archlinux.org/ + +[Unit] +Description=HylaFAX+ daily fax queue cleanup and deletion of 30 days old faxes +Documentation=man:faxqclean(8) man:faxcron(8) + +[Service] +Type=oneshot +ExecStart=/usr/bin/faxqclean +ExecStart=/usr/bin/faxcron -rcv 30 +Nice=19 +IOSchedulingClass=best-effort +IOSchedulingPriority=7 +#User=uucp +#Group=uucp +EOF + ) "${pkgdir}/usr/lib/systemd/system/hylafax.service" + + # pacman hook for automatic folder change on ghostscript upgrade + install -Dm644 <(cat << EOF +# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR +# https://aur.archlinux.org/ + +[Trigger] +Operation = Upgrade +Type = Package +Target = ghostscript + +[Action] +Description = HylaFax+: Check for changed ghostscript font folder +When = PostTransaction +Exec = /usr/bin/bash /var/spool/hylafax/bin/ghostscript-upgrade.sh +EOF + ) "${pkgdir}/usr/share/libalpm/hooks/hylafax-ghostscript.hook" + install -Dm744 <(cat << EOF +#!/usr/bin/bash + +# Automatically generated by ${pkgname}-${pkgver} PKGBUILD from Arch Linux AUR +# https://aur.archlinux.org/ + +set -e +set -u + +newfolder=(/usr/share/ghostscript/*/Resource/) +if [ "\${EUID}" -eq 0 ]; then + if [ "\${#newfolder[@]}" -ne 1 ]; then + echo "\$0: unable to upgrade ghostscript folder" + else + newfolder="\${newfolder%/}" + newfolder="\${newfolder%/*}/" + sed -e "s:/usr/share/ghostscript/[^/]\+/:\${newfolder}:g" -i '/usr/lib/fax/hyla.conf' '/var/spool/hylafax/etc/setup.cache' + fi +fi +EOF + ) "${pkgdir}/var/spool/hylafax/bin/ghostscript-upgrade.sh" + + install -Dpm644 'COPYRIGHT' "${pkgdir}/usr/share/licenses/${_pkgnick}/COPYRIGHT" set +u - # Ensure there are no forbidden paths. Place at the end of package() and comment out as you find or need exceptions. (git-aurcheck) - ! test -d "${pkgdir}/bin" || { echo "Line ${LINENO} Forbidden: /bin"; false; } - ! test -d "${pkgdir}/sbin" || { echo "Line ${LINENO} Forbidden: /sbin"; false; } - ! test -d "${pkgdir}/lib" || { echo "Line ${LINENO} Forbidden: /lib"; false; } - ! test -d "${pkgdir}/share" || { echo "Line ${LINENO} Forbidden: /share"; false; } - ! test -d "${pkgdir}/usr/sbin" || { echo "Line ${LINENO} Forbidden: /usr/sbin"; false; } - ! test -d "${pkgdir}/usr/local" || { echo "Line ${LINENO} Forbidden: /usr/local"; false; } - #! grep -lr "/sbin" "${pkgdir}" || { echo "Line ${LINENO} Forbidden: /sbin"; false; } - ! grep -lr "/usr/tmp" "${pkgdir}" || { echo "Line ${LINENO} Forbidden: /usr/tmp"; false; } - #! grep -lr "/usr/local" "${pkgdir}" || { echo "Line ${LINENO} Forbidden: /usr/local"; false; } - #! pcre2grep -Ilr "(?<!/usr)/bin" "${pkgdir}" || { echo "Line ${LINENO} Forbidden: /bin"; false; } } set +u diff --git a/faxgetty@.service b/faxgetty@.service deleted file mode 100644 index e025eb6f655b..000000000000 --- a/faxgetty@.service +++ /dev/null @@ -1,23 +0,0 @@ -# This file is part of systemd. -# -# systemd is free software; you can redistribute it and/or modify it -# under the terms of the GNU Lesser General Public License as published by -# the Free Software Foundation; either version 2.1 of the License, or -# (at your option) any later version. - -[Unit] -Description=HylaFAX+ faxgetty on %i -Documentation=man:faxgetty(8) -After=faxq.service hfaxd.service - -[Service] -ExecStart=/usr/bin/faxgetty %i -Type=simple -Restart=always -RestartSec=0 -KillMode=process - -KillSignal=SIGTERM - -[Install] -WantedBy=multi-user.target diff --git a/faxq.service b/faxq.service deleted file mode 100644 index 378aa25f8120..000000000000 --- a/faxq.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=HylaFAX+ queue manager -Documentation=man:faxq(8) - -[Service] -Type=forking -ExecStart=/usr/bin/faxq -ExecReload=/bin/kill -HUP $MAINPID - -[Install] -WantedBy=multi-user.target @@ -14,6 +14,10 @@ require 5.008; # which could have been obtained much less obtusely with the likes of sed, awk, cut, expr, # or a crufty perl script similar to this one. +# Testing: +# gs -q -sDEVICE=tiffg3 -sFONTPATH=/usr/share/fonts/Type1 /var/spool/hylafax/bin/genfontmap.ps > fmtest.txt +# fmfix.pl < fmtest.txt > Fontmap.HylaFAX + # gsfontmap.ps used to produce all lines with filenames: # (Hershey-Script-Simplex-Bold) (hrscsb.gsf) ; # but now for some fonts it just puts the name: @@ -32,29 +36,95 @@ require 5.008; # 6 hex codes, mostly consistent but might contain a \n # %!PS-AdobeFont-...: MyFontName ...\n +# Quit changing names! +# This translates from the first line of *.pfb to the second column in the .gs listing +my %brokenxlat=( + 'BookmanURW-DemBol' => 'URWBookman-Demi', + 'BookmanURW-DemBolIta' => 'URWBookman-DemiItalic', + 'BookmanURW-Lig' => 'URWBookman-Light', + 'BookmanURW-LigIta' => 'URWBookman-LightItalic', + 'CenturySchURW-Bol' => 'C059-Bold', + 'CenturySchURW-BolIta' => 'C059-BdIta', + 'CenturySchURW-Ita' => 'C059-Italic', + 'CenturySchURW-Rom' => 'C059-Roman', + 'ChanceryURW-MedIta' => 'Z003-MediumItalic', + 'Dingbats' => 'D050000L', + 'NimbusMono-Bold' => 'NimbusMonoPS-Bold', + 'NimbusMono-BoldOblique' => 'NimbusMonoPS-BoldItalic', + 'NimbusMono-Oblique' => 'NimbusMonoPS-Italic', + 'NimbusMono-Regular' => 'NimbusMonoPS-Regular', + 'NimbusRomNo9L-Med' => 'NimbusRoman-Bold', + 'NimbusRomNo9L-MedIta' => 'NimbusRoman-BoldItalic', + 'NimbusRomNo9L-Reg' => 'NimbusRoman-Italic', + 'NimbusRomNo9L-RegIta' => 'NimbusRoman-Regular', + 'NimbusSanL-Bol' => 'NimbusSans-Bold', + 'NimbusSanL-BolIta' => 'NimbusSans-BoldOblique', + 'NimbusSanL-Reg' => 'NimbusSans-Regular', + 'NimbusSanL-RegIta' => 'NimbusSans-Oblique', + 'NimbusSanNar-Bol' => 'NimbusSansNarrow-Bold', + 'NimbusSanNar-BolIta' => 'NimbusSansNarrow-BdOblique', + 'NimbusSanNar-Ita' => 'NimbusSansNarrow-Oblique', + 'NimbusSanNar-Reg' => 'NimbusSansNarrow-Regular', +# A bad match to Palatino. At least the names have some of the same letters. + 'PalladioURW-Bol' => 'P052-Bold', + 'PalladioURW-BolIta' => 'P052-BoldItalic', + 'PalladioURW-Ita' => 'P052-Italic', + 'PalladioURW-Rom' => 'P052-Roman', + 'StandardSymL' => 'StandardSymbolsPS', + 'URWGothic-Boo' => 'URWGothic-Book', + 'URWGothic-BooObl' => 'URWGothic-BookOblique', + 'URWGothic-Dem' => 'URWGothic-Demi', + 'URWGothic-DemObl' => 'URWGothic-DemiOblique', +); + use strict; use warnings; -my $gsfolder="/usr/share/fonts/Type1"; # Arch Linux package 'gsfonts' +my $gsfolder="/usr/share/fonts/Type1"; # Arch Linux package 'gsfonts-type1' opendir(GSFONTS, $gsfolder) or die "Can't open directory: $!\n"; my $liner; my $file; my %fontxlat; while ($file = readdir(GSFONTS)) { - if ($file =~ m/[^.]+\.pfb/ ) { + if ($file =~ m/\.pfb$/ ) { open(FONT,"<",$gsfolder."/".$file) or die; - read (FONT, $liner,6, 0); + read (FONT, $liner,6, 0); # discard first 6 characters $liner = <FONT>; + close(FONT); if ( $liner =~ m/%!PS-AdobeFont[^:]+: ([^ ]+) /) { - #print "$file = $1\n" - $fontxlat{$1}=$file; + if ($brokenxlat{$1}) { + $fontxlat{$brokenxlat{$1}}=$file; + } else { + #print STDERR " '$1' => '',\n"; + $fontxlat{$1}=$file; + } + } else { + print STDERR "Not found $file\n"; } - close(FONT); } } closedir(GSFONTS); - +#exit 1; #open(FONTMAP,"<","Fontmap.HylaFAX") or die; +# Manually translate from the second column to a best match font name +$fontxlat{'ArialMT'}="n019003l.pfb"; +$fontxlat{'Arial-BoldMT'}="n019004l.pfb"; +$fontxlat{'Arial-BoldItalicMT'}="n019024l.pfb"; +$fontxlat{'Arial-ItalicMT'}="n019023l.pfb"; +$fontxlat{'TimesNewRomanPSMT'}="n021023l.pfb"; +$fontxlat{'TimesNewRomanPS-BoldMT'}="n021004l.pfb"; +$fontxlat{'TimesNewRomanPS-BoldItalicMT'}="n021024l.pfb"; +$fontxlat{'TimesNewRomanPS-ItalicMT'}="n021003l.pfb"; +# Arial looks good to me! +$fontxlat{'Cyrillic-Regular'}="n019003l.pfb"; +$fontxlat{'Shareware-Cyrillic-Italic'}="n019023l.pfb"; +$fontxlat{'Shareware-Cyrillic-Regular'}="n019003l.pfb"; +# Times looks good to me +$fontxlat{'CharterBT-Bold'}="n021004l.pfb"; +$fontxlat{'CharterBT-BoldItalic'}="n021024l.pfb"; +$fontxlat{'CharterBT-Italic'}="n021003l.pfb"; +$fontxlat{'CharterBT-Roman'}="n021023l.pfb"; + # Convert all lines of the form # (BoringFontName)\t/AnotherBoringFontName ; # to diff --git a/hfaxd.service b/hfaxd.service deleted file mode 100644 index 31bd999b5152..000000000000 --- a/hfaxd.service +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=HylaFAX+ client-server protocol server -Documentation=man:hfaxd(8) - -[Service] -Type=forking -ExecStart=/usr/bin/hfaxd -i hylafax -ExecReload=/bin/kill -HUP $MAINPID - -[Install] -WantedBy=multi-user.target diff --git a/hylafax.install b/hylafax.install index 695c97bb1604..d37b448035a8 100644 --- a/hylafax.install +++ b/hylafax.install @@ -1,87 +1,124 @@ +_hyhome='/var/spool/hylafax' +_hyfax='/usr/lib/fax' +#_hyuser='fax' +_hyuser='uucp' +_hygroup='uucp' + _print_install() { - printf "\n" - echo "Run faxsetup to configure and be sure to set..." - echo " The device to configure is usually ttyS0, ttyUSB0, or ttyACM0" - echo " The number of pages to accept to more than 25" - echo " The country code and area code" - echo " The faxclass to 2.0" - echo " Most other defaults are OK" - printf "\n" + echo -e '\n' + echo 'Run faxsetup to configure and be sure to set...' + echo ' The device to configure is usually ttyS0, ttyUSB0, or ttyACM0' + echo ' The number of pages to accept to more than 25' + echo ' The country code and area code' + echo ' The Fax Class to 2.0' + echo ' Most other defaults are OK' + echo -e '\n' } _print_remove() { - printf "\n\n" - echo "You may manually remove /var/spool/hylafax and /usr/lib/fax if you do not need anything." - echo "You may also remove any aliases added to /etc/mail/aliases." - printf "\n" + echo -e '\n\n' + echo "You may manually remove ${_hyhome} and ${_hyfax} if you do not need anything." + echo 'You may also remove any aliases added to /etc/mail/aliases.' + echo -e '\n' } post_install() { - groupadd -g 14 'uucp' &>/dev/null - useradd -u 10 -g 'uucp' -d '/' -s '/bin/false' 'uucp' &>/dev/null + set -u + #groupadd -g 14 "${_hygroup}" &>/dev/null + useradd -u 10 -g "${_hygroup}" -d "${_hyhome}" -s '/bin/false' "${_hyuser}" &>/dev/null #useradd -u 69 -g 'daemon' -d '/' -s '/bin/false' 'fax' &>/dev/null post_upgrade - usermod -d '/' 'uucp' &>/dev/null - #usermod -d '/' 'fax' &>/dev/null + #usermod -d '/' "${_hyuser}" &>/dev/null _print_install mandb -q + set +u } # define _clean_or_copy_doit() to tell this what to do _clean_or_copy() { for _outfile in 'archive' 'faxrcvd' 'notify' 'pollrcvd'; do - _clean_or_copy_doit "/var/spool/hylafax/bin/${_outfile}.hylafaxplus.default" "/var/spool/hylafax/bin/${_outfile}" + _clean_or_copy_doit "${_hyhome}/bin/${_outfile}.hylafaxplus.default" "${_hyhome}/bin/${_outfile}" done - for _outfile in /var/spool/hylafax/etc/*.default; do - _clean_or_copy_doit "${_outfile}" "`expr "${_outfile}" : '^\(.\+\).default$'`" + for _outfile in ${_hyhome}/etc/*.default; do + _clean_or_copy_doit "${_outfile}" "$(expr "${_outfile}" : '^\(.\+\).default$')" done } post_upgrade() { - # Only some of the files and folders are chown uucp - chown 'uucp' '/var/spool/hylafax'/{,archive,bin,client,config,dev,docq,doneq,etc} - chown 'uucp' '/var/spool/hylafax'/{FIFO,info,log,pollq,recvq,sendq,status,tmp} + set -u + # Only some of the files and folders are chown + chown "${_hyuser}:${_hygroup}" "${_hyhome}"/{,archive,bin,client,config,dev,docq,doneq,etc} + chown "${_hyuser}:${_hygroup}" "${_hyhome}"/{info,log,pollq,recvq,sendq,status,tmp} + chown "${_hyuser}:${_hygroup}" "${_hyhome}/FIFO" "${_hyhome}"/FIFO.* 2> /dev/null + # Don't overwrite existing configuration files. _clean_or_copy_doit() { cp -np "$1" "$2" chmod 'u+w' "$2" } _clean_or_copy - cp -n /dev/null "/var/spool/hylafax/etc/xferfaxlog" # This doesn't modify the timestamp of an existing file - chown 'uucp:uucp' '/var/spool/hylafax/etc/'{hosts.hfaxd,lutRS18.pcf,xferfaxlog} - #chown -R uucp /var/spool/hylafax/etc/templates + cp -n /dev/null "${_hyhome}/etc/xferfaxlog" # This doesn't modify the timestamp of an existing file + chown "${_hyuser}:${_hygroup}" "${_hyhome}/etc"/{hosts.hfaxd,lutRS18.pcf,xferfaxlog} + # chown -R "${_hyuser}:${_hygroup}"\ "${_hyhome}/etc/templates" systemctl daemon-reload systemctl enable 'hylafax.timer' systemctl start 'hylafax.timer' - if [ ! -z "`command -v 'avantfaxsetup.sh'`" ]; then - avantfaxsetup.sh 2 'install' + # Now done by pacman hook + #if [ ! -z "$(command -v 'avantfaxsetup.sh')" ]; then + # avantfaxsetup.sh 2 'install' + #fi + set +u +} + +_pre_upgrade_fix_faxcover() { + # Two fax covers in different places causes problems. Since I didn't notice this before I can't trash the covers + if [ ! -L "${_hyfax}/faxcover.ps" ]; then + if [ "$(md5sum < "${_hyfax}/faxcover.ps" | cut -d' ' -f1)" != '756ff1ce327f89d5651cdb99f02efc25' ]; then + if [ "$(md5sum < "${_hyhome}/etc/cover.templ")" = "$(md5sum < "${_hyhome}/etc/cover.templ.default")" ]; then + mv "${_hyfax}/faxcover.ps" "${_hyhome}/etc/cover.templ" + else + mv "${_hyfax}/faxcover.ps"{,.pacsave} + echo "Modified faxcover.ps has been saved as ${_hyfax}/faxcover.ps.pacsave" + fi + fi fi } pre_upgrade() { + set -u + _pre_upgrade_fix_faxcover _clean_or_copy_doit() { - if [ "`md5sum < "$1"`" = "`md5sum < "$2"`" ]; then + # Delete unmodified files + if [ "$(md5sum < "$1")" = "$(md5sum < "$2")" ]; then rm -f "$2" fi } _clean_or_copy + set +u } pre_remove() { + set -u pre_upgrade - userdel 'uucp' &>/dev/null - ##groupdel 'uucp' &>/dev/null - #userdel 'fax' &>/dev/null + userdel "${_hyuser}" &>/dev/null + ##groupdel "${_hygroup}" &>/dev/null # we could put this into pre_upgrade() but I'd rather let the admin restart when convenient. systemctl stop 'hfaxd.service' + systemctl disable 'hfaxd.service' systemctl stop 'faxq.service' + systemctl disable 'faxq.service' systemctl stop 'faxgetty@*.service' + rm -f '/etc/systemd/system/multi-user.target.wants'/faxgetty@*.service # systemctl disable doesn't accept wildcards/PATTERN systemctl stop 'hylafax.timer' - #rm -f '/var/spool/hylafax/bin/'{pdf2fax,ps2fax} '/var/spool/hylafax/dev/null' + systemctl disable 'hylafax.timer' + #rm -f "${_hyhome}/bin"/{pdf2fax,ps2fax} "${_hyhome}/dev/null" _print_remove + set +u } post_remove() { + set -u systemctl daemon-reload mandb -q + set +u } diff --git a/hylafax.service b/hylafax.service deleted file mode 100644 index 97f58aa90381..000000000000 --- a/hylafax.service +++ /dev/null @@ -1,13 +0,0 @@ -[Unit] -Description=HylaFAX+ daily fax queue cleanup and deletion of 30 days old faxes -Documentation=man:faxqclean(8) man:faxcron(8) - -[Service] -Type=oneshot -ExecStart=/usr/bin/faxqclean -ExecStart=/usr/bin/faxcron -rcv 30 -Nice=19 -IOSchedulingClass=best-effort -IOSchedulingPriority=7 -#User= -#Group= diff --git a/hylafax.timer b/hylafax.timer deleted file mode 100644 index 796463acb2ce..000000000000 --- a/hylafax.timer +++ /dev/null @@ -1,11 +0,0 @@ -[Unit] -Description=HylaFAX+ daily fax queue cleanup and deletion of 30 days old faxes -Documentation=man:faxqclean(8) man:faxcron(8) - -[Timer] -OnCalendar=daily -AccuracySec=3h -Persistent=true - -[Install] -WantedBy=multi-user.target diff --git a/localnxxtoregex.sh b/localnxxtoregex.sh new file mode 100755 index 000000000000..8c9a85babd6c --- /dev/null +++ b/localnxxtoregex.sh @@ -0,0 +1,61 @@ +#!/usr/bin/bash + +# convert USA local call NXX list from http://localcallingguide.com/ +# to HylaFax+ dialrules + +set -u +set -e + +if [ -z "${1:-}" ]; then + echo "Usage: $(basename "$0") nnx.txt > nnxmytown.txt" + echo "Create nnx.txt from local nnx listing at" + echo "http://localcallingguide.com/" + echo "Search, Area Code/Prefix, ..., ..., Local prefixes" + exit 1 +fi + +message='! local NNX list generated by localnxxtoregex.sh from Arch Linux HylaFax+ package' + +_fn_display() { + if [ ! -z "${nx}" ]; then + if [ ! -z "${message}" ]; then + echo "${message}" + message='' + fi + local tx + if [ "${#x}" -gt 1 ]; then + x="[${x}]" + tx="(${nx}${x})" + else + tx="(${nx}${x})\t" # keep tabs lined up + fi + local _tx="(${nx}${x})" + echo -e '^${Country}${Area}'"${tx}\t= \1\t\t! USA NNX/NXX local ${npas[2]} calls" + nx='' + x='' + fi +} + +readarray -t npalist < <(grep '^[0-9]' "$1" | LC_ALL=C sort) +#declare -p npalist + +nx='' +x='' +# 555 & 556 will be coalesced into 55[56] +#NPA;NXX;Rate Centre;Region;Plan Type;Call Type;Monthly Limit;Note;Effective +#517;555;Operator;MI;;;;; +#517;556;Operator;MI;;;;; +#517;560;Operator;MI;;;;; +#517;570;Operator;MI;;;;; +for npaline in "${npalist[@]}"; do + IFS=';' read -r -a npas <<<"${npaline}" + nnx="${npas[1]}" + if [ "${nnx#${nx}}" = "${nnx}" ]; then + _fn_display + nx="${nnx: 0:2}" + x="${nnx: 2:1}" + else + x+="${nnx: 2:1}" + fi +done +_fn_display diff --git a/sendfaxvsi-1.0.tgz b/sendfaxvsi-1.0.tgz Binary files differdeleted file mode 100644 index 38214bef11ae..000000000000 --- a/sendfaxvsi-1.0.tgz +++ /dev/null |