summaryrefslogtreecommitdiff
path: root/wide-dhcpv6/PKGBUILD
blob: 47bd08062058bc46a994880f0c35f44b4cb28cfc (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
78
79
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Spyros Stathopoulos <spystath@gmail.com>
pkgname=wide-dhcpv6
pkgver=20080615.23
pkgrel=1
pkgdesc="An open source implementation of DHCPv6 developed by KAME project (with Debian patches)"
arch=('i486' 'i686' 'pentium4' 'x86_64')
url="https://sourceforge.net/projects/wide-dhcpv6/"
license=('custom')
backup=('etc/wide-dhcpv6/dhcp6c.conf' 'etc/conf.d/startpd.conf')
options=('emptydirs')

source=("https://downloads.sourceforge.net/project/${pkgname}/${pkgname}/${pkgname}-${pkgver%.*}/${pkgname}-${pkgver%.*}.tar.gz"
        "https://deb.debian.org/debian/pool/main/w/${pkgname}/${pkgname}_${pkgver%.*}-${pkgver#*.}.debian.tar.xz"
        "0000-noyywrap-option.patch"
        "0002-Fix-makefile.patch"
        "dhcp6c.service"
        "dhcp6c@.service"
        "startpd.conf"
        "dhcp6c.conf")

install='dhcp6c.install'

md5sums=('1011e165850fe40d3e332dad2bfd30b3'
         '32aa3aa2cb7f48f9ecb394814cf62575'
         '6bc5f3779f04cd1c74469b4942c1061d'
         'dfba035ab0fd99ae56ab2e37a000cba0'
         '7606280036a1a2c7c0a38af84803f41c'
         '897c6ccb3608e6ac33c3022631a49ee6'
         '8ec3740147eb2ff9ee7bec7070d2f008'
         '54866e3bdd4093efe89a2fc245e7f5ab')

prepare() {
  cd ${srcdir}
  cp debian/patches/*patch ${srcdir}
  # this is included in the new 0002 patch, so rm it
  rm "0002-Don-t-strip-binaries.patch"
  cd ${srcdir}/$pkgname-${pkgver%.*}
  for i in ../*patch ; do
    patch -p1 < ${i};
  done
}

build() {
  cd "$srcdir/$pkgname-${pkgver%.*}"
  ./configure --prefix=/usr \
    --mandir=/usr/share/man \
    --with-localdbdir=/var/lib/dhcpv6 \
    --sysconfdir=/etc/wide-dhcpv6 \
    --sbindir=/usr/bin \
    --with-user=root \
    --with-group=root
  # -j > 1 breaks build dependencies
  make -j1
}

package() {
  cd "$srcdir/$pkgname-${pkgver%.*}"
  mkdir -p "${pkgdir}/var/lib/dhcpv6"
  mkdir -p "${pkgdir}/usr/share/man"
  mkdir -p "${pkgdir}/usr/share/man/man5"
  mkdir -p "${pkgdir}/usr/share/man/man8"
  #install -D -m644 ${srcdir}/${pkgname}-${pkgver%.*}/dhcp6c.conf.sample \
  #        ${pkgdir}/etc/wide-dhcpv6/dhcp6c.conf
  install -D -m644 ${srcdir}/dhcp6c.conf \
    ${pkgdir}/etc/wide-dhcpv6/dhcp6c.conf
  install -D -m644 ${srcdir}/${pkgname}-${pkgver%.*}/dhcp6s.conf.sample \
    ${pkgdir}/etc/wide-dhcpv6/dhcp6s.conf
  install -D -m644 ${srcdir}/dhcp6c.service \
    ${pkgdir}/usr/lib/systemd/system/dhcp6c.service
  install -D -m644 ${srcdir}/dhcp6c@.service \
    ${pkgdir}/usr/lib/systemd/system/dhcp6c@.service
  install -D -m644 ${srcdir}/${pkgname}-${pkgver%.*}/COPYRIGHT \
    ${pkgdir}/usr/share/licenses/wide-dhcpv6/LICENSE
  install -D -m644 ${srcdir}/startpd.conf \
    ${pkgdir}/etc/conf.d/startpd.conf
  make DESTDIR="$pkgdir/" install
}