]> git.saurik.com Git - apt.git/blob - debian/rules
prepare-release: declare the packages needed as source build deps.
[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
13 # FOR AUTOCONF 2.52 AND NEWER ONLY
14 ifeq ($(DEB_BUILD_GNU_TYPE), $(DEB_HOST_GNU_TYPE))
15 confflags += --build $(DEB_HOST_GNU_TYPE)
16 else
17 confflags += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
18 endif
19
20 # See below
21 -include build/environment.mak
22
23 ifneq (,$(shell which dpkg-buildflags))
24 export CXXFLAGS = $(shell dpkg-buildflags --get CXXFLAGS)
25 export LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
26 export CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
27 else
28 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
29 export CXXFLAGS = -O0 -g -Wall
30 else
31 export CXXFLAGS = -O2 -g -Wall
32 endif
33 endif
34
35 # Default rule
36 build:
37
38 PKG=apt
39 DEB_BUILD_PROG:=debuild --preserve-envvar PATH --preserve-envvar CCACHE_DIR -us -uc $(DEB_BUILD_PROG_OPTS)
40
41 # Determine the build directory to use
42 BASE=.
43 ifdef BUILD
44 BUILD_POSSIBLE := $(BUILD) $(BASE)/$(BUILD)
45 else
46 BUILD_POSSIBLE := $(BASE) $(BASE)/build-$(shell uname --machine) $(BASE)/build
47 endif
48 BUILDX:= $(foreach i,$(BUILD_POSSIBLE),$(wildcard $(i)/environment.mak*))
49 BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX))))
50 override BLD := $(BUILDX)
51
52 ifeq ($(words $(BLD)),0)
53 override BLD := ./build
54 endif
55
56 # APT Programs in apt-utils
57 APT_UTILS=ftparchive sortpkgs extracttemplates
58
59 # Uncomment this to turn on verbose mode.
60 #export DH_VERBOSE=1
61
62 # Find the libapt-pkg major version for use in other control files
63 include buildlib/libversion.mak
64
65 # Determine which library package names to use
66 LIBAPT_PKG=libapt-pkg$(LIBAPTPKG_MAJOR)
67 LIBAPT_INST=libapt-inst$(LIBAPTINST_MAJOR)
68
69 # do not fail as we are just experimenting with symbol files for now
70 export DPKG_GENSYMBOLS_CHECK_LEVEL=0
71
72 build: build/build-stamp
73 build-doc: build-manpages build/build-doc-stamp
74 build-manpages: build/build-manpages-stamp
75
76 # Note that this is unconditionally done first as part of loading environment.mak
77 # The true is needed to force make to reload environment.mak after running
78 # configure-stamp. Otherwise we can get stale or invalid, or missing config data.
79 build/environment.mak: build/configure-stamp
80 @true
81
82 configure: configure.in
83 build/configure-stamp: configure
84 dh_testdir
85 -mkdir build
86 cp COPYING debian/copyright
87 cd build && CXXFLAGS="$(CXXFLAGS)" LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)" ../configure $(confflags)
88 touch $@
89
90 build/build-stamp: build/configure-stamp
91 # Add here commands to compile the package.
92 $(MAKE) binary
93 # compat symlink for the locale split
94 mkdir -p build/usr/share
95 cd build/usr/share && ln -f -s ../../locale .
96 # compile and run tests
97 ifeq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS)))
98 $(MAKE) test
99 else
100 @echo "Tests DISABLED"
101 endif
102 touch $@
103
104 build/build-doc-stamp: build/build-manpages-stamp build/configure-stamp
105 # Add here commands to compile the package.
106 $(MAKE) doc
107 touch $@
108
109 build/build-manpages-stamp: build/configure-stamp
110 # Add here commands to compile the package.
111 $(MAKE) manpages
112 touch $@
113
114 clean:
115 dh_testdir
116
117 [ ! -f Makefile ] || $(MAKE) clean distclean
118 rm -rf build
119 rm -f debian/$(LIBAPT_PKG).install debian/$(LIBAPT_INST).install \
120 debian/libapt-pkg-dev.install
121
122 debian/%.install: debian/%.install.in
123 sed 's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@
124
125 binary-indep: apt-doc libapt-pkg-doc
126 # Build architecture-independent files here.
127 libapt-pkg-doc: build-doc
128 dh_testdir -p$@
129 dh_testroot -p$@
130 dh_prep -p$@
131 dh_installdirs -p$@
132 #
133 # libapt-pkg-doc install
134 #
135 dh_installdocs -p$@ $(BLD)/docs/design* \
136 $(BLD)/docs/dpkg-tech* \
137 $(BLD)/docs/files* \
138 $(BLD)/docs/method* \
139 doc/libapt-pkg2_to_3.txt \
140 doc/style.txt \
141 $(BLD)/doc/doxygen/html
142 dh_installexamples -p$@
143
144 dh_installchangelogs -p$@
145 dh_strip -p$@
146 dh_compress -p$@
147 dh_fixperms -p$@
148 dh_installdeb -p$@
149 dh_gencontrol -p$@
150 dh_md5sums -p$@
151 dh_builddeb -p$@
152
153 apt-doc: build-doc
154 dh_testdir -p$@
155 dh_testroot -p$@
156 dh_prep -p$@
157 #
158 # apt-doc install
159 #
160 # Copy the guides
161 dh_installdocs -p$@ $(BLD)/docs/guide*.text \
162 $(BLD)/docs/guide*.html \
163 $(BLD)/docs/offline*.text \
164 $(BLD)/docs/offline*.html
165 dh_installchangelogs -p$@
166 dh_compress -p$@
167 dh_fixperms -p$@
168 dh_installdeb -p$@
169 dh_gencontrol -p$@
170 dh_md5sums -p$@
171 dh_builddeb -p$@
172
173
174
175 # Build architecture-dependent files here.
176
177 binary-arch: $(LIBAPT_PKG) $(LIBAPT_INST) apt libapt-pkg-dev apt-utils apt-transport-https
178 apt_MANPAGES = apt-cache apt-cdrom apt-config apt-get apt-key apt-mark apt-secure apt apt.conf apt_preferences sources.list
179 apt: build build-manpages
180 dh_testdir -p$@
181 dh_testroot -p$@
182 dh_prep -p$@
183 dh_installdirs -p$@
184 #
185 # apt install
186 #
187 cp debian/apt.conf.autoremove debian/$@/etc/apt/apt.conf.d/01autoremove
188 cp debian/apt.conf.changelog debian/$@/etc/apt/apt.conf.d/20changelog
189 cp share/ubuntu-archive.gpg debian/$@/usr/share/$@
190
191 # make rosetta happy and remove pot files in po/ (but leave stuff
192 # in po/domains/* untouched) and cp *.po into each domain dir
193 rm -f build/po/*.pot
194 rm -f po/*.pot
195
196 dh_install -p$@ --sourcedir=$(BLD)
197
198 # Remove the bits that are in apt-utils
199 rm $(addprefix debian/$@/usr/bin/apt-,$(APT_UTILS) dump-solver internal-solver)
200
201 # https has its own package
202 rm debian/$@/usr/lib/apt/methods/https
203
204 # move the mirror failure script in place
205 #mv debian/$@/usr/bin/apt-report-mirror-failure \
206 # debian/$@/usr/lib/apt/apt-report-mirror-failure \
207
208 dh_bugfiles -p$@
209 dh_lintian -p$@
210 dh_installexamples -p$@ $(BLD)/docs/examples/*
211 dh_installman -p$@ $(wildcard $(patsubst %,doc/%.[158],$(apt_MANPAGES)) $(patsubst %,doc/*/%.*.[158],$(apt_MANPAGES)))
212 dh_installcron -p$@
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_installdeb -p$@
220 dh_shlibdeps -p$@
221 dh_gencontrol -p$@
222 dh_md5sums -p$@
223 dh_builddeb -p$@
224
225 libapt-pkg-dev: build debian/libapt-pkg-dev.install
226 dh_testdir -p$@
227 dh_testroot -p$@
228 dh_prep -p$@
229 dh_installdirs -p$@
230 #
231 # libapt-pkg-dev install
232 #
233 dh_install -p$@ --sourcedir=$(BLD)
234 dh_installdocs -p$@
235 dh_installchangelogs -p$@
236 dh_strip -p$@
237 dh_compress -p$@
238 dh_fixperms -p$@
239 dh_installdeb -p$@
240 dh_gencontrol -p$@ -- -Vlibapt-pkg-name=$(LIBAPT_PKG) -Vlibapt-inst-name=$(LIBAPT_INST)
241 dh_md5sums -p$@
242 dh_builddeb -p$@
243
244 apt-utils_MANPAGES = apt-sortpkgs apt-ftparchive apt-extracttemplates
245 apt-utils: build build-manpages
246 dh_testdir -p$@
247 dh_testroot -p$@
248 dh_prep -p$@
249 dh_installdirs -p$@
250
251 cp $(addprefix $(BLD)/bin/apt-,$(APT_UTILS)) debian/$@/usr/bin/
252 cp $(BLD)/bin/apt-dump-solver debian/$@/usr/lib/apt/solvers/dump
253 cp $(BLD)/bin/apt-internal-solver debian/$@/usr/lib/apt/solvers/apt
254
255 dh_install -p$@ --sourcedir=$(BLD)
256 dh_link -p$@
257 dh_installdocs -p$@
258 dh_installexamples -p$@
259
260 # Install the man pages..
261 dh_installman -p$@ $(wildcard $(patsubst %,doc/%.[158],$(apt-utils_MANPAGES)) $(patsubst %,doc/*/%.*.[158],$(apt-utils_MANPAGES)))
262
263 dh_installchangelogs -p$@
264 dh_strip -p$@
265 dh_compress -p$@
266 dh_fixperms -p$@
267 dh_makeshlibs -p$@
268 dh_installdeb -p$@
269 dh_shlibdeps -p$@
270 dh_gencontrol -p$@
271 dh_md5sums -p$@
272 dh_builddeb -p$@
273
274 $(LIBAPT_PKG): build debian/$(LIBAPT_PKG).install
275 dh_testdir -p$@
276 dh_testroot -p$@
277 dh_prep -p$@
278 dh_installdirs -p$@
279
280 dh_install -p$@ --sourcedir=$(BLD)
281 dh_installdocs -p$@
282 dh_installchangelogs -p$@
283 dh_strip -p$@
284 dh_compress -p$@
285 dh_fixperms -p$@
286 dh_makeshlibs -p$@
287 dh_installdeb -p$@
288 dh_shlibdeps -p$@
289 dh_gencontrol -p$@
290 dh_md5sums -p$@
291 dh_builddeb -p$@
292
293 $(LIBAPT_INST): build debian/$(LIBAPT_INST).install
294 dh_testdir -p$@
295 dh_testroot -p$@
296 dh_prep -p$@
297 dh_installdirs -p$@
298
299 dh_install -p$@ --sourcedir=$(BLD)
300 dh_installdocs -p$@
301 dh_installchangelogs -p$@
302 dh_strip -p$@
303 dh_compress -p$@
304 dh_fixperms -p$@
305 dh_makeshlibs -p$@
306 dh_installdeb -p$@
307 dh_shlibdeps -p$@
308 dh_gencontrol -p$@
309 dh_md5sums -p$@
310 dh_builddeb -p$@
311
312 apt-transport-https: build libapt-pkg-dev
313 dh_testdir -p$@
314 dh_testroot -p$@
315 dh_prep -p$@
316 dh_installdirs -p$@
317
318 dh_install -p$@ --sourcedir=$(BLD)
319 dh_installdocs -p$@ debian/apt-transport-https.README
320 dh_installexamples -p$@
321
322 # Install the man pages..
323 dh_installman -p$@
324
325 dh_installchangelogs -p$@
326 dh_strip -p$@
327 dh_compress -p$@
328 dh_fixperms -p$@
329 dh_installdeb -p$@
330 dh_shlibdeps -p$@
331 dh_gencontrol -p$@
332 dh_md5sums -p$@
333 dh_builddeb -p$@
334
335 configure:
336 $(MAKE) configure
337
338 really-clean: clean
339 -find . -name Makefile.in -print0 | xargs --null --no-run-if-empty -- rm -f
340 find -name ChangeLog | xargs rm -f
341 rm -f l33ch-stamp
342
343 binary: binary-indep binary-arch
344 .PHONY: build clean binary-indep binary-arch binary