diff options
author | Francesco Colista <fcolista@alpinelinux.org> | 2016-08-25 10:04:59 +0000 |
---|---|---|
committer | Francesco Colista <fcolista@alpinelinux.org> | 2016-08-25 10:04:59 +0000 |
commit | 76fbd8b147342cf691629a38a9321817115f93db (patch) | |
tree | f83af5e298df25bb558fad2064bff2964f2ea09f /community/qpage | |
parent | 7af3b9486386653cf9136d0757246095aef9366d (diff) | |
download | aports-76fbd8b147342cf691629a38a9321817115f93db.tar.bz2 aports-76fbd8b147342cf691629a38a9321817115f93db.tar.xz |
community/qpage: moved from testing
Diffstat (limited to 'community/qpage')
-rw-r--r-- | community/qpage/APKBUILD | 49 | ||||
-rw-r--r-- | community/qpage/config.input | 83 | ||||
-rw-r--r-- | community/qpage/qpage.initd | 25 | ||||
-rw-r--r-- | community/qpage/qpage.patch | 231 | ||||
-rw-r--r-- | community/qpage/qpage.post-install | 6 | ||||
-rw-r--r-- | community/qpage/qpage.pre-install | 6 |
6 files changed, 400 insertions, 0 deletions
diff --git a/community/qpage/APKBUILD b/community/qpage/APKBUILD new file mode 100644 index 0000000000..b54dadabc2 --- /dev/null +++ b/community/qpage/APKBUILD @@ -0,0 +1,49 @@ +# Contributor: Francesco Colista <francesco.colista@gmail.com> +# Maintainer: Francesco Colista <francesco.colista@gmail.com> +pkgname=qpage +pkgver=3.3 +pkgrel=2 +pkgdesc="Sends messages to an alphanumeric pager via TAP protocol." +url="http://www.qpage.org/" +arch="all" +license="Custom" +depends="" +makedepends="" +install="$pkgname.pre-install $pkgname.post-install" +source="$pkgname-$pkgver.tar.gz::http://archive.debian.org/debian/pool/non-free/q/$pkgname/${pkgname}_3.3final.orig.tar.gz + config.input + qpage.initd + qpage.patch" + +builddir="$srcdir"/$pkgname-$pkgver + +build() { + cd "$builddir" + cp -f "$srcdir"/config.input "$builddir" || return 1 + ./configure --prefix=/usr \ + --sysconfdir=/etc \ + --localstatedir=/var + make || return 1 +} + +package() { + mkdir -p "$pkgdir"/usr/bin + mkdir -p "$pkgdir"/etc/qpage + install -m755 "$builddir"/$pkgname "$pkgdir"/usr/bin/"$pkgname" + install -m644 -D "$builddir"/example.cf "$pkgdir"/etc/qpage/qpage.conf.example + install -m644 -D "$builddir"/LICENSE "$pkgdir"/usr/share/licenses/$pkgname/LICENSE + install -m755 -D "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname +} + +md5sums="eb98faaa51f89db68ecf7668f5294309 qpage-3.3.tar.gz +3ac8c6e2aede9e195eba2555eb3b4645 config.input +c5a72422e9e68febe8b22372616eeb2b qpage.initd +e8a4a6926973c940fe34dc6c4e892606 qpage.patch" +sha256sums="d9f5829f5e9ab815c93708c2c7e989ae9df8776b34a28050ee016f004f154ac6 qpage-3.3.tar.gz +57c604f2d6f0d4e41190f691a087876b7f35e40d849ad5d7ee913317ffbdcb9c config.input +6ba43dfef4f97a44e2ca372dad1ff6173dc5fd14714e68450b2036de3f0649dc qpage.initd +841bd3b9ea468ba8f678d45e26a6f1557d1d3e157f927c6584305fa3dab88dce qpage.patch" +sha512sums="a100e531aaf3a1c04af5f32d4df5a47b2fd454e5b4d46fcb6dc9730f43e731044f26c7cf0a72165d2c26033e385a2ed06c4c846f822982548e3fa83921c61fef qpage-3.3.tar.gz +82772a1dcac5617c7a9ffde4ffe174c4e2d078ff644c873ccc39ac09ced23519f70ef79bf0ad9c69e1ae6c70dee2f57cb0e322f3f102e9849fc501737273856d config.input +14c7af4b794b763e761b42eaa7447e00bf7a503cb640c07ffef41ff830c65c73ccee02f4c56405ce6a939b722ff83262ba34852695d785f085334385d6ad2819 qpage.initd +dbfbbdf7a1d9035a0906a2e2c70be3090ef60dd1a55622588d6a0cdd3b0bc565553857f3dbad6ec7774dc6240c5fdd061ed8269dd39e32df7758e21b8375963c qpage.patch" diff --git a/community/qpage/config.input b/community/qpage/config.input new file mode 100644 index 0000000000..e133cb36a7 --- /dev/null +++ b/community/qpage/config.input @@ -0,0 +1,83 @@ +######################################################### +# # +# Almost all of the QuickPage configuration options # +# can be controlled at run-time by keywords in the # +# configuration file. However, there is a small # +# set of options that must be defined at compile # +# time. # +# # +# Here are the compile-time configuration options. # +# Edit these as appropriate for your environment. # +# # +# Note: This file is sourced by the configure script. # +# Do not make any changes incompatible with /bin/sh. # +# # +######################################################### + + +# +# QPAGE_CONFIG defines the location of the configuration file. +# See the QuickPage documentation for complete details about +# the syntax of the configuration file. +# +QPAGE_CONFIG="/etc/qpage/qpage.cf" + + +# +# SNPP_SERVER defines the default name of the SNPP server. +# The default is localhost. This is probably not appropriate +# for most network configurations; change this to the machine +# where you intend to run the QuickPage daemon. Multiple +# hostnames can be specified by separating them with commas. +# +SNPP_SERVER="localhost" + + +# +# SNPP_SERVER_FILE defines a filename containing one or +# more hostnames of SNPP servers. QuickPage clients +# read this file (if it exists) to locate a server. All +# servers listed in this file are assumed to have identical +# copies of the configuration file. Only one filename +# may be specified. +# +SNPP_SERVER_FILE="/etc/qpage/qpage.servers" + + +# +# DAEMON_USER specifies which user the QuickPage daemon +# should run as after dropping root privileges. If a +# userid or UID is specified and a password entry exists +# for that user, QuickPage will assume all group privileges +# assigned to that user. +# +DAEMON_USER="qpage" + + +# +# SYSLOG_FACILITY defines which syslog facility should be +# used by QuickPage to log messages. See the syslog +# documentation (i.e. "man syslog") for more information. +# +SYSLOG_FACILITY=LOG_DAEMON + + +# +# SENDMAIL_PATH defines where sendmail (or equivalent) is +# located on your system. QuickPage uses sendmail to send +# status messages about failed and/or high-priority pages. +# Whatever you specify here will be invoked with exactly +# three arguments: +# +# arg1: "-f" +# arg2: "<>" +# arg3: user@host +# +# The first two arguments tell sendmail to use a null return +# path (see RFC1123 section 5.2.9) so that bogus e-mail +# addresses will not annoy the postmaster. +# +# If you leave this variable commented out, "configure" will +# attempt to locate the correct path for your system automatically. +# +#SENDMAIL_PATH=/usr/lib/sendmail diff --git a/community/qpage/qpage.initd b/community/qpage/qpage.initd new file mode 100644 index 0000000000..d2c228addc --- /dev/null +++ b/community/qpage/qpage.initd @@ -0,0 +1,25 @@ +#!/sbin/openrc-run +# +# Startup for QuickPage +# + +OPTS_ARGS="q10" + +PATH=/sbin:/usr/sbin:/bin:/usr/bin + +start() { + ebegin "Starting QuickPage daemon" + start-stop-daemon --start --quiet --pidfile $PIDFILE --exec qpage -- ${OPTS_ARGS} >/dev/null + eend $? +} + +stop() { + ebegin "Stopping QuickPage daemon" + + pid=`ps -e | grep qpage | awk '{print $1}'` + if [ ! -z "$pid" ]; then + kill $pid > /dev/null 2>&1 + fi + eend $? +} +exit 0 diff --git a/community/qpage/qpage.patch b/community/qpage/qpage.patch new file mode 100644 index 0000000000..d998942d50 --- /dev/null +++ b/community/qpage/qpage.patch @@ -0,0 +1,231 @@ +diff -crB a/CHANGES b/CHANGES +*** a/CHANGES 1999-01-02 16:15:03.000000000 +1300 +--- b/CHANGES 2011-01-27 09:56:40.202300708 +1300 +*************** +*** 1,4 **** +--- 1,15 ---- ++ Changes to QuickPage from v3.3 to v3.3.1-unleash ++ ------------------------------------------------ ++ Patch by Michael Fincham <michael@unleash.co.nz> + ++ - The new "-b" option has been added to specify a bind address ++ for the qpage daemon. ++ ++ - The default user the daemon runs as is now "qpage" instead ++ of "nobody". ++ ++ - To be honest, the "-b" option doesn't sanitise input very well ++ so don't setuid root the qpage binary or anything dumb like that. + + Changes to QuickPage from v3.2 to v3.3 + --------------------------------------- +diff -crB a/qpage.c b/qpage.c +*** a/qpage.c 1999-05-09 09:47:23.000000000 +1200 +--- b/qpage.c 2011-01-21 14:50:55.995162759 +1300 +*************** +*** 17,22 **** +--- 17,23 ---- + static char sccsid[] = "@(#)qpage.c 3.36 07/26/98 tomiii@qpage.org"; + #endif + char *ConfigFile = NULL; ++ char *BindAddress = NULL; + int Debug = 0; + int Interactive = FALSE; + int Silent = FALSE; +*************** +*** 29,35 **** + do_version(void) + { + printf("\n"); +! printf("QuickPage v%s, Copyright 1995-98 by Thomas Dwyer III\n", + VERSION); + printf("\n"); + } +--- 30,36 ---- + do_version(void) + { + printf("\n"); +! printf("QuickPage v%s, Copyright 1995-98 by Thomas Dwyer III. Modified for Unleash by Michael Fincham <michael@unleash.co.nz>.\n", + VERSION); + printf("\n"); + } +*************** +*** 46,51 **** +--- 47,55 ---- + printf("\n"); + printf("Options:\n"); + printf(" -a [+]hhmm send the page at the specified time\n"); ++ #ifndef CLIENT_ONLY ++ printf(" -b address bind only to this address (default: 0.0.0.0)\n"); ++ #endif + printf(" -c coverage coverage area (service name) for pager\n"); + printf(" -C config use an alternate configuration file\n"); + printf(" -d debug mode\n"); +*************** +*** 339,345 **** + + (void)memset((char *)&p, 0, sizeof(p)); + +! while ((c = getopt(argc, argv, "a:c:C:df:hil:mp:P:q:Qs:t:v")) != -1) { + switch (c) { + case 'a': + case 't': +--- 343,349 ---- + + (void)memset((char *)&p, 0, sizeof(p)); + +! while ((c = getopt(argc, argv, "a:b:c:C:df:hil:mp:P:q:Qs:t:v")) != -1) { + switch (c) { + case 'a': + case 't': +*************** +*** 353,358 **** +--- 357,367 ---- + needpager = TRUE; + break; + ++ #ifndef CLIENT_ONLY ++ case 'b': ++ BindAddress = strdup(optarg); ++ break; ++ #endif + case 'c': + my_free(coverage); + coverage = strdup(optarg); +*************** +*** 503,509 **** + if (optind < argc) + port = atoi(argv[optind]); + +! (void)become_daemon(sleeptime, port); + + /* NOT REACHED */ + return(-1); +--- 512,518 ---- + if (optind < argc) + port = atoi(argv[optind]); + +! (void)become_daemon(sleeptime, port, BindAddress); + + /* NOT REACHED */ + return(-1); +diff -crB a/qpage.h b/qpage.h +*** a/qpage.h 1998-10-26 08:55:02.000000000 +1300 +--- b/qpage.h 2011-01-21 14:51:22.682302352 +1300 +*************** +*** 26,32 **** + #define fprintf (void)fprintf + #endif + +! #define VERSION "3.3" + #define COMMENTS_ANYWHERE + + #ifndef QPAGE_CONFIG +--- 26,32 ---- + #define fprintf (void)fprintf + #endif + +! #define VERSION "3.3.1-unleash" + #define COMMENTS_ANYWHERE + + #ifndef QPAGE_CONFIG +*************** +*** 51,57 **** + #endif + + #ifndef DAEMON_USER +! #define DAEMON_USER "nobody" + #endif + + #define SNPP_SVC_NAME "snpp" +--- 51,57 ---- + #endif + + #ifndef DAEMON_USER +! #define DAEMON_USER "qpage" + #endif + + #define SNPP_SVC_NAME "snpp" +*************** +*** 278,284 **** + extern void qpage_log(int pri, char *fmt, ...); + extern time_t snpptime(char *arg); + extern time_t parse_time(char *str); +! extern int become_daemon(int sleeptime, short port); + extern int submit_page(PAGE *p, char *server); + extern int lock_file(int fd, int mode, int block); + extern int lock_queue(void); +--- 278,284 ---- + extern void qpage_log(int pri, char *fmt, ...); + extern time_t snpptime(char *arg); + extern time_t parse_time(char *str); +! extern int become_daemon(int sleeptime, short port, char *BindAddress); + extern int submit_page(PAGE *p, char *server); + extern int lock_file(int fd, int mode, int block); + extern int lock_queue(void); +diff -crB a/qpage.man b/qpage.man +*** a/qpage.man 1999-05-09 10:07:31.000000000 +1200 +--- b/qpage.man 2011-01-27 09:51:44.894302942 +1300 +*************** +*** 34,39 **** +--- 34,42 ---- + ] [ + .BI \-C " config + ] ++ ] [ ++ .BI \-b " address ++ ] + .BI \-q " interval + .SH DESCRIPTION + .B QuickPage +*************** +*** 91,96 **** +--- 94,104 ---- + century. Otherwise assume the specified time is in the current + century. + .TP ++ .BI \-b ++ Specify an address for the qpage daemon to bind to. The default is ++ to bind to INETADDR_ANY and listen on all interfaces (the old ++ behaviour) ++ .TP + .BI \-c + Use a different coverage area or paging service. This option is + only useful if the recipient has more than one pager and/or more +diff -crB a/srvrsnpp.c b/srvrsnpp.c +*** a/srvrsnpp.c 1998-10-26 08:55:05.000000000 +1300 +--- b/srvrsnpp.c 2011-01-21 14:49:17.647300794 +1300 +*************** +*** 1156,1162 **** + ** -1 on error, otherwise never + */ + int +! become_daemon(int sleeptime, short port) + { + struct sockaddr_in addr; + struct servent *svc; +--- 1156,1162 ---- + ** -1 on error, otherwise never + */ + int +! become_daemon(int sleeptime, short port, char *BindAddress) + { + struct sockaddr_in addr; + struct servent *svc; +*************** +*** 1221,1227 **** + len = sizeof(on); + (void)setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&on, len); + +! addr.sin_addr.s_addr = INADDR_ANY; + addr.sin_family = AF_INET; + addr.sin_port = port; + +--- 1221,1227 ---- + len = sizeof(on); + (void)setsockopt(sock, SOL_SOCKET, SO_REUSEADDR, (char *)&on, len); + +! addr.sin_addr.s_addr = BindAddress != NULL ? inet_addr(BindAddress) : INADDR_ANY; + addr.sin_family = AF_INET; + addr.sin_port = port; + diff --git a/community/qpage/qpage.post-install b/community/qpage/qpage.post-install new file mode 100644 index 0000000000..53de3edbf5 --- /dev/null +++ b/community/qpage/qpage.post-install @@ -0,0 +1,6 @@ +#!/bin/sh + +mkdir -p /var/spool/qpage 2>/dev/null +chown -R qpage:qpage /var/spool/qpage 2>/dev/null +exit 0 + diff --git a/community/qpage/qpage.pre-install b/community/qpage/qpage.pre-install new file mode 100644 index 0000000000..c73b800dbd --- /dev/null +++ b/community/qpage/qpage.pre-install @@ -0,0 +1,6 @@ +#!/bin/sh + +addgroup -S qpage 2>/dev/null +adduser -S -D -h /var/lib/qpage -s /bin/false -G qpage -G qpage -g qpage qpage 2>/dev/null + +exit 0 |