pkgsrc/comms/hylafax/patches/patch-ai
adam 65dc98044e Changes 6.0.6:
These releases are maintenance releases, and do not contain any new
features or functionality, but only contain bugfixes:
 * Re-order library files in fchmod() configure check
 * faxalter: Wire up the nissing page range -Z options
 * man: JobReqError/JobRetryError were missing in hylafax-config.4
 * typerules: adding missing comma to typeNames array
 * Do not warn about one of the Fontpath directories not existing
 * Reworked how faxsetup looks for Fontmap
 * Use a private Fontmap.HylaFAX file of .pfb files
 * Combine all Fontmap files in memory, including new Fontmap.HylaFAX
 * Bug 934: We need to avoid a 0-index in playList
 * hfaxd: Eliminte extraneous debug logging
 * hfaxd: Make source port for active connections be ctrl port - 1
 * hfaxd: Release old accept fd
 * Support libtiff 4.0
 * faxsend: JobRetryOther/JobRequeueOther weren't actually being used
 * Make sure not to cut faxq FIFO messages in two when reaching end of buffer
 * hfaxd: Port is network byte order, correct logging of it
2014-03-14 15:59:29 +00:00

107 lines
3.3 KiB
Text

$NetBSD: patch-ai,v 1.10 2014/03/14 15:59:29 adam Exp $
--- etc/faxsetup.sh.in.orig 2012-06-06 00:58:38.000000000 +0000
+++ etc/faxsetup.sh.in
@@ -41,7 +41,9 @@
# This script interactively prepares and verifies
# a HylaFAX client and/or server machine for use.
#
-PATH=/bin:/usr/bin:/etc
+PREFIX=@PREFIX@
+#
+PATH=/bin:/usr/bin:${PREFIX}/bin:${PREFIX}/sbin
test -d /usr/ucb && PATH=$PATH:/usr/ucb # Sun and others
test -d /usr/bsd && PATH=$PATH:/usr/bsd # Silicon Graphics
test -d /usr/5bin && PATH=/usr/5bin:$PATH:/usr/etc # Sun and others
@@ -60,6 +62,7 @@ FUSER=@FUSER@ # fuser command to dump
GREP=@GREP@ # grep command for use below
LN=@LN@ # ln command for use below
LN_S=@LN_S@ # ln option for creating a symbolic link
+MKDIR=@MKDIR@ # directory creation program for use below
MKFIFO=@MKFIFO@ # FIFO creation program for use below
MV=@MV@ # move file for use below
PCL6CMD=@PCL6CMD@ # pcl6 (GhostPCL) program
@@ -154,6 +157,7 @@ LIBEXEC DIR_LIBEXEC
LN
MANDIR DIR_MAN
MIMENCODE
+MKDIR
MKFIFO
MV
PATH
@@ -870,6 +874,61 @@ if [ "$euid" != "root" ]; then
boom
fi
+createspool()
+{
+ old_spool="`dirname ${DIR_SPOOL}`/fax"
+ if [ -d "${old_spool}" ]; then
+ cat <<EOF
+=================================================================
+
+ Found an existing ${old_spool}, probably from an older version
+ of the HylaFax package.
+ You might want to copy you customizations to @SPOOL@ after
+ faxsetup is done.
+
+=================================================================
+EOF
+ fi
+ if [ -d "${DIR_SPOOL}" ]; then
+ cat <<EOF
+=================================================================
+
+ @SPOOL@ already exists, probably from a previous run of
+ faxsetup -- I'm not touching it!
+
+ If you encounter problems, deinstall the HylaFax package,
+ remove @SPOOL@ and reinstall the package.
+
+=================================================================
+EOF
+ else
+ ${MKDIR} -p -m 0755 ${DIR_SPOOL}
+ ${MKFIFO} -m 0600 ${DIR_SPOOL}/FIFO
+ for i in archive docq doneq pollq sendq tmp ; do
+ ${MKDIR} -m 0700 ${DIR_SPOOL}/$i
+ done
+ for i in bin client config cover dev etc info log recvq status ; do
+ ${MKDIR} -m 0755 ${DIR_SPOOL}/$i
+ done
+ for i in `ls ${PREFIX}/share/hylafax/etc_template` ; do
+ ${CP} -p ${PREFIX}/share/hylafax/etc_template/$i \
+ ${DIR_SPOOL}/etc/$i
+ done
+ for i in `ls ${PREFIX}/share/hylafax/config_template` ; do
+ ${CP} -p ${PREFIX}/share/hylafax/config_template/$i \
+ ${DIR_SPOOL}/config/$i
+ done
+ for i in `ls ${PREFIX}/libexec/hylafax` ; do
+ ${CP} -p ${PREFIX}/libexec/hylafax/$i ${DIR_SPOOL}/bin/$i
+ done
+ ${CHOWN} -R ${PROTOUID}:${PROTOGID} ${DIR_SPOOL}
+ fi
+}
+
+Note "Creating spool directory structure"
+
+createspool
+
onClient && Note "Checking system for proper client configuration."
onServer && Note "Checking system for proper server configuration."
@@ -2426,12 +2485,7 @@ if onServer; then
findproc()
{
- # NB: ps ax should give an error on System V, so we try it first!
- pid="`ps ax 2>/dev/null | $AWK \"\
- /[\/ (]$1[ )]/ {print \\$1;}
- /[\/ ]$1\$/ {print \\$1;}\"`"
- test "$pid" ||
- pid="`ps -e 2>/dev/null | $AWK \"/ $1[ ]*\$/ {print \\$1;}\"`"
+ pid="`ps -ax | grep -e "[/ (]$1[ )]" -e "[/ ]$1\$" | grep -v grep | head -1 | cut -c1-5`"
echo "$pid"
}