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.
6 # build in verbose mode by default to make it easy to diangose issues
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)
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
)
18 confflags
+= --build
$(DEB_BUILD_GNU_TYPE
) --host
$(DEB_HOST_GNU_TYPE
)
21 # Set the number of procs to be run in parallel from the options.
22 confflags
+= --with-procs
=$(PARALLEL
)
25 -include build
/environment.mak
27 ifneq (,$(shell command
-v 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
)
35 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
36 export CXXFLAGS
= -O0
-g
-Wall
38 export CXXFLAGS
= -O2
-g
-Wall
46 DEB_BUILD_PROG
:=debuild
--preserve-envvar PATH
--preserve-envvar CCACHE_DIR
-us
-uc
$(DEB_BUILD_PROG_OPTS
)
48 # Determine the build directory to use
51 BUILD_POSSIBLE
:= $(BUILD
) $(BASE
)/$(BUILD
)
53 BUILD_POSSIBLE
:= $(BASE
) $(BASE
)/build-
$(shell uname
--machine
) $(BASE
)/build
55 BUILDX
:= $(foreach i
,$(BUILD_POSSIBLE
),$(wildcard $(i
)/environment.mak
*))
56 BUILDX
:= $(patsubst %/,%,$(firstword $(dir $(BUILDX
))))
57 override BLD
:= $(BUILDX
)
59 ifeq ($(words $(BLD
)),0)
60 override BLD
:= .
/build
63 # APT Programs in apt-utils
64 APT_UTILS
=ftparchive sortpkgs extracttemplates
66 # Uncomment this to turn on verbose mode.
69 # Find the libapt-pkg major version for use in other control files
70 include buildlib
/libversion.mak
72 # Determine which library package names to use
73 LIBAPT_PKG
=libapt-pkg
$(LIBAPTPKG_MAJOR
)
74 LIBAPT_INST
=libapt-inst
$(LIBAPTINST_MAJOR
)
76 # do not fail as we are just experimenting with symbol files for now
77 export DPKG_GENSYMBOLS_CHECK_LEVEL
=0
79 build-binary
: build
/build-binary-stamp
80 build-docbook
: build
/build-docbook-stamp
81 build-manpages
: build
/build-manpages-stamp
83 # Note that this is unconditionally done first as part of loading environment.mak
84 # The true is needed to force make to reload environment.mak after running
85 # configure-stamp. Otherwise we can get stale or invalid, or missing config data.
86 build
/environment.mak
: build
/configure-stamp
89 configure
: configure.ac
90 build
/configure-stamp
: configure buildlib
/config.sub buildlib
/config.guess
93 cp COPYING debian
/copyright
94 cd build
&& CXXFLAGS
="$(CXXFLAGS)" LDFLAGS
="$(LDFLAGS)" CPPFLAGS
="$(CPPFLAGS)" ..
/configure
$(confflags
)
97 build
/build-binary-stamp
: build
/configure-stamp
98 # Add here commands to compile the package.
100 # compat symlink for the locale split
101 mkdir
-p build
/usr
/share
102 cd build
/usr
/share
&& ln
-f
-s ..
/..
/locale .
103 # compile and run tests
104 ifeq (,$(findstring nocheck
, $(DEB_BUILD_OPTIONS
)))
107 @echo
"Tests DISABLED"
111 build
/build-docbook-stamp
: build
/configure-stamp
112 # Add here commands to compile the package.
116 build
/build-manpages-stamp
: build
/configure-stamp
117 # Add here commands to compile the package.
125 [ ! -f Makefile
] ||
$(MAKE
) clean distclean
127 rm -f debian
/$(LIBAPT_PKG
).
install debian
/$(LIBAPT_INST
).
install \
128 debian
/libapt-pkg-dev.
install debian
/apt.
install
129 test ! -L buildlib
/config.guess ||
rm -f buildlib
/config.guess
130 test ! -L buildlib
/config.sub ||
rm -f buildlib
/config.sub
132 debian
/%.
install: debian
/%.
install.in
133 sed
's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@
135 # Build architecture-independent files here.
136 libapt-pkg-doc
: build-docbook
142 # libapt-pkg-doc install
144 rm -f
$(BLD
)/doc
/doxygen
/html
/*.map
$(BLD
)/doc
/doxygen
/html
/*.md5
145 dh_installdocs
-p
$@
$(BLD
)/docs
/design
* \
146 $(BLD
)/docs
/dpkg-tech
* \
148 $(BLD
)/docs
/method
* \
149 doc
/libapt-pkg2_to_3.txt \
151 $(BLD
)/doc
/doxygen
/html
152 dh_installexamples
-p
$@
154 dh_installchangelogs
-p
$@
156 dh_compress
-p
$@
-X.xhtml
163 apt-doc
: build-docbook
171 dh_installdocs
-p
$@
$(BLD
)/docs
/guide
*.text \
172 $(BLD
)/docs
/guide
*.html \
173 $(BLD
)/docs
/offline
*.text \
174 $(BLD
)/docs
/offline
*.html
175 dh_installchangelogs
-p
$@
185 # Build architecture-dependent files here.
187 apt_MANPAGES
= apt apt-cache apt-cdrom apt-config apt-get apt-key apt-mark apt-secure apt apt.conf apt_preferences sources.list
188 apt
: build-binary build-manpages debian
/apt.
install
196 cp debian
/apt.conf.autoremove debian
/$@
/etc
/apt
/apt.conf.d
/01autoremove
197 cp debian
/apt.auto-removal.sh debian
/$@
/etc
/kernel
/postinst.d
/apt-auto-removal
198 chmod
755 debian
/$@
/etc
/kernel
/postinst.d
/apt-auto-removal
199 # install vendor specific apt confs
200 find
-L vendor
/current
-name
'apt.conf-*' | while read conf
; do cp
"$${conf}" "debian/$@/etc/apt/apt.conf.d/$${conf#*-}"; done
202 # make rosetta happy and remove pot files in po/ (but leave stuff
203 # in po/domains/* untouched) and cp *.po into each domain dir
207 dh_install
-p
$@
--sourcedir
=$(BLD
)
209 # Remove the bits that are in apt-utils
210 rm $(addprefix debian
/$@
/usr
/bin
/apt-
,$(APT_UTILS
) dump-solver internal-solver
)
212 # https has its own package
213 rm debian
/$@
/usr
/lib
/apt
/methods
/https
215 # move the mirror failure script in place
216 #mv debian/$@/usr/bin/apt-report-mirror-failure \
217 # debian/$@/usr/lib/apt/apt-report-mirror-failure \
219 # move the apt-helper in place
220 mv debian
/$@
/usr
/bin
/apt-helper debian
/$@
/usr
/lib
/apt
/apt-helper
224 dh_installexamples
-p
$@
$(BLD
)/docs
/examples
/*
225 dh_installman
-p
$@
$(wildcard $(patsubst %,doc
/en
/%.
[158],$(apt_MANPAGES
)) $(patsubst %,doc
/*/%.
*.
[158],$(apt_MANPAGES
)))
228 dh_installchangelogs
-p
$@
229 dh_installlogrotate
-p
$@
236 dh_gencontrol
-p
$@
-- -Vapt
:keyring
="$(shell ./vendor/getinfo keyring-package)"
240 libapt-pkg-dev
: build-binary debian
/libapt-pkg-dev.
install
246 # libapt-pkg-dev install
248 dh_install
-p
$@
--sourcedir
=$(BLD
)
250 dh_installchangelogs
-p
$@
255 dh_gencontrol
-p
$@
-- -Vlibapt-pkg-name
=$(LIBAPT_PKG
) -Vlibapt-inst-name
=$(LIBAPT_INST
)
259 apt-utils_MANPAGES
= apt-sortpkgs apt-ftparchive apt-extracttemplates
260 apt-utils
: build-binary build-manpages
266 cp
$(addprefix $(BLD
)/bin
/apt-
,$(APT_UTILS
)) debian
/$@
/usr
/bin
/
267 cp
$(BLD
)/bin
/apt-dump-solver debian
/$@
/usr
/lib
/apt
/solvers
/dump
268 cp
$(BLD
)/bin
/apt-internal-solver debian
/$@
/usr
/lib
/apt
/solvers
/apt
270 dh_install
-p
$@
--sourcedir
=$(BLD
)
273 dh_installexamples
-p
$@
275 # Install the man pages..
276 dh_installman
-p
$@
$(wildcard $(patsubst %,doc
/en
/%.
[158],$(apt-utils_MANPAGES
)) $(patsubst %,doc
/*/%.
*.
[158],$(apt-utils_MANPAGES
)))
278 dh_installchangelogs
-p
$@
289 $(LIBAPT_PKG
): build-binary debian
/$(LIBAPT_PKG
).
install
295 dh_install
-p
$@
--sourcedir
=$(BLD
)
297 dh_installchangelogs
-p
$@
308 $(LIBAPT_INST
): build-binary debian
/$(LIBAPT_INST
).
install
314 dh_install
-p
$@
--sourcedir
=$(BLD
)
316 dh_installchangelogs
-p
$@
327 apt-transport-https
: build-binary libapt-pkg-dev
333 dh_install
-p
$@
--sourcedir
=$(BLD
)
334 dh_installdocs
-p
$@ debian
/apt-transport-https.README
335 dh_installexamples
-p
$@
337 # Install the man pages..
340 dh_installchangelogs
-p
$@
350 buildlib
/config.guess buildlib
/config.sub
:
356 # translate targets to targets required by debian-policy
357 binary-arch
: $(LIBAPT_PKG
) $(LIBAPT_INST
) apt libapt-pkg-dev apt-utils apt-transport-https
358 binary-indep
: apt-doc libapt-pkg-doc
359 binary
: binary-indep binary-arch
360 build-arch
: build-binary
361 build-indep
: build-manpages build-docbook
362 build
: build-indep build-arch
364 .PHONY
: build
clean binary-indep binary-arch binary