]> git.proxmox.com Git - mirror_frr.git/blob - debian/rules.orig
debian: structure for building backports from a single branch
[mirror_frr.git] / debian / rules.orig
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