]> git.saurik.com Git - apt.git/blame_incremental - debian/rules
eipp: let apt make a plan, not make stuff plane
[apt.git] / debian / rules
... / ...
CommitLineData
1#!/usr/bin/make -f
2# Made with the aid of dh_make, by Craig Small
3# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
4# Some lines taken from debmake, by Christoph Lameter.
5
6# build in verbose mode by default to make it easy to diangose issues
7export NOISY=1
8
9export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
10export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
11export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
12export PARALLEL = $(or $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))),1)
13
14# FOR AUTOCONF 2.52 AND NEWER ONLY
15ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
16 confflags += --build $(DEB_HOST_GNU_TYPE)
17else
18 confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
19endif
20
21# Set the number of procs to be run in parallel from the options.
22confflags += --with-procs=$(PARALLEL)
23
24# See below
25-include build/environment.mak
26
27ifneq (,$(shell which dpkg-buildflags))
28 # make does not export to $(shell) so we need to workaround
29 # (http://savannah.gnu.org/bugs/?10593)
30 dpkg_buildflags = DEB_BUILD_MAINT_OPTIONS=hardening=+all dpkg-buildflags
31 export CXXFLAGS = $(shell $(dpkg_buildflags) --get CXXFLAGS)
32 export LDFLAGS = $(shell $(dpkg_buildflags) --get LDFLAGS)
33 export CPPFLAGS = $(shell $(dpkg_buildflags) --get CPPFLAGS)
34else
35 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
36 export CXXFLAGS = -O0 -g -Wall
37 else
38 export CXXFLAGS = -O2 -g -Wall
39 endif
40endif
41
42# Default rule
43build:
44
45# Determine the build directory to use
46override BASE := .
47override BLD := $(BASE)/build
48
49# When building without <nocheck>, the header is available and thus the test is
50# successful. When building with <nocheck>, the header is missing, but we still
51# pretend it to be available, because configure would fail otherwise.
52export ac_cv_header_gtest_gtest_h=yes
53
54# APT Programs in apt-utils
55APT_UTILS=ftparchive sortpkgs extracttemplates
56
57# Uncomment this to turn on verbose mode.
58#export DH_VERBOSE=1
59
60# Find the libapt-pkg major version for use in other control files
61include buildlib/libversion.mak
62
63# Determine which library package names to use
64LIBAPT_PKG=libapt-pkg$(LIBAPTPKG_MAJOR)
65LIBAPT_INST=libapt-inst$(LIBAPTINST_MAJOR)
66
67# do not fail as we are just experimenting with symbol files for now
68export DPKG_GENSYMBOLS_CHECK_LEVEL=0
69
70build-binary: build/build-binary-stamp
71build-docbook: build/build-docbook-stamp
72build-manpages: build/build-manpages-stamp
73
74# Note that this is unconditionally done first as part of loading environment.mak
75# The true is needed to force make to reload environment.mak after running
76# configure-stamp. Otherwise we can get stale or invalid, or missing config data.
77build/environment.mak: build/configure-stamp
78 @true
79
80configure: configure.ac
81build/configure-stamp: configure buildlib/config.sub buildlib/config.guess
82 dh_testdir
83 mkdir -p build
84 cp COPYING debian/copyright
85 cd build && CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" ../configure $(confflags)
86 touch $@
87
88build/build-binary-stamp: build/configure-stamp
89 # Add here commands to compile the package.
90 $(MAKE) binary
91 # compat symlink for the locale split
92 mkdir -p build/usr/share
93 cd build/usr/share && ln -f -s ../../locale .
94 # compile and run tests
95ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
96 $(MAKE) test
97else
98 @echo "Tests DISABLED"
99endif
100 touch $@
101
102build/build-docbook-stamp: build/configure-stamp
103 # Add here commands to compile the package.
104 $(MAKE) docbook
105 touch $@
106
107build/build-manpages-stamp: build/configure-stamp
108 # Add here commands to compile the package.
109 $(MAKE) manpages
110 touch $@
111
112clean:
113 dh_testdir
114 dh_clean
115
116 [ ! -f Makefile ] || $(MAKE) clean distclean
117 rm -rf build
118 rm -f debian/$(LIBAPT_PKG).install debian/$(LIBAPT_INST).install \
119 debian/libapt-pkg-dev.install debian/apt.install
120 test ! -L buildlib/config.guess || rm -f buildlib/config.guess
121 test ! -L buildlib/config.sub || rm -f buildlib/config.sub
122
123debian/%.install: debian/%.install.in
124 sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@
125
126# Build architecture-independent files here.
127libapt-pkg-doc: build-docbook
128 dh_testdir -p$@
129 dh_testroot -p$@
130 dh_prep -p$@
131 dh_installdirs -p$@
132#
133# libapt-pkg-doc install
134#
135 rm -f $(BLD)/doc/doxygen/html/*.map $(BLD)/doc/doxygen/html/*.md5
136 dh_installdocs -p$@
137 dh_installexamples -p$@
138 dh_lintian -p$@
139 dh_installchangelogs -p$@
140 dh_strip -p$@
141 dh_compress -p$@ -X.xhtml
142 dh_fixperms -p$@
143 dh_installdeb -p$@
144 dh_gencontrol -p$@
145 dh_md5sums -p$@
146 dh_builddeb -p$@
147
148apt-doc: build-docbook
149 dh_testdir -p$@
150 dh_testroot -p$@
151 dh_prep -p$@
152#
153# apt-doc install
154#
155 # Copy the guides
156 dh_installdocs -p$@
157 dh_installchangelogs -p$@
158 dh_compress -p$@
159 dh_fixperms -p$@
160 dh_installdeb -p$@
161 dh_gencontrol -p$@
162 dh_md5sums -p$@
163 dh_builddeb -p$@
164
165
166
167# Build architecture-dependent files here.
168
169apt_MANPAGES = apt apt-cache apt-cdrom apt-config apt-get apt-key apt-mark apt-secure apt apt.conf apt_preferences sources.list
170apt: build-binary build-manpages debian/apt.install
171 dh_testdir -p$@
172 dh_testroot -p$@
173 dh_prep -p$@
174 dh_installdirs -p$@
175#
176# apt install
177#
178 cp debian/apt.conf.autoremove debian/$@/etc/apt/apt.conf.d/01autoremove
179 cp debian/apt.auto-removal.sh debian/$@/etc/kernel/postinst.d/apt-auto-removal
180 chmod 755 debian/$@/etc/kernel/postinst.d/apt-auto-removal
181 # install vendor specific apt confs
182 find -L vendor/current -name 'apt.conf-*' | while read conf; do cp "$${conf}" "debian/$@/etc/apt/apt.conf.d/$${conf#*-}"; done
183
184 # make rosetta happy and remove pot files in po/ (but leave stuff
185 # in po/domains/* untouched) and cp *.po into each domain dir
186 rm -f build/po/*.pot
187 rm -f po/*.pot
188
189 dh_install -p$@ --sourcedir=$(BLD)
190
191 # Remove the bits that are in apt-utils
192 rm $(addprefix debian/$@/usr/bin/apt-,$(APT_UTILS) dump-solver internal-solver internal-planner)
193 cp $(BLD)/bin/apt-dump-solver debian/$@/usr/lib/apt/solvers/dump
194 ln -s ../solvers/dump debian/$@/usr/lib/apt/planners/dump
195
196 # https has its own package
197 rm debian/$@/usr/lib/apt/methods/https
198
199 # move the mirror failure script in place
200 #mv debian/$@/usr/bin/apt-report-mirror-failure \
201 # debian/$@/usr/lib/apt/apt-report-mirror-failure \
202
203 # move the apt-helper in place
204 mv debian/$@/usr/bin/apt-helper debian/$@/usr/lib/apt/apt-helper
205 # install apt.systemd.daily helper in the right place
206 install -m755 debian/apt.systemd.daily debian/$@/usr/lib/apt/
207
208 dh_bugfiles -p$@
209 dh_lintian -p$@
210 dh_installexamples -p$@
211 dh_installman -p$@ $(wildcard $(patsubst %,doc/en/%.[158],$(apt_MANPAGES)) $(patsubst %,doc/*/%.*.[158],$(apt_MANPAGES)))
212 dh_installcron -p$@ --name=apt-compat
213 dh_systemd_enable -p$@ apt-daily.timer
214 dh_systemd_start -p$@ apt-daily.timer
215 dh_installdocs -p$@
216 dh_installchangelogs -p$@
217 dh_installlogrotate -p$@
218 dh_strip -p$@
219 dh_compress -p$@
220 dh_fixperms -p$@
221 dh_makeshlibs -p$@
222 dh_installdeb -p$@
223 dh_shlibdeps -p$@
224 dh_gencontrol -p$@ -- -Vapt:keyring="$(shell ./vendor/getinfo keyring-package)"
225 dh_md5sums -p$@
226 dh_builddeb -p$@
227
228libapt-pkg-dev: build-binary debian/libapt-pkg-dev.install
229 dh_testdir -p$@
230 dh_testroot -p$@
231 dh_prep -p$@
232 dh_installdirs -p$@
233#
234# libapt-pkg-dev install
235#
236 dh_install -p$@ --sourcedir=$(BLD)
237 dh_installdocs -p$@
238 dh_installchangelogs -p$@
239 dh_strip -p$@
240 dh_compress -p$@
241 dh_fixperms -p$@
242 dh_installdeb -p$@
243 dh_gencontrol -p$@ -- -Vlibapt-pkg-name=$(LIBAPT_PKG) -Vlibapt-inst-name=$(LIBAPT_INST)
244 dh_md5sums -p$@
245 dh_builddeb -p$@
246
247apt-utils_MANPAGES = apt-sortpkgs apt-ftparchive apt-extracttemplates
248apt-utils: build-binary build-manpages
249 dh_testdir -p$@
250 dh_testroot -p$@
251 dh_prep -p$@
252 dh_installdirs -p$@
253
254 cp $(addprefix $(BLD)/bin/apt-,$(APT_UTILS)) debian/$@/usr/bin/
255 cp $(BLD)/bin/apt-internal-solver debian/$@/usr/lib/apt/solvers/apt
256 cp $(BLD)/bin/apt-internal-planner debian/$@/usr/lib/apt/planners/apt
257
258 dh_install -p$@ --sourcedir=$(BLD)
259 dh_link -p$@
260 dh_installdocs -p$@
261 dh_installexamples -p$@
262
263 # Install the man pages..
264 dh_installman -p$@ $(wildcard $(patsubst %,doc/en/%.[158],$(apt-utils_MANPAGES)) $(patsubst %,doc/*/%.*.[158],$(apt-utils_MANPAGES)))
265
266 dh_installchangelogs -p$@
267 dh_strip -p$@
268 dh_compress -p$@
269 dh_fixperms -p$@
270 dh_makeshlibs -p$@
271 dh_installdeb -p$@
272 dh_shlibdeps -p$@
273 dh_gencontrol -p$@
274 dh_md5sums -p$@
275 dh_builddeb -p$@
276
277$(LIBAPT_PKG): build-binary debian/$(LIBAPT_PKG).install
278 dh_testdir -p$@
279 dh_testroot -p$@
280 dh_prep -p$@
281 dh_installdirs -p$@
282
283 dh_install -p$@ --sourcedir=$(BLD)
284 dh_installdocs -p$@
285 dh_installchangelogs -p$@
286 dh_strip -p$@
287 dh_compress -p$@
288 dh_fixperms -p$@
289 dh_makeshlibs -p$@
290 dh_installdeb -p$@
291 dh_shlibdeps -p$@
292 dh_gencontrol -p$@
293 dh_md5sums -p$@
294 dh_builddeb -p$@
295
296$(LIBAPT_INST): build-binary debian/$(LIBAPT_INST).install
297 dh_testdir -p$@
298 dh_testroot -p$@
299 dh_prep -p$@
300 dh_installdirs -p$@
301
302 dh_install -p$@ --sourcedir=$(BLD)
303 dh_installdocs -p$@
304 dh_installchangelogs -p$@
305 dh_strip -p$@
306 dh_compress -p$@
307 dh_fixperms -p$@
308 dh_makeshlibs -p$@
309 dh_installdeb -p$@
310 dh_shlibdeps -p$@
311 dh_gencontrol -p$@
312 dh_md5sums -p$@
313 dh_builddeb -p$@
314
315apt-transport-https: build-binary libapt-pkg-dev
316 dh_testdir -p$@
317 dh_testroot -p$@
318 dh_prep -p$@
319 dh_installdirs -p$@
320
321 dh_install -p$@ --sourcedir=$(BLD)
322 dh_installdocs -p$@
323 dh_installexamples -p$@
324
325 # Install the man pages..
326 dh_installman -p$@
327
328 dh_installchangelogs -p$@
329 dh_strip -p$@
330 dh_compress -p$@
331 dh_fixperms -p$@
332 dh_installdeb -p$@
333 dh_shlibdeps -p$@
334 dh_gencontrol -p$@
335 dh_md5sums -p$@
336 dh_builddeb -p$@
337
338buildlib/config.guess buildlib/config.sub:
339 $(MAKE) "$@"
340
341configure:
342 $(MAKE) configure
343
344# translate targets to targets required by debian-policy
345binary-arch: $(LIBAPT_PKG) $(LIBAPT_INST) apt libapt-pkg-dev apt-utils apt-transport-https
346binary-indep: apt-doc libapt-pkg-doc
347binary: binary-indep binary-arch
348build-arch: build-binary
349build-indep: build-manpages build-docbook
350build: build-indep build-arch
351
352.PHONY: build clean binary-indep binary-arch binary