]> git.proxmox.com Git - mirror_frr.git/blob - debian/rules
zebra: add hooks upon enabling / disabling a VRF
[mirror_frr.git] / debian / rules
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 %:
15 dh $@ --parallel --with autoreconf --dbg-package=quagga-dbg --list-missing
16 if [ -e config.status ]; then \
17 dh $@ --parallel --dbg-package=quagga-dbg --list-missing; \
18 else \
19 dh $@ --parallel --with autoreconf --dbg-package=quagga-dbg --list-missing; \
20 fi
21
22 override_dh_auto_clean:
23 #dh_auto_clean
24
25 #@echo "BEGIN CRUFT"
26 #@rm -vf */Makefile doc/quagga.fns doc/quagga.info doc/quagga.kys doc/quagga.tmp doc/quagga.pdf doc/quagga.info-*
27 #@rm -vf lib/version.c doc/stamp-vti
28 #@rm -vf vtysh/vtysh_cmd.c
29 #@rm -vf doc/fig*.pdf doc/version.texi
30 #@echo "END CRUFT"
31
32 # why?
33 #@if [ -e config.log ]; then echo "CONFIG.LOG STILL THERE"; rm config.log; fi
34
35 override_dh_auto_configure:
36 # Quagga needs /proc to check some BSD vs Linux specific stuff.
37 # Else it fails with an obscure error message pointing out that
38 # IPCTL_FORWARDING is an undefined symbol which is not very helpful.
39 @if ! [ -d /proc/1 ]; then \
40 echo "./configure needs a mounted /proc"; \
41 exit 1; \
42 fi
43
44 if ! [ -e config.status ]; then \
45 dh_auto_configure -- \
46 --enable-exampledir=/usr/share/doc/quagga/examples/ \
47 --localstatedir=/var/run/quagga \
48 --sbindir=/usr/lib/quagga \
49 --sysconfdir=/etc/quagga \
50 $(USE_SNMP) \
51 --enable-vtysh \
52 --enable-isisd \
53 --enable-watchquagga \
54 --enable-ospf-te \
55 --enable-opaque-lsa \
56 --enable-ipv6 \
57 --enable-ospfclient=yes \
58 --enable-ospfapi=yes \
59 --enable-multipath=64 \
60 --enable-user=quagga \
61 --enable-group=quagga \
62 --enable-vty-group=quaggavty \
63 --enable-configfile-mask=0640 \
64 --enable-logfile-mask=0640 \
65 --enable-rtadv \
66 --enable-werror \
67 --enable-gcc-rdynamic \
68 --with-libpam \
69 --enable-dependency-tracking; \
70 fi
71 if ! diff -b -IHAVE_SNMP -IHAVE_NETSNMP -IUCD_COMPAT -IGETIFADDR debian/my/config.h.reference config.h; then \
72 echo; \
73 echo "WARNING: Please compare with debian/my/config.h.reference"; \
74 echo; \
75 if [ "`hostname`" = "james" ]; then exit 1; fi; \
76 fi
77
78 override_dh_auto_build:
79 #dh_auto_build
80 $(MAKE)
81 dh_auto_build -- -C doc draft-zebra-00.txt
82
83
84 # doc/ is a bit crazy
85 ifeq ($(GENERATE_PDF), 1)
86 dh_auto_build -- -C doc quagga.pdf || true # pdfetex fails with exit code 1 but still produces a good looking .pdf
87 endif
88 rm -vf doc/quagga.info
89 dh_auto_build -- -C doc quagga.info
90 rm -vf doc/quagga.info.html*
91
92 override_dh_auto_test:
93
94 override_dh_auto_install:
95 dh_auto_install
96
97 # cleaning up the info dir
98 rm -f debian/tmp/usr/share/info/dir*
99
100 # install config files
101 mkdir -p debian/tmp/etc/quagga/
102 cp debian/my/debian.conf debian/tmp/etc/quagga/
103 cp debian/my/daemons debian/tmp/etc/quagga/
104 perl -pi -e 's#^!log file #!log file /var/log/quagga/#' debian/tmp/usr/share/doc/quagga/examples/*sample*
105
106 # installing the Quagga specific SNMP MIB
107 install -D -m 644 ./zebra/GNOME-PRODUCT-ZEBRA-MIB debian/tmp/usr/share/snmp/mibs/GNOME-PRODUCT-ZEBRA-MIB
108
109 # installing custom man page
110 cp debian/my/babeld.8 debian/tmp/usr/share/man/man8/quagga-babeld.8
111
112 # cleaning .la files
113 sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/*.la
114