diff options
Diffstat (limited to 'community/bird')
-rw-r--r-- | community/bird/PKGBUILD | 75 | ||||
-rw-r--r-- | community/bird/bird.conf | 3 | ||||
-rw-r--r-- | community/bird/bird.rc | 34 | ||||
-rw-r--r-- | community/bird/bird.service | 10 | ||||
-rw-r--r-- | community/bird/bird6.service | 10 |
5 files changed, 132 insertions, 0 deletions
diff --git a/community/bird/PKGBUILD b/community/bird/PKGBUILD new file mode 100644 index 000000000..95c6821cc --- /dev/null +++ b/community/bird/PKGBUILD @@ -0,0 +1,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: diff --git a/community/bird/bird.conf b/community/bird/bird.conf new file mode 100644 index 000000000..1730475a7 --- /dev/null +++ b/community/bird/bird.conf @@ -0,0 +1,3 @@ +# vim:set ts=2 sw=2 ft=sh noet: + +DAMEON_OPTIONS='-u noboby -g nobody' diff --git a/community/bird/bird.rc b/community/bird/bird.rc new file mode 100644 index 000000000..85b816e3e --- /dev/null +++ b/community/bird/bird.rc @@ -0,0 +1,34 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions +. /etc/conf.d/${0##*/} + +NAME=bird +DAEMON=/usr/sbin/bird +PID=$(pidof -o %PPID $DAEMON) + +case "$1" in + start) + stat_busy "Starting $NAME daemon" + [[ ! $PID ]] && $DAEMON $DAEMON_OPTIONS && add_daemon $NAME && stat_done && exit 0 + stat_fail + ;; + stop) + stat_busy "Stopping $NAME daemon" + [[ $PID ]] && kill $PID &> /dev/null && rm_daemon $NAME && stat_done && exit 0 + stat_fail + ;; + restart) + $0 stop + $0 start + exit 0 + ;; + *) + echo "usage: ${0##*/} {start|stop|restart}" >&2 + ;; +esac + +exit 1 + +# vim:set ts=2 sw=2 ft=sh noet: diff --git a/community/bird/bird.service b/community/bird/bird.service new file mode 100644 index 000000000..ebdcd6078 --- /dev/null +++ b/community/bird/bird.service @@ -0,0 +1,10 @@ +[Unit] +Description=BIRD routing daemon + +[Service] +ExecStart=/usr/sbin/bird +ExecReload=/bin/sh -c "echo configure | /usr/sbin/birdc" +ExecStop=/bin/sh -c "echo down | /usr/sbin/birdc" + +[Install] +WantedBy=multi-user.target diff --git a/community/bird/bird6.service b/community/bird/bird6.service new file mode 100644 index 000000000..e4b824ee2 --- /dev/null +++ b/community/bird/bird6.service @@ -0,0 +1,10 @@ +[Unit] +Description=BIRD6 routing daemon + +[Service] +ExecStart=/usr/sbin/bird6 +ExecReload=/bin/sh -c "echo configure | /usr/sbin/birdc6" +ExecStop=/bin/sh -c "echo down | /usr/sbin/birdc6" + +[Install] +WantedBy=multi-user.target |