]>
Commit | Line | Data |
---|---|---|
4d916382 DS |
1 | #!/usr/bin/make -f |
2 | ||
452a48cf | 3 | # standard Debian options & profiles |
7dc9a305 | 4 | |
4c2db6ed | 5 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
4d916382 | 6 | |
5d2f5756 | 7 | ifneq (,$(filter terse,$(DEB_BUILD_OPTIONS))) |
452a48cf DL |
8 | MAKE_SILENT="V=0" |
9 | export DH_VERBOSE=0 | |
5d2f5756 | 10 | else |
452a48cf DL |
11 | MAKE_SILENT="V=1" |
12 | export DH_VERBOSE=1 | |
13 | export DH_OPTIONS=-v | |
5d2f5756 DL |
14 | endif |
15 | ||
452a48cf | 16 | # package-specific build profiles |
5d2f5756 | 17 | |
600db12a | 18 | ifeq ($(filter pkg.frr.nortrlib,$(DEB_BUILD_PROFILES)),) |
452a48cf | 19 | CONF_RPKI=--enable-rpki |
600db12a DL |
20 | else |
21 | CONF_RPKI=--disable-rpki | |
3b2a8d25 DL |
22 | endif |
23 | ||
6397fb88 DL |
24 | ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),) |
25 | DH_WITH_SYSTEMD=systemd, | |
452a48cf | 26 | CONF_SYSTEMD=--enable-systemd=yes |
89073ff1 | 27 | else |
6397fb88 | 28 | DH_WITH_SYSTEMD= |
452a48cf | 29 | CONF_SYSTEMD=--enable-systemd=no |
100c355e MW |
30 | endif |
31 | ||
2dacd93a DL |
32 | export PYTHON=python3 |
33 | ||
6397fb88 | 34 | %: |
452a48cf | 35 | dh $@ --with=$(DH_WITH_SYSTEMD)autoreconf --parallel |
6397fb88 | 36 | |
4d916382 | 37 | override_dh_auto_configure: |
452a48cf | 38 | $(shell dpkg-buildflags --export=sh); \ |
4d916382 | 39 | dh_auto_configure -- \ |
d8e4c438 DS |
40 | --enable-exampledir=/usr/share/doc/frr/examples/ \ |
41 | --localstatedir=/var/run/frr \ | |
42 | --sbindir=/usr/lib/frr \ | |
43 | --sysconfdir=/etc/frr \ | |
5d2f5756 | 44 | --with-vtysh-pager=/usr/bin/pager \ |
26f0a297 DL |
45 | --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/frr \ |
46 | --with-moduledir=/usr/lib/$(DEB_HOST_MULTIARCH)/frr/modules \ | |
47 | LIBTOOLFLAGS="-rpath /usr/lib/$(DEB_HOST_MULTIARCH)/frr" \ | |
452a48cf DL |
48 | --disable-dependency-tracking \ |
49 | \ | |
50 | $(CONF_SYSTEMD) \ | |
51 | $(CONF_RPKI) \ | |
52 | --with-libpam \ | |
53 | --enable-doc \ | |
54 | --enable-doc-html \ | |
55 | --enable-snmp \ | |
dda2f3eb DL |
56 | --enable-fpm \ |
57 | --disable-protobuf \ | |
5d91b470 | 58 | --disable-zeromq \ |
452a48cf DL |
59 | --enable-ospfapi \ |
60 | --enable-bgp-vnc \ | |
61 | --enable-multipath=256 \ | |
62 | \ | |
63 | --enable-user=frr \ | |
64 | --enable-group=frr \ | |
65 | --enable-vty-group=frrvty \ | |
f1db66bf DS |
66 | --enable-configfile-mask=0640 \ |
67 | --enable-logfile-mask=0640 \ | |
452a48cf | 68 | # end |
4d916382 | 69 | |
4d916382 DS |
70 | override_dh_auto_install: |
71 | dh_auto_install | |
f1db66bf | 72 | |
2dacd93a | 73 | sed -e '1c #!/usr/bin/python3' -i debian/tmp/usr/lib/frr/frr-reload.py |
c650c681 | 74 | |
25e02efe | 75 | # let dh_systemd_* and dh_installinit do their thing automatically |
6397fb88 DL |
76 | ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),) |
77 | cp tools/frr.service debian/frr.service | |
6397fb88 | 78 | endif |
8f196a8b | 79 | cp tools/frr debian/frr.init |
f1db66bf | 80 | |
25e02efe | 81 | # install config files |
d8e4c438 | 82 | mkdir -p debian/tmp/etc/frr/ |
452a48cf | 83 | sed -e 's#^!log file #!log file /var/log/frr/#' -i debian/tmp/usr/share/doc/frr/examples/*sample* |
f1db66bf | 84 | |
25e02efe | 85 | # drop dev-only files |
08427130 DL |
86 | find debian/tmp -name '*.la' -o -name '*.a' -o -name 'lib*.so' | xargs rm -f |
87 | rm -rf debian/tmp/usr/include | |
02334d76 | 88 | |
31bbde19 DL |
89 | # use installed js libraries |
90 | -rm -f debian/tmp/usr/share/doc/frr/html/_static/jquery.js | |
91 | ln -s /usr/share/javascript/jquery/jquery.js debian/tmp/usr/share/doc/frr/html/_static/jquery.js | |
92 | -rm -f debian/tmp/usr/share/doc/frr/html/_static/underscore.js | |
93 | ln -s /usr/share/javascript/underscore/underscore.js debian/tmp/usr/share/doc/frr/html/_static/underscore.js | |
94 | ||
5d2f5756 DL |
95 | override_dh_auto_build: |
96 | dh_auto_build -- $(MAKE_SILENT) | |
97 | ||
26f0a297 | 98 | override_dh_makeshlibs: |
26f0a297 DL |
99 | dh_makeshlibs -n |
100 | ||
6e484e36 DL |
101 | override_dh_missing: |
102 | dh_missing --fail-missing | |
103 | ||
02334d76 DL |
104 | override_dh_auto_clean: |
105 | # we generally do NOT want a full distclean since that wipes both | |
106 | # debianpkg/changelog and config.version | |
107 | if test -f Makefile; then make redistclean; fi |