aboutsummaryrefslogtreecommitdiffstats
path: root/community/miniupnpd/APKBUILD
blob: 4953a42db3c65ae4d3312a3295da043161c244a9 (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
# Contributor: Carlo Landmeter <clandmeter@gmail.com>
# Maintainer: Natanael Copa <ncopa@alpinelinux.org>
pkgname=miniupnpd
pkgver=2.1
pkgrel=0
pkgdesc="Lightweight UPnP IGD daemon"
url="http://miniupnp.free.fr"
arch="all"
license="BSD-3-Clause"
depends=""
depends_dev=""
makedepends="$depends_dev bsd-compat-headers iptables-dev libnfnetlink-dev"
install=""
subpackages="$pkgname-doc"
source="http://miniupnp.free.fr/files/miniupnpd-$pkgver.tar.gz
	$pkgname.initd
	$pkgname.confd"

builddir="$srcdir"/miniupnpd-$pkgver
prepare() {
	default_prepare
	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
	sed -i \
		-e 's/\(strncpy(\([->a-z.]\+\), "[a-zA-Z]\+", \)IPT_FUNCTION_MAXNAMELEN);/\1sizeof(\2));/' \
		netfilter/iptcrdr.c

	make config.h

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

build() {
	cd "$builddir"
	make
}

package() {
	cd "$builddir"
	make PREFIX="$pkgdir/" install
	install -m755 -D "$srcdir"/$pkgname.initd \
		"$pkgdir"/etc/init.d/$pkgname
	install -m644 -D "$srcdir"/$pkgname.confd \
		"$pkgdir"/etc/conf.d/$pkgname

}

sha512sums="c737faad21bfba1f59346cbe0082d24827f36c0422cfaa5e71180aa9f61e784eb19ea9d6abf2d005f92d4cde106eac8c66ecc88b30421de710f3c129ac15f4ae  miniupnpd-2.1.tar.gz
a25b2a444cde623fbdbe6fb26c544614cceb2cc1262a0409f40286f4c69b70ba1c05e55815552a12b0624b16ddd48d3e424dad18b278ff9da04bac335feb1d45  miniupnpd.initd
81aa2dac0643bbd1331549427c438900319adce91928b6bad6f7d470492f6f48e04e4d1af89f961db53fc132a7ff89ea52625441f051afd5a1b48680917f4ff7  miniupnpd.confd"