diff options
author | Francesco Colista <fcolista@alpinelinux.org> | 2019-03-19 15:50:27 +0000 |
---|---|---|
committer | Francesco Colista <fcolista@alpinelinux.org> | 2019-03-19 15:50:32 +0000 |
commit | 39047b22a36ede8e7785960bef21d289949ef66a (patch) | |
tree | 73e17dc5fbcac51ecb4e6dd9b740f9a0db1d3c07 /testing/p910nd | |
parent | ef205f803e6fc4748d70bbe2265195c463e2c0b9 (diff) | |
download | aports-39047b22a36ede8e7785960bef21d289949ef66a.tar.bz2 aports-39047b22a36ede8e7785960bef21d289949ef66a.tar.xz |
testing/p910nd: new aport. Fixes 10090
Diffstat (limited to 'testing/p910nd')
-rw-r--r-- | testing/p910nd/APKBUILD | 35 | ||||
-rw-r--r-- | testing/p910nd/fix-paths.patch | 71 | ||||
-rw-r--r-- | testing/p910nd/p910nd.confd | 6 | ||||
-rw-r--r-- | testing/p910nd/p910nd.initd | 35 |
4 files changed, 147 insertions, 0 deletions
diff --git a/testing/p910nd/APKBUILD b/testing/p910nd/APKBUILD new file mode 100644 index 0000000000..f5208b343e --- /dev/null +++ b/testing/p910nd/APKBUILD @@ -0,0 +1,35 @@ +# Contributor: Francesco Colista <fcolista@alpinelinux.org> +# Maintainer: Francesco Colista <fcolista@alpinelinux.org> +pkgname=p910nd +pkgver=0.97 +pkgrel=0 +pkgdesc="Non-spooling printer daemon" +url="http://p910nd.sourceforge.net/" +arch="all" +license="GPL" +options="!check" +subpackages="$pkgname-doc $pkgname-openrc" +source="http://downloads.sf.net/$pkgname/$pkgname-$pkgver.tar.bz2 +$pkgname.initd +$pkgname.confd +fix-paths.patch" +builddir="$srcdir/$pkgname-$pkgver" + +build() { + cd "$builddir" + make +} + +package() { + cd "$builddir" + make DESTDIR="$pkgdir" install + install -D -m755 "$srcdir"/$pkgname.initd \ + "$pkgdir"/etc/init.d/$pkgname + install -D -m644 "$srcdir"/$pkgname.confd \ + "$pkgdir"/etc/conf.d/$pkgname +} + +sha512sums="077078f5e5bc26c8fb9a4b5b02c7551db71d807b15417b79771ea876472f9af7129d68f8011b243279ec0967ff2e8a6838f5caff68502a1d2a8f7bffe6da84a5 p910nd-0.97.tar.bz2 +6c8f0208b4589dec1945fcbc4c649c46936e54abc50e35ad5916de934ead0f34b020ef2f48ca2ca6051ca4a9c09e1ac4ff563fc134d11e39f82115f8661c588f p910nd.initd +78a2593982ea9cd8df4dc9d6e6a9a37ace3a2eea0919b74448722a5fe877b9834eb5c725e5194081f8c75ab4a032690691bfa76883a73e276aa8fa4681a793bc p910nd.confd +c6ec4fce1c8973ad27bc8e52e4440ab0aaa2bc527323484293eb1e3d163a29909c41ac4d18ed89818fc3d8f6b0bb65a289721ee10b431f4a86977cf96fbc4d53 fix-paths.patch" diff --git a/testing/p910nd/fix-paths.patch b/testing/p910nd/fix-paths.patch new file mode 100644 index 0000000000..d0d10960c1 --- /dev/null +++ b/testing/p910nd/fix-paths.patch @@ -0,0 +1,71 @@ +diff -u a/Makefile b/Makefile +--- a/Makefile 2014-06-01 13:58:41.867584813 +0400 ++++ b/Makefile 2014-06-01 14:20:47.460700951 +0400 +@@ -5,14 +5,11 @@ + DEFINES += -DUSE_LIBWRAP + endif + +-# If you don't have it in /var/log/subsys, uncomment and define +-#CFLAGS += -DLOCKFILE_DIR=\"/var/log\" ++# If you don't have it in /var/lock/subsys, uncomment and define ++CFLAGS += -DLOCKFILE_DIR=\"/var/lock\" + +-# GNU target string +-CROSS = +- +-CC = $(CROSS)gcc +-STRIP = $(CROSS)strip ++CC := gcc ++STRIP := strip + + CFLAGS += -O2 -Wall + +diff --git a/p910nd.c b/p910nd.c +index 2fa4454..a58c1f0 100644 +--- a/p910nd.c ++++ b/p910nd.c +@@ -133,11 +133,11 @@ extern int hosts_ctl(char *daemon, char *client_name, char *client_addr, char *c + #endif + + #define BASEPORT 9100 +-#define PIDFILE "/var/run/p910%cd.pid" ++#define PIDFILE "/run/p910nd/p910nd.%c.pid" + #ifdef LOCKFILE_DIR + #define LOCKFILE LOCKFILE_DIR "/p910%cd" + #else +-#define LOCKFILE "/var/lock/subsys/p910%cd" ++#define LOCKFILE "/run/lock/p910nd" + #endif + #ifndef PRINTERFILE + #define PRINTERFILE "/dev/lp%c" +diff --git a/Makefile b/Makefile +index 53db51f..6012199 100644 +--- a/Makefile ++++ b/Makefile +@@ -14,12 +14,10 @@ STRIP := strip + CFLAGS += -O2 -Wall + + PROG = p910nd +-CONFIG = p910nd.conf + INITSCRIPT = p910nd.init + MANPAGE = p910nd.8 + INSTALL = install + BINDIR = /usr/sbin +-CONFIGDIR = /etc/sysconfig + SCRIPTDIR = /etc/init.d + MANDIR = /usr/share/man/man8 + +@@ -29,11 +27,10 @@ $(PROG): p910nd.c + strip: $(PROG) + $(STRIP) -s $(PROG) + +-install: $(PROG) $(CONFIG) $(INITSCRIPT) $(MANPAGE) +- mkdir -p $(DESTDIR)$(BINDIR) $(DESTDIR)$(CONFIGDIR) \ ++install: $(PROG) $(INITSCRIPT) $(MANPAGE) ++ mkdir -p $(DESTDIR)$(BINDIR) \ + $(DESTDIR)$(SCRIPTDIR) $(DESTDIR)$(MANDIR) + $(INSTALL) $(PROG) $(DESTDIR)$(BINDIR) +- $(INSTALL) -m 644 $(CONFIG) $(DESTDIR)$(CONFIGDIR)/$(PROG) + $(INSTALL) $(INITSCRIPT) $(DESTDIR)$(SCRIPTDIR)/$(PROG) + $(INSTALL) -m 644 $(MANPAGE) $(DESTDIR)$(MANDIR) + diff --git a/testing/p910nd/p910nd.confd b/testing/p910nd/p910nd.confd new file mode 100644 index 0000000000..2bdf4d9eb3 --- /dev/null +++ b/testing/p910nd/p910nd.confd @@ -0,0 +1,6 @@ +# Printer number, default 0 equals to 9100, 1 to 9101, 2 to 9102 +P910ND_NUM="0" +# Device +P910ND_DEV="/dev/lp${P910ND_NUM}" +# Additional daemon arguments, see man 8 p910nd +P910ND_OPTS="-b -f ${P910ND_DEV}" diff --git a/testing/p910nd/p910nd.initd b/testing/p910nd/p910nd.initd new file mode 100644 index 0000000000..6378a75f9e --- /dev/null +++ b/testing/p910nd/p910nd.initd @@ -0,0 +1,35 @@ +#!/sbin/openrc-run +# +# Init script for Alpine Linux +# (c) 2019 Francesco Colista <fcolista@alpinelinux.org> +# + +command="/usr/sbin/p910nd" +pidfile="/run/p910nd/p910nd.${P910ND_NUM}.pid" +command_args="${P910ND_OPTS} ${P910ND_NUM}" + +depend() { + need localmount net + after bootmisc +} + +start_pre() { + checkpath -d -m755 /run/p910nd +} + +start() { + ebegin "Starting ${SVCNAME}" + start-stop-daemon \ + --start \ + --pidfile ${pidfile} \ + --exec ${command} \ + -- ${command_args} +} + +stop() { + ebegin "Stopping ${SVCNAME}" + start-stop-daemon \ + --stop \ + --pidfile ${pidfile} \ + --exec ${command} +} |