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