]> git.saurik.com Git - apt.git/blob - debian/rules
Add some more symbols to libapt-pkg5.0.symbols
[apt.git] / debian / rules
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
7 export NOISY=1
8
9 export DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
10 export DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
11 export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
12 export PARALLEL = $(or $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))),1)
13
14 # FOR AUTOCONF 2.52 AND NEWER ONLY
15 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
16 confflags += --build $(DEB_HOST_GNU_TYPE)
17 else
18 confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
19 endif
20
21 # Set the number of procs to be run in parallel from the options.
22 confflags += --with-procs=$(PARALLEL)
23
24 # See below
25 -include build/environment.mak
26
27 ifneq (,$(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)
34 else
35 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
36 export CXXFLAGS = -O0 -g -Wall
37 else
38 export CXXFLAGS = -O2 -g -Wall
39 endif
40 endif
41
42 # Default rule
43 build:
44
45 # Determine the build directory to use
46 override BASE := .
47 override 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.
52 export ac_cv_header_gtest_gtest_h=yes
53
54 # APT Programs in apt-utils
55 APT_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
61 include buildlib/libversion.mak
62
63 # Determine which library package names to use
64 LIBAPT_PKG=libapt-pkg$(LIBAPTPKG_MAJOR)
65 LIBAPT_INST=libapt-inst$(LIBAPTINST_MAJOR)
66
67 # do not fail as we are just experimenting with symbol files for now
68 export DPKG_GENSYMBOLS_CHECK_LEVEL=0
69
70 build-binary: build/build-binary-stamp
71 build-docbook: build/build-docbook-stamp
72 build-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.
77 build/environment.mak: build/configure-stamp
78 @true
79
80 configure: configure.ac
81 build/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
88 build/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
95 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
96 $(MAKE) test
97 else
98 @echo "Tests DISABLED"
99 endif
100 touch $@
101
102 build/build-docbook-stamp: build/configure-stamp
103 # Add here commands to compile the package.
104 $(MAKE) docbook
105 touch $@
106
107 build/build-manpages-stamp: build/configure-stamp
108 # Add here commands to compile the package.
109 $(MAKE) manpages
110 touch $@
111
112 clean:
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
123 debian/%.install: debian/%.install.in
124 sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@
125
126 # Build architecture-independent files here.
127 libapt-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
148 apt-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
169 apt_MANPAGES = apt apt-cache apt-cdrom apt-config apt-get apt-key apt-mark apt-secure apt apt.conf apt_preferences sources.list
170 apt: 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)
193
194 # https has its own package
195 rm debian/$@/usr/lib/apt/methods/https
196
197 # move the mirror failure script in place
198 #mv debian/$@/usr/bin/apt-report-mirror-failure \
199 # debian/$@/usr/lib/apt/apt-report-mirror-failure \
200
201 # move the apt-helper in place
202 mv debian/$@/usr/bin/apt-helper debian/$@/usr/lib/apt/apt-helper
203 # install apt.systemd.daily helper in the right place
204 install -m755 debian/apt.systemd.daily debian/$@/usr/lib/apt/
205
206 dh_bugfiles -p$@
207 dh_lintian -p$@
208 dh_installexamples -p$@
209 dh_installman -p$@ $(wildcard $(patsubst %,doc/en/%.[158],$(apt_MANPAGES)) $(patsubst %,doc/*/%.*.[158],$(apt_MANPAGES)))
210 dh_installcron -p$@ --name=apt-compat
211 dh_systemd_enable -p$@ apt-daily.timer
212 dh_systemd_start -p$@ apt-daily.timer
213 dh_installdocs -p$@
214 dh_installchangelogs -p$@
215 dh_installlogrotate -p$@
216 dh_strip -p$@
217 dh_compress -p$@
218 dh_fixperms -p$@
219 dh_makeshlibs -p$@
220 dh_installdeb -p$@
221 dh_shlibdeps -p$@
222 dh_gencontrol -p$@ -- -Vapt:keyring="$(shell ./vendor/getinfo keyring-package)"
223 dh_md5sums -p$@
224 dh_builddeb -p$@
225
226 libapt-pkg-dev: build-binary debian/libapt-pkg-dev.install
227 dh_testdir -p$@
228 dh_testroot -p$@
229 dh_prep -p$@
230 dh_installdirs -p$@
231 #
232 # libapt-pkg-dev install
233 #
234 dh_install -p$@ --sourcedir=$(BLD)
235 dh_installdocs -p$@
236 dh_installchangelogs -p$@
237 dh_strip -p$@
238 dh_compress -p$@
239 dh_fixperms -p$@
240 dh_installdeb -p$@
241 dh_gencontrol -p$@ -- -Vlibapt-pkg-name=$(LIBAPT_PKG) -Vlibapt-inst-name=$(LIBAPT_INST)
242 dh_md5sums -p$@
243 dh_builddeb -p$@
244
245 apt-utils_MANPAGES = apt-sortpkgs apt-ftparchive apt-extracttemplates
246 apt-utils: build-binary build-manpages
247 dh_testdir -p$@
248 dh_testroot -p$@
249 dh_prep -p$@
250 dh_installdirs -p$@
251
252 cp $(addprefix $(BLD)/bin/apt-,$(APT_UTILS)) debian/$@/usr/bin/
253 cp $(BLD)/bin/apt-dump-solver debian/$@/usr/lib/apt/solvers/dump
254 cp $(BLD)/bin/apt-internal-solver debian/$@/usr/lib/apt/solvers/apt
255
256 dh_install -p$@ --sourcedir=$(BLD)
257 dh_link -p$@
258 dh_installdocs -p$@
259 dh_installexamples -p$@
260
261 # Install the man pages..
262 dh_installman -p$@ $(wildcard $(patsubst %,doc/en/%.[158],$(apt-utils_MANPAGES)) $(patsubst %,doc/*/%.*.[158],$(apt-utils_MANPAGES)))
263
264 dh_installchangelogs -p$@
265 dh_strip -p$@
266 dh_compress -p$@
267 dh_fixperms -p$@
268 dh_makeshlibs -p$@
269 dh_installdeb -p$@
270 dh_shlibdeps -p$@
271 dh_gencontrol -p$@
272 dh_md5sums -p$@
273 dh_builddeb -p$@
274
275 $(LIBAPT_PKG): build-binary debian/$(LIBAPT_PKG).install
276 dh_testdir -p$@
277 dh_testroot -p$@
278 dh_prep -p$@
279 dh_installdirs -p$@
280
281 dh_install -p$@ --sourcedir=$(BLD)
282 dh_installdocs -p$@
283 dh_installchangelogs -p$@
284 dh_strip -p$@
285 dh_compress -p$@
286 dh_fixperms -p$@
287 dh_makeshlibs -p$@
288 dh_installdeb -p$@
289 dh_shlibdeps -p$@
290 dh_gencontrol -p$@
291 dh_md5sums -p$@
292 dh_builddeb -p$@
293
294 $(LIBAPT_INST): build-binary debian/$(LIBAPT_INST).install
295 dh_testdir -p$@
296 dh_testroot -p$@
297 dh_prep -p$@
298 dh_installdirs -p$@
299
300 dh_install -p$@ --sourcedir=$(BLD)
301 dh_installdocs -p$@
302 dh_installchangelogs -p$@
303 dh_strip -p$@
304 dh_compress -p$@
305 dh_fixperms -p$@
306 dh_makeshlibs -p$@
307 dh_installdeb -p$@
308 dh_shlibdeps -p$@
309 dh_gencontrol -p$@
310 dh_md5sums -p$@
311 dh_builddeb -p$@
312
313 apt-transport-https: build-binary libapt-pkg-dev
314 dh_testdir -p$@
315 dh_testroot -p$@
316 dh_prep -p$@
317 dh_installdirs -p$@
318
319 dh_install -p$@ --sourcedir=$(BLD)
320 dh_installdocs -p$@
321 dh_installexamples -p$@
322
323 # Install the man pages..
324 dh_installman -p$@
325
326 dh_installchangelogs -p$@
327 dh_strip -p$@
328 dh_compress -p$@
329 dh_fixperms -p$@
330 dh_installdeb -p$@
331 dh_shlibdeps -p$@
332 dh_gencontrol -p$@
333 dh_md5sums -p$@
334 dh_builddeb -p$@
335
336 buildlib/config.guess buildlib/config.sub:
337 $(MAKE) "$@"
338
339 configure:
340 $(MAKE) configure
341
342 # translate targets to targets required by debian-policy
343 binary-arch: $(LIBAPT_PKG) $(LIBAPT_INST) apt libapt-pkg-dev apt-utils apt-transport-https
344 binary-indep: apt-doc libapt-pkg-doc
345 binary: binary-indep binary-arch
346 build-arch: build-binary
347 build-indep: build-manpages build-docbook
348 build: build-indep build-arch
349
350 .PHONY: build clean binary-indep binary-arch binary