1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-02-05 11:35:01 +00:00

- Added rc.subr integration and removed references to etc/rc.d/qpage.sh

- Added OPTIONS knob for enabling srvrsnpp.c patch from ports/123437 (felt it
  was better to make the patch optional)
- Added more knobs for compile-time options: daemon user, syslog facility
- Changed ${INSTALL_SCRIPT} to ${INSTALL_DATA} in post-install target
- Removed old maintainer e-mail address from pkg-descr

PR:		128318
Submitted by:	maintainer
This commit is contained in:
Stefan Walter 2008-10-24 10:14:05 +00:00
parent 21bceaaa75
commit d96072f0de
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=221975
8 changed files with 144 additions and 36 deletions

View File

@ -7,7 +7,7 @@
PORTNAME= qpage
PORTVERSION= 3.3
PORTREVISION= 5
PORTREVISION= 6
CATEGORIES= comms
MASTER_SITES= http://www.qpage.org/download/
EXTRACT_SUFX= .tar.Z
@ -15,29 +15,70 @@ EXTRACT_SUFX= .tar.Z
MAINTAINER= jfb@mr-happy.com
COMMENT= SNPP client/server for sending messages to an alphanumeric pager
USE_RC_SUBR= qpage
GNU_CONFIGURE= yes
MAN1= qpage.1
OPTIONS= IDENT_PATCH "Patch to disable libwrap ident lookups" off
.include <bsd.port.pre.mk>
.if defined(WITH_IDENT_PATCH)
EXTRA_PATCHES=${FILESDIR}/libwrap_ident_patch-srvrsnpp.c
.endif
.if !defined(WITH_QPAGE_SYSLOG_FACILITY) || !defined(WITH_QPAGE_USER)
.if !defined(WITH_QPAGE_SYSLOG_FACILITY) && !defined(WITH_QPAGE_USER)
_QPAGE_MSG= You may set the following configuration options:
.else
_QPAGE_MSG= The following additional configuration options are available:
.endif
.if !defined(WITH_QPAGE_SYSLOG_FACILITY)
WITH_QPAGE_SYSLOG_FACILITY= LOG_DAEMON
_QPAGE_SYSLOG_MSG=1
.endif
.if !defined(WITH_QPAGE_USER)
WITH_QPAGE_USER= uucp
_QPAGE_USER_MSG=1
.endif
pre-patch:
@${ECHO_MSG} ""
@${ECHO_MSG} ${_QPAGE_MSG}
@if [ -n "${_QPAGE_SYSLOG_MSG}" ]; then \
${ECHO_MSG} ""; \
${ECHO_MSG} " WITH_QPAGE_SYSLOG_FACILITY=syslog_facility"; \
${ECHO_MSG} " Default is LOG_DAEMON"; \
fi
@if [ -n "${_QPAGE_USER_MSG}" ]; then \
${ECHO_MSG} ""; \
${ECHO_MSG} " WITH_QPAGE_USER=userid"; \
${ECHO_MSG} " Default is \"uucp\"; recommended that user be in group \"dialer\""; \
fi
@${ECHO_MSG} ""
@${ECHO_MSG} "Press ^C now to stop the build and set make options."
@${ECHO_MSG} "You may find it necessary to 'make clean' before restarting the build."
@sleep 2
.endif
post-patch:
${REINPLACE_CMD} -e 's,%%PREFIX%%,${PREFIX},g' \
${WRKSRC}/qpage.man \
${WRKSRC}/config.input \
${WRKSRC}/config.h.in
${REINPLACE_CMD} \
-e 's,%%WITH_QPAGE_SYSLOG_FACILITY%%,${WITH_QPAGE_SYSLOG_FACILITY},' \
-e 's,%%WITH_QPAGE_USER%%,${WITH_QPAGE_USER},' \
${WRKSRC}/config.input
post-install:
@if [ ! -f ${PREFIX}/etc/rc.d/qpage.sh ]; then \
${ECHO_MSG} "Install ${PREFIX}/etc/rc.d/qpage.sh startup file."; \
${INSTALL_SCRIPT} -m 751 ${FILESDIR}/qpage.sh \
${PREFIX}/etc/rc.d/qpage.sh; \
fi
@if [ ! -f ${PREFIX}/etc/qpage-example.cf ]; then \
${ECHO_MSG} "Install ${PREFIX}/etc/qpage-example.cf file."; \
${INSTALL_SCRIPT} -m 640 ${WRKDIR}/${PORTNAME}-${PORTVERSION}/example.cf \
${INSTALL_DATA} -m 640 ${WRKDIR}/${PORTNAME}-${PORTVERSION}/example.cf \
${PREFIX}/etc/qpage-example.cf; \
fi
${MKDIR} /var/spool/${PORTNAME}
${CHOWN} uucp:dialer /var/spool/${PORTNAME}
${CHOWN} ${WITH_QPAGE_USER}:dialer /var/spool/${PORTNAME}
${CHMOD} 0775 /var/spool/${PORTNAME}
.include <bsd.port.mk>
.include <bsd.port.post.mk>

View File

@ -0,0 +1,16 @@
--- srvrsnpp.c.orig 2008-10-20 10:30:57.539127452 -0400
+++ srvrsnpp.c 2008-10-20 10:35:43.096529509 -0400
@@ -1066,7 +1066,12 @@
fromhost(&request);
- ptr = eval_user(&request);
+ /*
+ ** If we aren't doing an ident request, don't ask
+ ** TCP Wrappers to do it either
+ */
+ if (IdentTimeout) ptr = eval_user(&request);
+ else ptr = NULL;
if (ptr && strcmp(ptr, STRING_UNKNOWN) != 0)
p->ident = strdup(ptr);

View File

@ -1,5 +1,5 @@
--- config.input.orig Thu Nov 5 07:05:36 1998
+++ config.input Mon May 17 23:14:53 2004
--- config.input.orig 1998-11-05 01:05:36.000000000 -0500
+++ config.input 2008-10-19 14:08:35.109933521 -0400
@@ -20,7 +20,7 @@
# See the QuickPage documentation for complete details about
# the syntax of the configuration file.
@ -23,7 +23,16 @@
# assigned to that user.
#
-DAEMON_USER="daemon"
+DAEMON_USER="uucp"
+DAEMON_USER="%%WITH_QPAGE_USER%%"
#
@@ -59,7 +59,7 @@
# used by QuickPage to log messages. See the syslog
# documentation (i.e. "man syslog") for more information.
#
-SYSLOG_FACILITY=LOG_DAEMON
+SYSLOG_FACILITY=%%WITH_QPAGE_SYSLOG_FACILITY%%
#

View File

@ -0,0 +1,10 @@
--- ixo.c.orig 1999-01-01 20:59:33.000000000 -0500
+++ ixo.c 2008-10-20 00:10:55.367858145 -0400
@@ -368,7 +368,6 @@
if (tcsetattr(fd, TCSANOW, &ti) < 0) {
qpage_log(LOG_DEBUG, "tcsetattr(): %s", strerror(errno));
closemodem(fd);
- return;
}
/*

View File

@ -0,0 +1,56 @@
#!/bin/sh
# PROVIDE: qpage
# REQUIRE: NETWORKING
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable/configure this service:
#
# qpage_enable (bool): Set to NO by default.
# Set it to YES to enable qpage.
# qpage_queue_interval (int): Set to 10 (seconds) by default.
# qpage_cfg_file (path): Set it to an alternate configuration file path
# if desired.
# qpage_flags (str): Set it to a list of additional command-line
# parameters if desired.
#
. %%RC_SUBR%%
name="qpage"
rcvar=${name}_enable
command=%%PREFIX%%/bin/${name}
load_rc_config $name
: ${qpage_enable="NO"}
: ${qpage_queue_interval="10"}
: ${qpage_cfg_file=""}
: ${qpage_flags=""}
stop_cmd=${name}_stop
extra_commands="reload"
reload_cmd=${name}_reload
command_args="-q ${qpage_queue_interval} ${qpage_flags}"
if [ -n "${qpage_cfg_file}" ]; then
command_args="${command_args} -C ${qpage_cfg_file}"
fi
qpage_stop() {
/usr/bin/killall qpage
}
qpage_reload() {
# awk pattern matches master daemon process only (PPID 1 in 3rd column)
pid=`/bin/ps alcxww | /usr/bin/awk "/^ *[0-9]+ +[0-9]+ +1 .* ${name}\$/{print \\\$2}"`
if [ -n "$pid" ]; then
kill -HUP $pid
else
echo "$0: no qpage daemon found" >& 2
fi
}
run_rc_command "$1"

View File

@ -1,20 +0,0 @@
#!/bin/sh
if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
echo "$0: Cannot determine the PREFIX" >&2
exit 1
fi
case "$1" in
start)
[ -x ${PREFIX}/bin/qpage ] && ${PREFIX}/bin/qpage -q10 && echo -n ' qpage'
;;
stop)
killall qpage && echo -n ' qpage'
;;
*)
echo "Usage: `basename $0` {start|stop}" >&2
;;
esac
exit 0

View File

@ -9,6 +9,3 @@ messages indicating the success or failure of a page are sent via
e-mail to submitters of high-priority (level 0) pages.
WWW: http://www.qpage.org/
Joe Stein
joes@seaport.net

View File

@ -1,5 +1,4 @@
bin/qpage
etc/qpage-example.cf
etc/rc.d/qpage.sh
@exec if [ ! -d /var/spool/qpage ]; then mkdir /var/spool/qpage; chown uucp:dialer /var/spool/qpage; chmod 0775 /var/spool/qpage; fi
@unexec if [ -d /var/spool/qpage ]; then rm -rf /var/spool/qpage; fi