summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: c851cd94dd00a66b8cff5b9f833fb9e27b7c128a (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
# Maintainer: Clayton Craft <clayton@igalia.com>
pkgname=dnsmasq-nftset-git
pkgver=2.86test5.r1.g767d9cb
pkgrel=1
pkgdesc='Lightweight, easy to configure DNS forwarder and DHCP server, with nftset support enabled'
arch=('i686' 'x86_64')
url="http://www.thekelleys.org.uk/dnsmasq/doc.html"
license=('GPL')
depends=('glibc' 'gmp' 'libidn2' 'libdbus' 'libnetfilter_conntrack' 'nettle' 'nftables')
makedepends=('git')
provides=('dnsmasq')
conflicts=('dnsmasq')
backup=('etc/dnsmasq.conf')
source=("git://thekelleys.org.uk/dnsmasq.git"
        "dnsmasq-sysusers.conf::https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/dnsmasq/trunk/dnsmasq-sysusers.conf"
        "dnsmasq.service::https://raw.githubusercontent.com/archlinux/svntogit-packages/packages/dnsmasq/trunk/dnsmasq.service")
sha256sums=('SKIP'
            'SKIP'
            'SKIP')


pkgver() {
  cd "dnsmasq"

  git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}

_build_copts="-DHAVE_DBUS -DHAVE_LIBIDN2 -DHAVE_CONNTRACK -DHAVE_DNSSEC -DHAVE_NFTSET"

build() {
  cd "dnsmasq"

  make \
    CFLAGS="$CPPFLAGS $CFLAGS" \
    LDFLAGS="$LDFLAGS" \
    COPTS="$_build_copts" \
    all-i18n

  cd "contrib/lease-tools"
  make \
    CFLAGS="$CPPFLAGS $CFLAGS" \
    LDFLAGS="$LDFLAGS" \
    COPTS="$_build_copts" \
    all
}

package() {
  cd "dnsmasq"

  make \
    COPTS="$_build_copts" \
    DESTDIR="$pkgdir" \
    PREFIX="/usr" \
    BINDIR="/usr/bin" \
    install \
    install-i18n

  install -Dm644 "dnsmasq.conf.example" "$pkgdir/etc/dnsmasq.conf"

  install -Dm644 "dbus/dnsmasq.conf" -t "$pkgdir/usr/share/dbus-1/system.d"

  install -Dm644 "$srcdir/dnsmasq.service" -t "$pkgdir/usr/lib/systemd/system"
  install -Dm644 "$srcdir/dnsmasq-sysusers.conf" "$pkgdir/usr/lib/sysusers.d/dnsmasq.conf"

  # DNSSEC setup
  sed -i 's,%%PREFIX%%,/usr,' "$pkgdir/etc/dnsmasq.conf"
  install -Dm644 "trust-anchors.conf" -t "$pkgdir/usr/share/dnsmasq"

  install -Dm755 "contrib/lease-tools"/dhcp_{release{,6},lease_time} -t "$pkgdir/usr/bin"
  install -Dm644 "contrib/lease-tools"/dhcp_{release{,6},lease_time}.1 -t "$pkgdir/usr/share/man/man1"
}


# vim: ts=2 sw=2 et ft=sh