aboutsummaryrefslogtreecommitdiffstats
path: root/testing/miniupnpd/APKBUILD
blob: 2b3a908728a065d35c291dd91065d16b064afb49 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=miniupnpd
pkgver=1.8.20140523
pkgrel=0
pkgdesc="Lightweight UPnP IGD daemon"
url="http://miniupnp.free.fr"
arch="all"
license="BSD"
depends=""
depends_dev="libnfnetlink-dev iptables-dev"
makedepends="$depends_dev"
install=""
subpackages="$pkgname-doc"
source="http://miniupnp.free.fr/files/miniupnpd-$pkgver.tar.gz
	$pkgname.initd
	$pkgname.confd
	musl.patch
	"

_builddir="$srcdir"/miniupnpd-$pkgver
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
	mv Makefile.linux Makefile
	sed -i \
		-e "s#^CFLAGS = .*-D#CPPFLAGS += -I/usr/include -D#" \
		-e '/^CFLAGS :=/s/CFLAGS/CPPFLAGS/g' \
		-e "s/CFLAGS += -ansi/#CFLAGS += -ansi/g" \
		-e "s/LIBS = -liptc/LIBS = -lip4tc/g" \
		-e 's/genuuid||//' \
		-e "s/--mode=/-m /g" \
		Makefile || die
	sed -i \
		-e 's/\(strncpy(\([->a-z.]\+\), "[a-zA-Z]\+", \)IPT_FUNCTION_MAXNAMELEN);/\1sizeof(\2));/' \
		netfilter/iptcrdr.c || die

	make config.h

	sed -i \
		-e 's/\/\*#define ENABLE_LEASEFILE\*\//#define ENABLE_LEASEFILE/g' \
		config.h || die
}

build() {
	cd "$_builddir"
	make || return 1
}

package() {
	cd "$_builddir"
	make PREFIX="$pkgdir/" install || return 1
	rm -f "$pkgdir"/usr/lib/*.la
	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname || return 1
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/ocnf.d/$pkgname || return 1

}

md5sums="fcac89e11da091b1cc61f43d83c9e4f5  miniupnpd-1.8.20140523.tar.gz
df8b62fd39a040d0bc10d9d4f8492578  miniupnpd.initd
5f461c988dc4b11b036771d56864087c  miniupnpd.confd
4d158e2c261855b5a1874b3c519c4cc1  musl.patch"
sha256sums="e72cd1e515aa9e6281e519e1814fe74e7689f5da71ce463a996a17e787ffe490  miniupnpd-1.8.20140523.tar.gz
2a11cab5615550c1263448f943a62ed3fe4dd647888675588e59146a691f3643  miniupnpd.initd
8c6dae8588e21208a2f0a17965548e0b0708ceeea1157e2506f745e28913f9b3  miniupnpd.confd
d2d6787587bbb79610f65f8bdb47e369714882a31027be5190cb1ee6840999f7  musl.patch"
sha512sums="4045dc1fb80143cda6914d837aabcd19aa35fc8c63fe5190f3a161efd29a652320c79a898230e26b8429760ea5b383a96b91d18853e7dcb2ddc2ebcf242f7feb  miniupnpd-1.8.20140523.tar.gz
a25b2a444cde623fbdbe6fb26c544614cceb2cc1262a0409f40286f4c69b70ba1c05e55815552a12b0624b16ddd48d3e424dad18b278ff9da04bac335feb1d45  miniupnpd.initd
81aa2dac0643bbd1331549427c438900319adce91928b6bad6f7d470492f6f48e04e4d1af89f961db53fc132a7ff89ea52625441f051afd5a1b48680917f4ff7  miniupnpd.confd
84f1e8bbae16b531cb0d2bd4216e0bdd2708b2b48d3baa69e06aec7fa006b947fbe37dc8b8e640c8307815cec63f067f2107b91e1bfb5c3f0985d185de100073  musl.patch"