blob: 9fa810862a402f910a706a4a11967eb8189fa70d (
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
# Maintainer: Christian Franke <nobody@nowhere.ws>
pkgname=frr
pkgver=7.1
pkgrel=0
pkgdesc="Free Range Routing is a fork of Quagga"
pkgusers="frr"
pkggroups="frr frrvty"
url="https://frrouting.org/"
arch="all"
license="GPL-2.0-or-later"
depends="iproute2 bash"
makedepends="autoconf automake libtool
bsd-compat-headers
c-ares-dev
flex bison
json-c-dev
libyang-dev
linux-headers
net-snmp-dev
py-sphinx
python3-dev
readline-dev
rtrlib-dev
texinfo
"
checkdepends="pytest py-setuptools"
install="$pkgname.pre-install"
subpackages="$pkgname-dbg
$pkgname-doc::noarch
$pkgname-openrc::noarch
$pkgname-pythontools::noarch
$pkgname-rpki
$pkgname-snmp
"
source="https://github.com/FRRouting/frr/archive/$pkgname-$pkgver.tar.gz
frr.initd"
builddir="$srcdir"/$pkgname-$pkgname-$pkgver
_sysconfdir=/etc/frr
build() {
cd "$builddir"
./bootstrap.sh
./configure \
--prefix=/usr \
--enable-exampledir=/usr/share/doc/frr/examples/ \
--localstatedir=/run/frr \
--sbindir=/usr/lib/frr \
--sysconfdir=$_sysconfdir \
--libdir=/usr/lib/frr \
--with-moduledir=/usr/lib/frr/modules \
LIBTOOLFLAGS="-rpath /usr/lib/frr" \
--disable-dependency-tracking \
--enable-systemd=no \
--enable-rpki \
--with-libpam \
--enable-doc \
--enable-doc-html \
--enable-snmp \
--enable-fpm \
--disable-protobuf \
--disable-zeromq \
--enable-ospfapi \
--enable-bgp-vnc \
--enable-multipath=256 \
--enable-user=${pkgusers%% *} \
--enable-group=${pkggroups%% *} \
--enable-vty-group=frrvty \
--enable-configfile-mask=0640 \
--enable-logfile-mask=0640
make
}
check() {
cd "$builddir"
make -j 1 check
}
package() {
cd "$builddir"
make DESTDIR="$pkgdir" install
# Remove development files, static libraries and headers.
# They are internal and should not be shipped as a package.
# Compare https://github.com/FRRouting/frr/blob/frr-7.0/debian/rules#L89
find "$pkgdir" -name '*.la' -o -name '*.a' -o -name 'lib*.so' | xargs rm -f
rm -rf "$pkgdir"/usr/include
rm -f "$pkgdir"/usr/lib/frr/ssd
# FRR currently installs two flavours of scripts for starting and stopping it.
# Remove the deprecated one.
rm -f "$pkgdir"/usr/lib/frr/frr
rm -f "$pkgdir"/usr/lib/frr/frr-reload
install -d "$pkgdir"$_sysconfdir
install -Dm644 "$builddir"/tools/etc/frr/daemons "$pkgdir"$_sysconfdir
chown -R ${pkgusers%% *}:${pkggroups%% *} "$pkgdir"$_sysconfdir
install -Dm755 "$srcdir"/frr.initd "$pkgdir"/etc/init.d/frr
}
pythontools() {
pkgdesc="$pkgdesc (tools)"
depends="python2 py2-ipaddr"
mkdir -p "$subpkgdir"/usr/lib/frr
mv "$pkgdir"/usr/lib/frr/frr-reload.py "$subpkgdir/usr/lib/frr"
}
rpki() {
pkgdesc="$pkgdesc (BGP RPKI support)"
install -d "$subpkgdir/usr/lib/frr/modules"
mv "$pkgdir"/usr/lib/frr/modules/bgpd_rpki.so "$subpkgdir/usr/lib/frr/modules"
}
snmp() {
pkgdesc="$pkgdesc (net-snmp bindings)"
install -d "$subpkgdir/usr/lib/frr/modules"
mv "$pkgdir"/usr/lib/frr/modules/*_snmp.so "$subpkgdir/usr/lib/frr/modules"
mv "$pkgdir"/usr/lib/frr/libfrrsnmp.* "$subpkgdir/usr/lib/frr"
}
sha512sums="d1020607c4c142cc2895c514dcee232a6711a01e63e35a4005249fba9a2b491ebede6dfcfc8d1e885d9d93aff34c99aaced987141040f437eba6779007d06817 frr-7.1.tar.gz
b495b2be9f2cbb065104ccc0c3474471e870b53ac62ed4fba40020c8d50866e637a99ef3d7af5de1018ff659c4757baac4f40d7648a9de99ed14db33c8992b54 frr.initd"
|