From 31ef6b48580f5f6d8025fff40f5e2160ba115489 Mon Sep 17 00:00:00 2001 From: Duncaen Date: Sun, 11 Oct 2015 00:12:29 +0200 Subject: [PATCH] New package: miniupnpd-1.9 --- srcpkgs/miniupnpd/INSTALL.msg | 3 ++ srcpkgs/miniupnpd/files/miniupnpd/run | 4 +++ srcpkgs/miniupnpd/patches/foreground.patch | 31 +++++++++++++++++ srcpkgs/miniupnpd/template | 39 ++++++++++++++++++++++ srcpkgs/miniupnpd/update | 1 + 5 files changed, 78 insertions(+) create mode 100644 srcpkgs/miniupnpd/INSTALL.msg create mode 100644 srcpkgs/miniupnpd/files/miniupnpd/run create mode 100644 srcpkgs/miniupnpd/patches/foreground.patch create mode 100644 srcpkgs/miniupnpd/template create mode 100644 srcpkgs/miniupnpd/update diff --git a/srcpkgs/miniupnpd/INSTALL.msg b/srcpkgs/miniupnpd/INSTALL.msg new file mode 100644 index 00000000000..33e436a87d7 --- /dev/null +++ b/srcpkgs/miniupnpd/INSTALL.msg @@ -0,0 +1,3 @@ +Before running miniupnpd edit the scripts and configuration files in /etc/miniupnpd/. +Load the iptables rules by executing /etc/miniupnpd/iptables_init.sh and/or +/etc/miniupnpd/ip6tables_init.sh manually or adding them to /etc/sv/minidlnad/run. diff --git a/srcpkgs/miniupnpd/files/miniupnpd/run b/srcpkgs/miniupnpd/files/miniupnpd/run new file mode 100644 index 00000000000..5d4ed1a3bd4 --- /dev/null +++ b/srcpkgs/miniupnpd/files/miniupnpd/run @@ -0,0 +1,4 @@ +#!/bin/sh +[ -r conf ] && . ./conf +exec 2>&1 +exec miniupnpd ${OPTS:=-f /etc/miniupnpd/miniupnpd.conf} -D diff --git a/srcpkgs/miniupnpd/patches/foreground.patch b/srcpkgs/miniupnpd/patches/foreground.patch new file mode 100644 index 00000000000..ee8cee6951f --- /dev/null +++ b/srcpkgs/miniupnpd/patches/foreground.patch @@ -0,0 +1,31 @@ +diff --git miniupnpd.c miniupnpd.c +index eb68365..62071f4 100644 +--- miniupnpd.c ++++ miniupnpd.c +@@ -839,6 +839,7 @@ init(int argc, char * * argv, struct runtime_vars * v) + int i; + int pid; + int debug_flag = 0; ++ int foreground_flag = 0; + int openlog_option; + struct sigaction sa; + /*const char * logfilename = 0;*/ +@@ -1235,6 +1236,9 @@ init(int argc, char * * argv, struct runtime_vars * v) + case 'd': + debug_flag = 1; + break; ++ case 'D': ++ foreground_flag = 1; ++ break; + case 'w': + if(i+1 < argc) + presurl = argv[++i]; +@@ -1353,7 +1357,7 @@ init(int argc, char * * argv, struct runtime_vars * v) + goto print_usage; + } + +- if(debug_flag) ++ if(debug_flag || foreground_flag) + { + pid = getpid(); + } diff --git a/srcpkgs/miniupnpd/template b/srcpkgs/miniupnpd/template new file mode 100644 index 00000000000..7282ebe6e31 --- /dev/null +++ b/srcpkgs/miniupnpd/template @@ -0,0 +1,39 @@ +# Template file for 'miniupnpd' +pkgname=miniupnpd +version=1.9 +revision=1 +build_style=gnu-makefile +make_build_args="-f Makefile.linux" +make_install_args="-f Makefile.linux PREFIX=" +conf_files=" + /etc/miniupnpd/miniupnpd.conf + /etc/miniupnpd/iptables_init.sh + /etc/miniupnpd/ip6tables_init.sh + /etc/miniupnpd/iptables_removeall.sh + /etc/miniupnpd/ip6tables_removeall.sh" +hostmakedepends="pkg-config" +makedepends="libnfnetlink-devel iptables-devel" +short_desc="Lightweight UPnP IGD daemon" +maintainer="Duncaen " +license="3-clause-BSD" +homepage="http://miniupnp.free.fr" +distfiles="http://miniupnp.free.fr/files/miniupnpd-${version}.tar.gz" +checksum=6176eb21a6422a7ee68ef1c62ccbbd5003335fa773d8c9013228c2a217bba2ac + +do_configure() { + sed -e 's|$(INSTALLPREFIX)/sbin|$(INSTALLPREFIX)/bin|g' -i ${wrksrc}/Makefile.linux + sed -e 's|LSB_RELEASE=.*|LSB_RELEASE=$(false)|g' -i ${wrksrc}/genconfig.sh + + CONFIG_OPTIONS="--ipv6 --igd2 --leasefile" make -f Makefile.linux config.h + + sed -i ${wrksrc}/config.h \ + -e 's|^#define OS_URL .*$|#define OS_URL "http://voidlinux.eu"|g' \ + -e 's|^#define OS_NAME .*$|#define OS_NAME "Void"|g' \ + -e 's|^#define OS_VERSION .*$|#define OS_VERSION "Void"|g' +} + +post_install() { + rm -rf ${DESTDIR}/etc/init.d + vsv miniupnpd + vlicense LICENSE +} diff --git a/srcpkgs/miniupnpd/update b/srcpkgs/miniupnpd/update new file mode 100644 index 00000000000..7096d869ff8 --- /dev/null +++ b/srcpkgs/miniupnpd/update @@ -0,0 +1 @@ +ignore="*.???????? 20[0123456789][0123456789]????"