]> git.proxmox.com Git - mirror_frr.git/blob - debianpkg/backports/ubuntu12.04/debian/rules
Merge pull request #1434 from dslicenc/zebra-nexthop-cm8192
[mirror_frr.git] / debianpkg / backports / ubuntu12.04 / debian / rules
1 #!/usr/bin/make -f
2
3 # FRRouting Configuration options
4 ######################################
5 #
6 # WANT_xxxx --> Set to 1 for enable, 0 for disable
7 # The following are the defaults. They can be overridden by setting a
8 # env variable to a different value
9 #
10 # export WANT_LDP=1
11 # export WANT_PIM=1
12 # export WANT_OSPFAPI=1
13 # export WANT_TCP_ZEBRA=0
14 # export WANT_BGP_VNC=0
15 # export WANT_CUMULUS_MODE=0
16 # export WANT_MULTIPATH=1
17 #
18 # If multipath is enabled (WANT_MULTIPATH=1), then set number of multipaths here
19 # Please be aware that 0 is NOT disabled, but treated as unlimited
20 # export MULTIPATH=256
21 #
22 # Set the following to the value required (or leave undefined for the default below)
23 # WANT_FRR_USER is used for the username and groupname of the FRR user account
24 # export WANT_FRR_USER=frr
25 # export WANT_FRR_VTY_GROUP=frrvty
26 #
27 ####################################
28
29 export DH_VERBOSE=1
30 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
31 export DH_OPTIONS=-v
32
33 ifeq ($(WANT_SNMP), 1)
34 USE_SNMP=--enable-snmp
35 $(warning "DEBIAN: SNMP enabled, sorry for your inconvenience")
36 else
37 $(warning "DEBIAN: SNMP disabled, see README.Debian")
38 endif
39
40 ifneq ($(WANT_LDP), 0)
41 USE_LDP=--enable-ldpd
42 else
43 USE_LDP=--disable-ldpd
44 endif
45
46 ifneq ($(WANT_PIM), 0)
47 USE_PIM=--enable-pimd
48 else
49 USE_PIM=--disable-pimd
50 endif
51
52 ifneq ($(WANT_OSPFAPI), 0)
53 USE_OSPFAPI=--enable-ospfapi=yes
54 else
55 USE_OSPFAPI=--enable-ospfapi=no
56 endif
57
58 ifeq ($(WANT_TCP_ZEBRA),1)
59 USE_TCP_ZEBRA=--enable-tcp-zebra
60 endif
61
62 ifneq ($(WANT_BGP_VNC), 0)
63 USE_BGP_VNC=--enable-bgp-vnc=yes
64 else
65 USE_BGP_VNC=--enable-bgp-vnc=no
66 endif
67
68 ifndef WANT_FRR_USER
69 USE_FRR_USER=--enable-user=frr
70 USE_FRR_GROUP=--enable-group=frr
71 else
72 USE_FRR_USER=$(WANT_FRR_USER)
73 USE_FRR_GROUP=$(WANT_FRR_USER)
74 endif
75
76 ifndef WANT_FRR_VTY_GROUP
77 USE_FRR_VTY_GROUP=--enable-vty-group=frrvty
78 else
79 USE_FRR_VTY_GROUP=--enable-vty-group=$(WANT_FRR_VTY_GROUP)
80 endif
81
82 ifneq ($(WANT_MULTIPATH), 0)
83 ifdef MULTIPATH
84 USE_MULTIPATH=--enable-multipath=$(MULTIPATH)
85 else
86 USE_MULTIPATH=--enable-multipath=256
87 endif
88 else
89 USE_MULTIPATH=--disable-multipath
90 endif
91
92 ifeq ($(WANT_CUMULUS_NODE), 1)
93 USE_CUMULUS=--enable-cumulus=yes
94 else
95 USE_CUMULUS=--enable-cumulus=no
96 endif
97
98 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
99 DEBIAN_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
100 endif
101
102 ifdef DEBIAN_JOBS
103 MAKEFLAGS += -j$(DEBIAN_JOBS)
104 endif
105
106 %:
107 dh $@ --with=autoreconf --parallel --dbg-package=frr-dbg --list-missing
108
109 override_dh_auto_configure:
110 # Frr needs /proc to check some BSD vs Linux specific stuff.
111 # Else it fails with an obscure error message pointing out that
112 # IPCTL_FORWARDING is an undefined symbol which is not very helpful.
113 @if ! [ -d /proc/1 ]; then \
114 echo "./configure needs a mounted /proc"; \
115 exit 1; \
116 fi
117
118 if ! [ -e config.status ]; then \
119 dh_auto_configure -- \
120 --enable-exampledir=/usr/share/doc/frr/examples/ \
121 --localstatedir=/var/run/frr \
122 --sbindir=/usr/lib/frr \
123 --sysconfdir=/etc/frr \
124 $(USE_SNMP) \
125 $(USE_OSPFAPI) \
126 $(USE_MULTIPATH) \
127 $(USE_LDP) \
128 $(USE_TCP_ZEBRA) \
129 --enable-fpm \
130 $(USE_FRR_USER) $(USE_FRR_GROUP) \
131 $(USE_FRR_VTY_GROUP) \
132 --enable-configfile-mask=0640 \
133 --enable-logfile-mask=0640 \
134 --with-libpam \
135 --enable-systemd=no \
136 --enable-poll=yes \
137 $(USE_CUMULUS) \
138 $(USE_PIM) \
139 --enable-dependency-tracking \
140 $(USE_BGP_VNC) \
141 $(shell dpkg-buildflags --export=configure); \
142 fi
143
144 override_dh_auto_build:
145 #dh_auto_build
146 $(MAKE)
147 dh_auto_build -- -C doc draft-zebra-00.txt
148
149
150 # doc/ is a bit crazy
151 ifeq ($(GENERATE_PDF), 1)
152 dh_auto_build -- -C doc frr.pdf || true # pdfetex fails with exit code 1 but still produces a good looking .pdf
153 endif
154 rm -vf doc/frr.info
155 dh_auto_build -- -C doc frr.info
156 rm -vf doc/frr.info.html*
157
158 override_dh_auto_test:
159
160 override_dh_auto_install:
161 dh_auto_install
162
163 # installed in frr-pythontools
164 rm debian/tmp/usr/lib/frr/frr-reload.py
165
166 # cleaning up the info dir
167 rm -f debian/tmp/usr/share/info/dir*
168
169 # install config files
170 mkdir -p debian/tmp/etc/frr/
171 perl -pi -e 's#^!log file #!log file /var/log/frr/#' debian/tmp/usr/share/doc/frr/examples/*sample*
172
173 # installing the Frr specific SNMP MIB
174 install -D -m 644 ./zebra/GNOME-PRODUCT-ZEBRA-MIB debian/tmp/usr/share/snmp/mibs/GNOME-PRODUCT-ZEBRA-MIB
175
176 # cleaning .la files
177 sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/*.la
178 sed -i "/dependency_libs/ s/'.*'/''/" debian/tmp/usr/lib/frr/modules/*.la
179