summaryrefslogtreecommitdiff
path: root/community/bird/PKGBUILD
blob: e1c4b66cae88157ef6fab6a3d9d77e22c20e7d0c (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
# $Id: PKGBUILD 94704 2013-07-29 09:56:29Z seblu $
# Maintainer: Sébastien Luttringer

pkgbase=bird
pkgname=('bird' 'bird6')
pkgver=1.3.11
pkgrel=1
arch=('i686' 'x86_64')
url='http://bird.network.cz/'
license=('GPL2')
depends=('readline' 'ncurses')
source=("ftp://bird.network.cz/pub/bird/${pkgname}-${pkgver}.tar.gz"
        'bird.service'
        'bird6.service')
md5sums=('8ad2eb997fb8251bc5b24cf32619571b'
         '01360e3b71ff2ed2223e87a3176e0659'
         'b895b473cbc98cfd54751f737536eb1e')

build() {
  cd $pkgbase-$pkgver
  [[ -e _build4 ]] && rm -rf _build4
  [[ -e _build6 ]] && rm -rf _build6
  mkdir _build4 _build6

  # build ipv4 bird
  cd _build4
  ../configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --docdir=/usr/share/doc/$pkgname
  make

  # build ipv6 bird
  cd ../_build6
  ../configure \
    --prefix=/usr \
    --sbindir=/usr/bin \
    --sysconfdir=/etc \
    --localstatedir=/var \
    --docdir=/usr/share/doc/$pkgname \
    --enable-ipv6
  make
}

package_bird () {
  pkgdesc='RIP, OSPFv2 and BGP daemon (ipv4 version)'
  backup=('etc/bird.conf')

  cd $pkgbase-$pkgver/_build4
  make \
    prefix="$pkgdir/usr" \
    sysconfdir="$pkgdir/etc" \
    sbindir="$pkgdir/usr/bin" \
    localstatedir="$pkgdir/var" \
    docdir="$pkgdir/usr/share/doc/$pkgname" \
    install
  #make docdir="$pkgdir/usr/share/doc/$pkgname" install-docs

  # no /var inside pkg
  rm -r "$pkgdir/var"

  # systemd
  install -D -m 644 "$srcdir/bird.service" "$pkgdir/usr/lib/systemd/system/bird.service"
}

package_bird6 () {
  pkgdesc='RIP, OSPFv3, RADV and BGP daemon (ipv6 version)'
  backup=('etc/bird6.conf')

  cd $pkgbase-$pkgver/_build6
  make \
    prefix="$pkgdir/usr" \
    sysconfdir="$pkgdir/etc" \
    sbindir="$pkgdir/usr/bin" \
    localstatedir="$pkgdir/var" \
    docdir="$pkgdir/usr/share/doc/$pkgname" \
    install
  #make docdir="$pkgdir/usr/share/doc/$pkgname" install-docs

  # no /var inside pkg
  rm -r "$pkgdir/var"

  # systemd
  install -D -m 644 "$srcdir/bird6.service" "$pkgdir/usr/lib/systemd/system/bird6.service"
}

# vim:set ts=2 sw=2 et: