]>
Commit | Line | Data |
---|---|---|
4d916382 DS |
1 | #!/usr/bin/make -f |
2 | ||
3 | export DH_VERBOSE=1 | |
4 | export DEB_BUILD_HARDENING=1 | |
d0af8528 | 5 | export DH_OPTIONS=-v |
4d916382 DS |
6 | |
7 | ifeq ($(WANT_SNMP), 1) | |
8 | USE_SNMP=--enable-snmp | |
9 | $(warning "DEBIAN: SNMP enabled, sorry for your inconvenience") | |
10 | else | |
11 | $(warning "DEBIAN: SNMP disabled, see README.Debian") | |
12 | endif | |
13 | ||
35dab95b DS |
14 | ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) |
15 | DEBIAN_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) | |
16 | endif | |
17 | ||
18 | ifdef DEBIAN_JOBS | |
19 | MAKEFLAGS += -j$(DEBIAN_JOBS) | |
20 | endif | |
21 | ||
4d916382 | 22 | %: |
d8e4c438 | 23 | dh $@ --with=systemd,autoreconf --parallel --dbg-package=frr-dbg --list-missing |
4d916382 DS |
24 | |
25 | override_dh_auto_configure: | |
d8e4c438 | 26 | # Frr needs /proc to check some BSD vs Linux specific stuff. |
4d916382 DS |
27 | # Else it fails with an obscure error message pointing out that |
28 | # IPCTL_FORWARDING is an undefined symbol which is not very helpful. | |
29 | @if ! [ -d /proc/1 ]; then \ | |
f1db66bf DS |
30 | echo "./configure needs a mounted /proc"; \ |
31 | exit 1; \ | |
4d916382 | 32 | fi |
d0af8528 DS |
33 | |
34 | if ! [ -e config.status ]; then \ | |
4d916382 | 35 | dh_auto_configure -- \ |
d8e4c438 DS |
36 | --enable-exampledir=/usr/share/doc/frr/examples/ \ |
37 | --localstatedir=/var/run/frr \ | |
38 | --sbindir=/usr/lib/frr \ | |
39 | --sysconfdir=/etc/frr \ | |
f1db66bf | 40 | $(USE_SNMP) \ |
f1db66bf | 41 | --enable-ospfapi=yes \ |
03718c3d DS |
42 | --enable-vtysh=yes \ |
43 | --enable-isisd=yes \ | |
90fb3e13 | 44 | --enable-multipath=256 \ |
d8e4c438 DS |
45 | --enable-user=frr \ |
46 | --enable-group=frr \ | |
47 | --enable-vty-group=frrvty \ | |
f1db66bf DS |
48 | --enable-configfile-mask=0640 \ |
49 | --enable-logfile-mask=0640 \ | |
d6db5772 | 50 | --enable-werror \ |
f1db66bf | 51 | --enable-gcc-rdynamic \ |
6fb16c6b | 52 | --with-libpam \ |
f87adf0a | 53 | --enable-systemd=yes \ |
f879bbf4 | 54 | --enable-poll=yes \ |
000cf1fb | 55 | --enable-cumulus=yes \ |
d8e4c438 | 56 | --enable-pimd=yes \ |
9ad5ef40 DS |
57 | --enable-dependency-tracking \ |
58 | --enable-bgp-vnc=no; \ | |
d0af8528 | 59 | fi |
4d916382 DS |
60 | |
61 | override_dh_auto_build: | |
d0af8528 DS |
62 | #dh_auto_build |
63 | $(MAKE) | |
85ca2dfd | 64 | dh_auto_build -- -C doc draft-zebra-00.txt |
d0af8528 | 65 | |
f1db66bf | 66 | |
4d916382 | 67 | # doc/ is a bit crazy |
76ed358f | 68 | ifeq ($(GENERATE_PDF), 1) |
d8e4c438 | 69 | dh_auto_build -- -C doc frr.pdf || true # pdfetex fails with exit code 1 but still produces a good looking .pdf |
76ed358f | 70 | endif |
d8e4c438 DS |
71 | rm -vf doc/frr.info |
72 | dh_auto_build -- -C doc frr.info | |
73 | rm -vf doc/frr.info.html* | |
d0af8528 DS |
74 | |
75 | override_dh_auto_test: | |
f1db66bf | 76 | |
4d916382 DS |
77 | override_dh_auto_install: |
78 | dh_auto_install | |
f1db66bf | 79 | |
4d916382 DS |
80 | # cleaning up the info dir |
81 | rm -f debian/tmp/usr/share/info/dir* | |
f1db66bf | 82 | |
4d916382 | 83 | # install config files |
d8e4c438 DS |
84 | mkdir -p debian/tmp/etc/frr/ |
85 | perl -pi -e 's#^!log file #!log file /var/log/frr/#' debian/tmp/usr/share/doc/frr/examples/*sample* | |
f1db66bf | 86 | |
d8e4c438 | 87 | # installing the Frr specific SNMP MIB |
3d85ffa5 | 88 | ifeq ($(WANT_SNMP), 1) |
4d916382 | 89 | install -D -m 644 ./zebra/GNOME-PRODUCT-ZEBRA-MIB debian/tmp/usr/share/snmp/mibs/GNOME-PRODUCT-ZEBRA-MIB |
3d85ffa5 DS |
90 | else |
91 | mkdir -p debian/tmp/usr/share/snmp/mibs/ | |
92 | endif | |
f1db66bf | 93 | |
4d916382 DS |
94 | # cleaning .la files |
95 | sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/*.la | |
96 | ||
858aa29c | 97 | override_dh_systemd_start: |
d8e4c438 | 98 | dh_systemd_start frr.service |
858aa29c DS |
99 | |
100 | override_dh_systemd_enable: | |
d8e4c438 | 101 | dh_systemd_enable frr.service |
858aa29c | 102 | |
a8247b21 SM |
103 | # backports |
104 | SRCPKG = frr | |
105 | KNOWN_BACKPORTS = ubuntu12.04 ubuntu14.04 ubuntu16.04 | |
106 | ORIG_VERSION := $(shell dh_testdir && grep -E < configure.ac '^AC_INIT\(.*\)' \ | |
107 | | cut -d, -f2 | xargs echo) | |
108 | DEBIAN_VERSION := $(shell dh_testdir && \ | |
79c81c26 SM |
109 | dpkg-parsechangelog -c1 < debian/changelog | \ |
110 | sed -rn 's/^Version: ?//p') | |
a8247b21 SM |
111 | -include debian/backports/rules |
112 | ||
113 | ifneq ($(TARBALLDIR),) | |
0f4ac621 | 114 | ifeq ($(wildcard frr-$(ORIG_VERSION).tar.gz),frr-$(ORIG_VERSION).tar.gz) |
ee9d7744 SM |
115 | |
116 | $(TARBALLDIR)/$(SRCPKG)_$(ORIG_VERSION).orig.tar.gz: \ | |
0f4ac621 MW |
117 | frr-$(ORIG_VERSION).tar.gz |
118 | gunzip -c < $< | tar --delete frr-$(ORIG_VERSION)/debian/ \ | |
ee9d7744 SM |
119 | | gzip -c > $@ |
120 | ||
0f4ac621 | 121 | else # wildcard frr-$(ORIG_VERSION).tar.gz |
ee9d7744 | 122 | |
a8247b21 SM |
123 | # better error message on missing .orig.tar.gz |
124 | $(TARBALLDIR)/$(SRCPKG)_$(ORIG_VERSION).orig.tar.gz: | |
ee9d7744 | 125 | @ echo "\`$(TARBALLDIR)/$(SRCPKG)-$(ORIG_VERSION).tar.gz'" not \ |
a8247b21 SM |
126 | found and not generated by debian/rules. Provided you have the \ |
127 | necessary packages installed, you can generate it yourself via \ | |
ee9d7744 | 128 | "\"./bootstrap.sh && ./configure && make dist\"". |
a8247b21 | 129 | exit 1 |
ee9d7744 | 130 | |
0f4ac621 | 131 | endif # wildcard frr-$(ORIG_VERSION).tar.gz |
ee9d7744 | 132 | endif # TARBALLDIR nonempty |