summaryrefslogtreecommitdiff
path: root/community/miniupnpd/PKGBUILD
blob: 559f9443f249f3c1fe8a4606960898e2a0a0059b (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
# $Id: PKGBUILD 110046 2014-04-23 15:59:45Z tredaelli $
# Maintainer: Timothy Redaelli <timothy.redaelli@gmail.com>
# Contributor: fauno <fauno@parabola.nu>
pkgname=miniupnpd
pkgver=1.8.20140401
pkgrel=2
pkgdesc="Lightweight UPnP IGD daemon"
arch=('i686' 'x86_64')
url="http://miniupnp.free.fr"
license=('BSD')
backup=(etc/miniupnpd/miniupnpd.conf)
depends=('libnfnetlink' 'iptables' 'net-tools' 'util-linux')
makedepends=('lsb-release')
source=("http://miniupnp.free.fr/files/$pkgname-$pkgver.tar.gz"
        miniupnpd-1.8.20140401-foreground.patch
        miniupnpd.systemd)
sha256sums=('086dfffa59e8e86e792b73a71d275fec55ef17fe3e94a8c140301aceb05bcdbd'
            '79350f2dbb695b58744aa9036d34a7dfdcfc97cf0f5f3419b86bd9ca58482f8e'
            'baac6223eb35729ea301bd658dc2df6aad5396c7c0b1ec15c8aac1803ef37f6a')

prepare() {
  cd "$pkgname-$pkgver"

  patch -p0 -i "$srcdir"/miniupnpd-1.8.20140401-foreground.patch
}

build() {
  cd "$pkgname-$pkgver"

  CONFIG_OPTIONS="--strict --ipv6 --leasefile" make -f Makefile.linux config.h
  make -f Makefile.linux
}

package() {
  cd "$pkgname-$pkgver"
  mkdir -p "$pkgdir/usr/share/man/man8"

  make PREFIX="$pkgdir/" SBININSTALLDIR="$pkgdir/usr/bin" -f Makefile.linux install

  rm -r "${pkgdir}/etc/init.d"

  install -Dm644 LICENSE "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
  install -Dm644 "${srcdir}/miniupnpd.systemd" "${pkgdir}/usr/lib/systemd/system/miniupnpd.service"

  sed -i 's:/s\?bin/iptables:/usr/bin/iptables:
          s:eth0:"`cat /etc/miniupnpd/miniupnpd.conf | '"awk -F= '/^ext_ifname/ { print \$2 }'"'`":' "${pkgdir}"/etc/miniupnpd/*.sh
  sed -i -e "s/^uuid=[-0-9a-f]*/uuid=00000000-0000-0000-0000-000000000000/
             s/make genuuid/uuidgen/" "${pkgdir}/etc/miniupnpd/miniupnpd.conf"
}