]>
Commit | Line | Data |
---|---|---|
8e18f48e SM |
1 | #!/usr/bin/make -f |
2 | ||
3 | export DH_VERBOSE=1 | |
4 | export DEB_BUILD_HARDENING=1 | |
5 | export DH_OPTIONS=-v | |
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 | ||
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 | ||
22 | %: | |
23 | dh $@ --with=systemd,autoreconf --parallel --dbg-package=frr-dbg --list-missing | |
24 | ||
25 | override_dh_auto_configure: | |
26 | # Frr needs /proc to check some BSD vs Linux specific stuff. | |
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 \ | |
30 | echo "./configure needs a mounted /proc"; \ | |
31 | exit 1; \ | |
32 | fi | |
33 | ||
34 | if ! [ -e config.status ]; then \ | |
35 | dh_auto_configure -- \ | |
36 | --enable-exampledir=/usr/share/doc/frr/examples/ \ | |
37 | --localstatedir=/var/run/frr \ | |
38 | --sbindir=/usr/lib/frr \ | |
39 | --sysconfdir=/etc/frr \ | |
40 | $(USE_SNMP) \ | |
41 | --enable-ospfapi=yes \ | |
42 | --enable-vtysh=yes \ | |
43 | --enable-isisd=yes \ | |
44 | --enable-multipath=256 \ | |
45 | --enable-user=frr \ | |
46 | --enable-group=frr \ | |
47 | --enable-vty-group=frrvty \ | |
48 | --enable-configfile-mask=0640 \ | |
49 | --enable-logfile-mask=0640 \ | |
50 | --enable-werror \ | |
51 | --enable-gcc-rdynamic \ | |
52 | --with-libpam \ | |
53 | --enable-systemd=yes \ | |
54 | --enable-poll=yes \ | |
55 | --enable-cumulus=yes \ | |
56 | --enable-pimd=yes \ | |
57 | --enable-dependency-tracking \ | |
58 | --enable-bgp-vnc=no; \ | |
59 | fi | |
60 | ||
61 | override_dh_auto_build: | |
62 | #dh_auto_build | |
63 | $(MAKE) | |
64 | dh_auto_build -- -C doc draft-zebra-00.txt | |
65 | ||
66 | ||
67 | # doc/ is a bit crazy | |
68 | ifeq ($(GENERATE_PDF), 1) | |
69 | dh_auto_build -- -C doc frr.pdf || true # pdfetex fails with exit code 1 but still produces a good looking .pdf | |
70 | endif | |
71 | rm -vf doc/frr.info | |
72 | dh_auto_build -- -C doc frr.info | |
73 | rm -vf doc/frr.info.html* | |
74 | ||
75 | override_dh_auto_test: | |
76 | ||
77 | override_dh_auto_install: | |
78 | dh_auto_install | |
79 | ||
80 | # cleaning up the info dir | |
81 | rm -f debian/tmp/usr/share/info/dir* | |
82 | ||
83 | # install config files | |
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* | |
86 | ||
87 | # installing the Frr specific SNMP MIB | |
88 | install -D -m 644 ./zebra/GNOME-PRODUCT-ZEBRA-MIB debian/tmp/usr/share/snmp/mibs/GNOME-PRODUCT-ZEBRA-MIB | |
89 | ||
90 | # cleaning .la files | |
91 | sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/*.la | |
92 | ||
93 | override_dh_systemd_start: | |
94 | dh_systemd_start frr.service | |
95 | ||
96 | override_dh_systemd_enable: | |
97 | dh_systemd_enable frr.service | |
98 | ||
c395cd15 SM |
99 | # backports |
100 | SRCPKG = frr | |
101 | KNOWN_BACKPORTS = ubuntu12.04 ubuntu14.04 ubuntu16.04 | |
102 | ORIG_VERSION := $(shell dh_testdir && grep -E < configure.ac '^AC_INIT\(.*\)' \ | |
103 | | cut -d, -f2 | xargs echo) | |
104 | DEBIAN_VERSION := $(shell dh_testdir && \ | |
4472c4fb SM |
105 | dpkg-parsechangelog -c1 < debian/changelog | \ |
106 | sed -rn 's/^Version: ?//p') | |
c395cd15 SM |
107 | -include debian/backports/rules |
108 | ||
109 | ifneq ($(TARBALLDIR),) | |
110 | # better error message on missing .orig.tar.gz | |
111 | $(TARBALLDIR)/$(SRCPKG)_$(ORIG_VERSION).orig.tar.gz: | |
4472c4fb | 112 | @ echo "\`$(TARBALLDIR)/$(SRCPKG)_$(ORIG_VERSION).orig.tar.gz'" not \ |
c395cd15 SM |
113 | found and not generated by debian/rules. Provided you have the \ |
114 | necessary packages installed, you can generate it yourself via \ | |
115 | "\"./bootstrap.sh && ./configure && make dist\"" \ | |
116 | and renaming the resulting file. | |
117 | exit 1 | |
118 | endif # def TARBALLDIR |