]>
Commit | Line | Data |
---|---|---|
4d916382 DS |
1 | #!/usr/bin/make -f |
2 | ||
883f6640 | 3 | # standard Debian options & profiles |
7dc9a305 | 4 | |
4c2db6ed | 5 | export DEB_BUILD_MAINT_OPTIONS = hardening=+all |
4d916382 | 6 | |
55795c9c | 7 | ifneq (,$(filter terse,$(DEB_BUILD_OPTIONS))) |
883f6640 DL |
8 | MAKE_SILENT="V=0" |
9 | export DH_VERBOSE=0 | |
55795c9c | 10 | else |
883f6640 DL |
11 | MAKE_SILENT="V=1" |
12 | export DH_VERBOSE=1 | |
13 | export DH_OPTIONS=-v | |
55795c9c DL |
14 | endif |
15 | ||
883f6640 | 16 | # package-specific build profiles |
55795c9c | 17 | |
af1933fd | 18 | ifeq ($(filter pkg.frr.nortrlib,$(DEB_BUILD_PROFILES)),) |
883f6640 | 19 | CONF_RPKI=--enable-rpki |
af1933fd DL |
20 | else |
21 | CONF_RPKI=--disable-rpki | |
d84e22b8 DL |
22 | endif |
23 | ||
adcc6fb3 DL |
24 | ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),) |
25 | DH_WITH_SYSTEMD=systemd, | |
883f6640 | 26 | CONF_SYSTEMD=--enable-systemd=yes |
89073ff1 | 27 | else |
adcc6fb3 | 28 | DH_WITH_SYSTEMD= |
883f6640 | 29 | CONF_SYSTEMD=--enable-systemd=no |
100c355e MW |
30 | endif |
31 | ||
7480ba75 DL |
32 | export PYTHON=python3 |
33 | ||
adcc6fb3 | 34 | %: |
883f6640 | 35 | dh $@ --with=$(DH_WITH_SYSTEMD)autoreconf --parallel |
adcc6fb3 | 36 | |
4d916382 | 37 | override_dh_auto_configure: |
883f6640 | 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 \ | |
55795c9c | 44 | --with-vtysh-pager=/usr/bin/pager \ |
27ced150 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" \ | |
883f6640 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 \ | |
4a244440 DL |
56 | --enable-fpm \ |
57 | --disable-protobuf \ | |
6fa781c4 | 58 | --disable-zeromq \ |
883f6640 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 \ | |
883f6640 | 68 | # end |
4d916382 | 69 | |
4d916382 DS |
70 | override_dh_auto_install: |
71 | dh_auto_install | |
f1db66bf | 72 | |
7480ba75 | 73 | sed -e '1c #!/usr/bin/python3' -i debian/tmp/usr/lib/frr/frr-reload.py |
c650c681 | 74 | |
dcdf2f0d | 75 | # let dh_systemd_* and dh_installinit do their thing automatically |
adcc6fb3 DL |
76 | ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),) |
77 | cp tools/frr.service debian/frr.service | |
adcc6fb3 | 78 | endif |
0c42b656 | 79 | cp tools/frr debian/frr.init |
f1db66bf | 80 | |
dcdf2f0d | 81 | # install config files |
d8e4c438 | 82 | mkdir -p debian/tmp/etc/frr/ |
883f6640 | 83 | sed -e 's#^!log file #!log file /var/log/frr/#' -i debian/tmp/usr/share/doc/frr/examples/*sample* |
f1db66bf | 84 | |
dcdf2f0d | 85 | # drop dev-only files |
4bcac45b DL |
86 | find debian/tmp -name '*.la' -o -name '*.a' -o -name 'lib*.so' | xargs rm -f |
87 | rm -rf debian/tmp/usr/include | |
9e554357 | 88 | |
1b44f500 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 | ||
55795c9c DL |
95 | override_dh_auto_build: |
96 | dh_auto_build -- $(MAKE_SILENT) | |
97 | ||
27ced150 | 98 | override_dh_makeshlibs: |
27ced150 DL |
99 | dh_makeshlibs -n |
100 | ||
cffd0247 DL |
101 | override_dh_missing: |
102 | dh_missing --fail-missing | |
103 | ||
9e554357 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 |