From 29bbcacc31cc32c6b450e540c93f5db5544905fc Mon Sep 17 00:00:00 2001 From: Mike Brown Date: Fri, 14 Dec 2012 03:48:57 -0500 Subject: [PATCH] Adding aur/knockd as a user requested the package --- aur/knockd/PKGBUILD | 39 +++++++++++++++++++++++++++++++++++++ aur/knockd/knockd | 37 +++++++++++++++++++++++++++++++++++ aur/knockd/knockd.logrotate | 5 +++++ aur/knockd/knockd.service | 10 ++++++++++ aur/knockd/limits.h.patch | 10 ++++++++++ 5 files changed, 101 insertions(+) create mode 100644 aur/knockd/PKGBUILD create mode 100644 aur/knockd/knockd create mode 100644 aur/knockd/knockd.logrotate create mode 100644 aur/knockd/knockd.service create mode 100644 aur/knockd/limits.h.patch diff --git a/aur/knockd/PKGBUILD b/aur/knockd/PKGBUILD new file mode 100644 index 000000000..45d1dce11 --- /dev/null +++ b/aur/knockd/PKGBUILD @@ -0,0 +1,39 @@ +# $Id: PKGBUILD 20410 2008-12-03 09:44:51Z tom $ +# Maintainer: Mike Sampson +# Contriburor: Steven +# Contributor: Aaron Griffin +# Contributor: judd + +pkgname=knockd +pkgver=0.5 +pkgrel=10 +pkgdesc="A simple port-knocking daemon" +arch=('i686' 'x86_64') +url="http://www.zeroflux.org/projects/knock" +license=(GPL) +depends=('libpcap>=1.0.0') +backup=('etc/knockd.conf') +source=(http://www.zeroflux.org/proj/knock/files/knock-$pkgver.tar.gz + knockd knockd.logrotate knockd.service limits.h.patch) + +md5sums=('ca09d61458974cff90a700aba6120891' + '72302d899887996694586c3d479de245' + '56a4113ec89ba2e96f79ab23c914d52a' + '0329ca17267d03f06216d1fe00bd16a9' + 'e56dc7359f36c3b07da6710c404d671e') + +build() { + cd "$srcdir/knock-$pkgver" + patch -Np0 -i "$srcdir/limits.h.patch" + ./configure --prefix=/usr + make +} + +package() { + cd "$srcdir/knock-$pkgver" + make DESTDIR="$pkgdir" MANDIR=/usr/share/man install + #install -D -m755 "$srcdir/knockd" "$pkgdir/etc/rc.d/knockd" + install -D -m755 "$srcdir/knockd.service" "$pkgdir/usr/lib/systemd/system/knockd.service" + install -D -m644 "$srcdir/knockd.logrotate" "$pkgdir/etc/logrotate.d/knockd" +} + diff --git a/aur/knockd/knockd b/aur/knockd/knockd new file mode 100644 index 000000000..eb653eeab --- /dev/null +++ b/aur/knockd/knockd @@ -0,0 +1,37 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +PID=`pidof -o %PPID /usr/sbin/knockd` +case "$1" in + start) + stat_busy "Starting Port-Knocking Daemon" + if [ -z "$PID" ]; then + /usr/sbin/knockd -d + fi + if [ ! -z "$PID" -o $? -gt 0 ]; then + stat_fail + else + add_daemon knockd + stat_done + fi + ;; + stop) + stat_busy "Stopping Port-Knocking Daemon" + [ ! -z "$PID" ] && kill $PID &> /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon knockd + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac diff --git a/aur/knockd/knockd.logrotate b/aur/knockd/knockd.logrotate new file mode 100644 index 000000000..11e7a4e38 --- /dev/null +++ b/aur/knockd/knockd.logrotate @@ -0,0 +1,5 @@ +/var/log/knockd.log { + missingok + notifempty + delaycompress +} diff --git a/aur/knockd/knockd.service b/aur/knockd/knockd.service new file mode 100644 index 000000000..35f8722e7 --- /dev/null +++ b/aur/knockd/knockd.service @@ -0,0 +1,10 @@ +[Unit] +Description=Port-Knocking Daemon +After=network.target + +[Service] +ExecStart=/usr/sbin/knockd -d +Type=forking + +[Install] +WantedBy=multi-user.target diff --git a/aur/knockd/limits.h.patch b/aur/knockd/limits.h.patch new file mode 100644 index 000000000..a22427bbb --- /dev/null +++ b/aur/knockd/limits.h.patch @@ -0,0 +1,10 @@ +--- src/knockd.c.orig 2008-12-03 07:21:14.643255773 +0000 ++++ src/knockd.c 2008-12-03 07:24:59.606701396 +0000 +@@ -46,6 +46,7 @@ + #include + #include + #include ++#include + #include "list.h" + + static char version[] = "0.5";