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