]> git.proxmox.com Git - mirror_frr.git/blame - debian/rules
Merge pull request #5116 from ton31337/feature/maximum-prefix_uint64_to_uint32_7.1
[mirror_frr.git] / debian / rules
CommitLineData
4d916382
DS
1#!/usr/bin/make -f
2
452a48cf 3# standard Debian options & profiles
7dc9a305 4
4c2db6ed 5export DEB_BUILD_MAINT_OPTIONS = hardening=+all
4d916382 6
5d2f5756 7ifneq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
452a48cf
DL
8 MAKE_SILENT="V=0"
9 export DH_VERBOSE=0
5d2f5756 10else
452a48cf
DL
11 MAKE_SILENT="V=1"
12 export DH_VERBOSE=1
13 export DH_OPTIONS=-v
5d2f5756
DL
14endif
15
452a48cf 16# package-specific build profiles
5d2f5756 17
600db12a 18ifeq ($(filter pkg.frr.nortrlib,$(DEB_BUILD_PROFILES)),)
452a48cf 19 CONF_RPKI=--enable-rpki
600db12a
DL
20else
21 CONF_RPKI=--disable-rpki
3b2a8d25
DL
22endif
23
6397fb88
DL
24ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),)
25 DH_WITH_SYSTEMD=systemd,
452a48cf 26 CONF_SYSTEMD=--enable-systemd=yes
89073ff1 27else
6397fb88 28 DH_WITH_SYSTEMD=
452a48cf 29 CONF_SYSTEMD=--enable-systemd=no
100c355e
MW
30endif
31
2dacd93a
DL
32export PYTHON=python3
33
6397fb88 34%:
452a48cf 35 dh $@ --with=$(DH_WITH_SYSTEMD)autoreconf --parallel
6397fb88 36
4d916382 37override_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
70override_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
76ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),)
77 cp tools/frr.service debian/frr.service
6397fb88 78endif
cf3ae51c
DL
79 cp tools/frrinit.sh debian/frr.init
80 -rm -f debian/tmp/usr/lib/frr/frr
f1db66bf 81
25e02efe 82# install config files
58b1c7b6
DL
83 mkdir -p debian/tmp/etc
84 cp -r tools/etc/* debian/tmp/etc/
f35d0a76 85 -rm debian/tmp/etc/frr/daemons.conf
f1db66bf 86
58b1c7b6
DL
87 sed -e 's#^!log file #!log file /var/log/frr/#' -i debian/tmp/usr/share/doc/frr/examples/*sample*
88
25e02efe 89# drop dev-only files
08427130
DL
90 find debian/tmp -name '*.la' -o -name '*.a' -o -name 'lib*.so' | xargs rm -f
91 rm -rf debian/tmp/usr/include
f35d0a76 92 -rm debian/tmp/usr/lib/frr/ssd
02334d76 93
31bbde19
DL
94# use installed js libraries
95 -rm -f debian/tmp/usr/share/doc/frr/html/_static/jquery.js
96 ln -s /usr/share/javascript/jquery/jquery.js debian/tmp/usr/share/doc/frr/html/_static/jquery.js
97 -rm -f debian/tmp/usr/share/doc/frr/html/_static/underscore.js
98 ln -s /usr/share/javascript/underscore/underscore.js debian/tmp/usr/share/doc/frr/html/_static/underscore.js
99
5d2f5756
DL
100override_dh_auto_build:
101 dh_auto_build -- $(MAKE_SILENT)
102
6fb89019
DL
103override_dh_installinit:
104 dh_installinit -r
105
106override_dh_installsystemd:
107 dh_installsystemd -r
108
26f0a297 109override_dh_makeshlibs:
26f0a297
DL
110 dh_makeshlibs -n
111
6e484e36
DL
112override_dh_missing:
113 dh_missing --fail-missing
114
02334d76
DL
115override_dh_auto_clean:
116# we generally do NOT want a full distclean since that wipes both
b3c4c164 117# debian/changelog and config.version
02334d76 118 if test -f Makefile; then make redistclean; fi
4741497b
DL
119 -rm -f debian/frr.init
120 -rm -f debian/frr.service