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