]> git.proxmox.com Git - mirror_frr.git/blob - debianpkg/rules
debianpkg: install libraries to /usr/lib64/frr
[mirror_frr.git] / debianpkg / 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 # -Werror - don't enable this unless you're doing a dev package build
11 WANT_WERROR ?= 0
12
13 WANT_OSPFAPI ?= 1
14 WANT_BGP_VNC ?= 1
15 WANT_CUMULUS_MODE ?= 0
16 WANT_MULTIPATH ?= 1
17
18 # NOTES:
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
21
22 MULTIPATH ?= 256
23
24 # Set the following to the value required (or leave alone for the default below)
25 # WANT_FRR_USER is used for the username and groupname of the FRR user account
26
27 WANT_FRR_USER ?= frr
28 WANT_FRR_VTY_GROUP ?= frrvty
29
30 # Don't build PDF docs by default
31 # add build deps: texlive-latex-base, texlive-generic-recommended
32 GENERATE_PDF ?= 0
33
34 #
35 ####################################
36
37 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
38
39 ifeq ($(WANT_OSPFAPI), 1)
40 USE_OSPFAPI=--enable-ospfapi=yes
41 else
42 USE_OSPFAPI=--enable-ospfapi=no
43 endif
44
45 ifeq ($(WANT_BGP_VNC), 1)
46 USE_BGP_VNC=--enable-bgp-vnc=yes
47 else
48 USE_BGP_VNC=--enable-bgp-vnc=no
49 endif
50
51 USE_FRR_USER=--enable-user=$(WANT_FRR_USER)
52 USE_FRR_GROUP=--enable-group=$(WANT_FRR_USER)
53 USE_FRR_VTY_GROUP=--enable-vty-group=$(WANT_FRR_VTY_GROUP)
54
55 ifeq ($(WANT_MULTIPATH), 1)
56 USE_MULTIPATH=--enable-multipath=$(MULTIPATH)
57 else
58 USE_MULTIPATH=--disable-multipath
59 endif
60
61 ifeq ($(WANT_CUMULUS_MODE), 1)
62 USE_CUMULUS=--enable-cumulus=yes
63 else
64 USE_CUMULUS=--enable-cumulus=no
65 endif
66
67 ifeq ($(WANT_WERROR), 1)
68 USE_WERROR=--enable-werror
69 else
70 USE_WERROR=--disable-werror
71 endif
72
73 #
74 # generic debian options
75 #
76
77 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
78 DEBIAN_JOBS := $(subst parallel=,,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
79 endif
80 ifdef DEBIAN_JOBS
81 MAKEFLAGS += -j$(DEBIAN_JOBS)
82 endif
83
84 ifneq (,$(filter terse,$(DEB_BUILD_OPTIONS)))
85 MAKE_SILENT="V=0"
86 export DH_VERBOSE=0
87 else
88 MAKE_SILENT="V=1"
89 export DH_VERBOSE=1
90 export DH_OPTIONS=-v
91 endif
92
93 #
94 # build profiles
95 #
96
97 ifeq ($(filter nodoc,$(DEB_BUILD_PROFILES)),)
98 USE_DOC=--enable-doc --enable-doc-html
99 else
100 USE_DOC=--disable-doc
101 endif
102
103 ifeq ($(filter pkg.frr.rtrlib,$(DEB_BUILD_PROFILES)),)
104 USE_RPKI=--disable-rpki
105 else
106 USE_RPKI=--enable-rpki
107 endif
108
109 ifeq ($(filter pkg.frr.snmp,$(DEB_BUILD_PROFILES)),)
110 USE_SNMP=--disable-snmp
111 else
112 USE_SNMP=--enable-snmp
113 endif
114
115 ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),)
116 DH_WITH_SYSTEMD=systemd,
117 USE_SYSTEMD=--enable-systemd=yes
118 else
119 DH_WITH_SYSTEMD=
120 USE_SYSTEMD=--enable-systemd=no
121 endif
122
123 export PYTHON=python3
124
125 %:
126 dh $@ --with=$(DH_WITH_SYSTEMD)autoreconf --parallel --dbg-package=frr-dbg
127
128 override_dh_auto_configure:
129 if ! [ -e config.status ]; then \
130 dh_auto_configure -- \
131 --enable-exampledir=/usr/share/doc/frr/examples/ \
132 --localstatedir=/var/run/frr \
133 --sbindir=/usr/lib/frr \
134 --sysconfdir=/etc/frr \
135 --with-vtysh-pager=/usr/bin/pager \
136 --libdir=/usr/lib/$(DEB_HOST_MULTIARCH)/frr \
137 --with-moduledir=/usr/lib/$(DEB_HOST_MULTIARCH)/frr/modules \
138 LIBTOOLFLAGS="-rpath /usr/lib/$(DEB_HOST_MULTIARCH)/frr" \
139 $(USE_DOC) \
140 $(USE_SNMP) \
141 $(USE_OSPFAPI) \
142 $(USE_MULTIPATH) \
143 --disable-fpm \
144 --disable-zeromq \
145 $(USE_FRR_USER) $(USE_FRR_GROUP) \
146 $(USE_FRR_VTY_GROUP) \
147 --enable-configfile-mask=0640 \
148 --enable-logfile-mask=0640 \
149 $(USE_WERROR) \
150 --with-libpam \
151 $(USE_SYSTEMD) \
152 $(USE_CUMULUS) \
153 --disable-dependency-tracking \
154 $(USE_BGP_VNC) \
155 $(USE_RPKI) \
156 $(shell dpkg-buildflags --export=configure); \
157 fi
158
159 override_dh_auto_install:
160 dh_auto_install
161
162 sed -e '1c #!/usr/bin/python3' -i debian/tmp/usr/lib/frr/frr-reload.py
163
164 # let dh_systemd_* and dh_installinit do their thing automatically
165 ifeq ($(filter pkg.frr.nosystemd,$(DEB_BUILD_PROFILES)),)
166 cp tools/frr.service debian/frr.service
167 endif
168 cp tools/frr debian/frr.init
169
170 # install config files
171 mkdir -p debian/tmp/etc/frr/
172 perl -pi -e 's#^!log file #!log file /var/log/frr/#' debian/tmp/usr/share/doc/frr/examples/*sample*
173
174 # drop dev-only files
175 find debian/tmp -name '*.la' -o -name '*.a' -o -name 'lib*.so' | xargs rm -f
176 rm -rf debian/tmp/usr/include
177
178 # use installed js libraries
179 -rm -f debian/tmp/usr/share/doc/frr/html/_static/jquery.js
180 ln -s /usr/share/javascript/jquery/jquery.js debian/tmp/usr/share/doc/frr/html/_static/jquery.js
181 -rm -f debian/tmp/usr/share/doc/frr/html/_static/underscore.js
182 ln -s /usr/share/javascript/underscore/underscore.js debian/tmp/usr/share/doc/frr/html/_static/underscore.js
183
184 override_dh_auto_build:
185 dh_auto_build -- $(MAKE_SILENT)
186
187 override_dh_makeshlibs:
188 # we don't need or want ldconfig for private libs
189 dh_makeshlibs -n
190
191 override_dh_missing:
192 dh_missing --fail-missing
193
194 override_dh_auto_clean:
195 # we generally do NOT want a full distclean since that wipes both
196 # debianpkg/changelog and config.version
197 if test -f Makefile; then make redistclean; fi