summaryrefslogtreecommitdiff
path: root/community/bird/PKGBUILD
blob: 95c6821cce13bc8aed15249f97bb6d3918805750 (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
# $Id$
# Maintainer: Sebastien Luttringer <seblu+arch@seblu.net>

pkgbase=bird
pkgname=('bird' 'bird6')
pkgver=1.3.4
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.rc'
        'bird.conf'
        'bird.service'
        'bird6.service')
md5sums=('20f5aa9d3f853d2c922438dc9d922ecc'
         'e5ef4a753623e15e9daacb0874747bfb'
         'fbd56e7ce085107e6b6c5600f4f1a4b8'
         'e82a0519dca0b289685fda44787f5911'
         'c32e7f6cf1be6ed6f9aa98feea25176d')

build() {
  # different directory to build seprate version of bird
  cp -a ${pkgbase}-${pkgver} ${pkgbase}6-${pkgver}

  # build classic bird
  cd ${pkgbase}-${pkgver}
  ./configure --prefix=/usr --sysconfdir=/etc  --localstatedir=/var
  make

  # build ipv6 bird
  cd "$srcdir/${pkgbase}6-${pkgver}"
  ./configure --prefix=/usr --sysconfdir=/etc  --localstatedir=/var --enable-ipv6
  make
}

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

  # iniscripts files
  install -D -m 755 bird.rc "${pkgdir}/etc/rc.d/bird"
  install -D -m 644 bird.conf "${pkgdir}/etc/conf.d/bird"
  # systemd file
  install -D -m 644 bird.service "${pkgdir}/lib/systemd/system/bird.service"

  cd ${pkgname}-${pkgver}
  make prefix="${pkgdir}/usr" sysconfdir="${pkgdir}/etc" localstatedir="${pkgdir}/var" install
  make docdir="${pkgdir}/usr/share/doc/${pkgname}" install-docs

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

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

  # iniscripts files
  install -D -m 755 bird.rc "${pkgdir}/etc/rc.d/bird6"
  install -D -m 644 bird.conf "${pkgdir}/etc/conf.d/bird6"
  sed -ri 's/bird/bird6/' "${pkgdir}/etc/rc.d/bird6"
  # systemd config file
  install -D -m 644 bird6.service "${pkgdir}/lib/systemd/system/bird6.service"

  cd ${pkgname}-${pkgver}
  make prefix="${pkgdir}/usr" sysconfdir="${pkgdir}/etc" localstatedir="${pkgdir}/var" install
  make docdir="${pkgdir}/usr/share/doc/${pkgname}" install-docs

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

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