summaryrefslogtreecommitdiff
path: root/wide-dhcpv6/PKGBUILD
blob: eb6486e74a8696f9b8e364d3f2f06345e01af518 (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
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# Maintainer: Erich Eckner <arch at eckner dot net>
# Contributor: Spyros Stathopoulos <spystath@gmail.com>
pkgname=wide-dhcpv6
pkgver=20080615.23
pkgrel=3
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')
depends=()
_pinned_dependencies_arch32=(
  'glibc>=2.40'
)
_pinned_dependencies_artix=(
  'glibc>=2.40'
)
depends_i486=("${_pinned_dependencies_arch32[@]}")
depends_i686=("${_pinned_dependencies_arch32[@]}")
depends_pentium4=("${_pinned_dependencies_arch32[@]}")
if [ "${OS}" = 'artix' ]; then
  depends+=("${_pinned_dependencies_artix[@]}")
fi

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
  echo "$OS"
  echo "${depends[@]}"
}