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
)
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
)
17 confflags
+= --build
$(DEB_BUILD_GNU_TYPE
) --host
$(DEB_HOST_GNU_TYPE
)
21 -include build
/environment.mak
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
)
28 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
29 export CXXFLAGS
= -O0
-g
-Wall
31 export CXXFLAGS
= -O2
-g
-Wall
39 DEB_BUILD_PROG
:=debuild
--preserve-envvar PATH
--preserve-envvar CCACHE_DIR
-us
-uc
$(DEB_BUILD_PROG_OPTS
)
41 # Determine the build directory to use
44 BUILD_POSSIBLE
:= $(BUILD
) $(BASE
)/$(BUILD
)
46 BUILD_POSSIBLE
:= $(BASE
) $(BASE
)/build-
$(shell uname
--machine
) $(BASE
)/build
48 BUILDX
:= $(foreach i
,$(BUILD_POSSIBLE
),$(wildcard $(i
)/environment.mak
*))
49 BUILDX
:= $(patsubst %/,%,$(firstword $(dir $(BUILDX
))))
50 override BLD
:= $(BUILDX
)
52 ifeq ($(words $(BLD
)),0)
53 override BLD
:= .
/build
56 # APT Programs in apt-utils
57 APT_UTILS
=ftparchive sortpkgs extracttemplates
59 # Uncomment this to turn on verbose mode.
62 # Find the libapt-pkg major version for use in other control files
63 include buildlib
/libversion.mak
65 # Determine which library package names to use
66 LIBAPT_PKG
=libapt-pkg
$(LIBAPTPKG_MAJOR
)
67 LIBAPT_INST
=libapt-inst
$(LIBAPTINST_MAJOR
)
69 # do not fail as we are just experimenting with symbol files for now
70 export DPKG_GENSYMBOLS_CHECK_LEVEL
=0
72 build
: build
/build-stamp
73 build-doc
: build-manpages build
/build-doc-stamp
74 build-manpages
: build
/build-manpages-stamp
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
82 configure
: configure.in
83 build
/configure-stamp
: configure
86 cp COPYING debian
/copyright
87 cd build
&& CXXFLAGS
="$(CXXFLAGS)" LDFLAGS
="$(LDFLAGS)" CPPFLAGS
="$(CPPFLAGS)" ..
/configure
$(confflags
)
90 build
/build-stamp
: build
/configure-stamp
91 # Add here commands to compile the package.
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
)))
100 @echo
"Tests DISABLED"
104 build
/build-doc-stamp
: build
/build-manpages-stamp build
/configure-stamp
105 # Add here commands to compile the package.
109 build
/build-manpages-stamp
: build
/configure-stamp
110 # Add here commands to compile the package.
117 [ ! -f Makefile
] ||
$(MAKE
) clean distclean
119 rm -f debian
/$(LIBAPT_PKG
).
install debian
/$(LIBAPT_INST
).
install \
120 debian
/libapt-pkg-dev.
install
122 debian
/%.
install: debian
/%.
install.in
123 sed
's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@
125 binary-indep
: apt-doc libapt-pkg-doc
126 # Build architecture-independent files here.
127 libapt-pkg-doc
: build-doc
133 # libapt-pkg-doc install
135 dh_installdocs
-p
$@
$(BLD
)/docs
/design
* \
136 $(BLD
)/docs
/dpkg-tech
* \
138 $(BLD
)/docs
/method
* \
139 doc
/libapt-pkg2_to_3.txt \
141 $(BLD
)/doc
/doxygen
/html
142 dh_installexamples
-p
$@
144 dh_installchangelogs
-p
$@
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
$@
175 # Build architecture-dependent files here.
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
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
/$@
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
196 dh_install
-p
$@
--sourcedir
=$(BLD
)
198 # Remove the bits that are in apt-utils
199 rm $(addprefix debian
/$@
/usr
/bin
/apt-
,$(APT_UTILS
) dump-solver internal-solver
)
201 # https has its own package
202 rm debian
/$@
/usr
/lib
/apt
/methods
/https
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 \
210 dh_installexamples
-p
$@
$(BLD
)/docs
/examples
/*
211 dh_installman
-p
$@
$(wildcard $(patsubst %,doc
/%.
[158],$(apt_MANPAGES
)) $(patsubst %,doc
/*/%.
*.
[158],$(apt_MANPAGES
)))
214 dh_installchangelogs
-p
$@
215 dh_installlogrotate
-p
$@
225 libapt-pkg-dev
: build debian
/libapt-pkg-dev.
install
231 # libapt-pkg-dev install
233 dh_install
-p
$@
--sourcedir
=$(BLD
)
235 dh_installchangelogs
-p
$@
240 dh_gencontrol
-p
$@
-- -Vlibapt-pkg-name
=$(LIBAPT_PKG
) -Vlibapt-inst-name
=$(LIBAPT_INST
)
244 apt-utils_MANPAGES
= apt-sortpkgs apt-ftparchive apt-extracttemplates
245 apt-utils
: build build-manpages
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
255 dh_install
-p
$@
--sourcedir
=$(BLD
)
258 dh_installexamples
-p
$@
260 # Install the man pages..
261 dh_installman
-p
$@
$(wildcard $(patsubst %,doc
/%.
[158],$(apt-utils_MANPAGES
)) $(patsubst %,doc
/*/%.
*.
[158],$(apt-utils_MANPAGES
)))
263 dh_installchangelogs
-p
$@
274 $(LIBAPT_PKG
): build debian
/$(LIBAPT_PKG
).
install
280 dh_install
-p
$@
--sourcedir
=$(BLD
)
282 dh_installchangelogs
-p
$@
293 $(LIBAPT_INST
): build debian
/$(LIBAPT_INST
).
install
299 dh_install
-p
$@
--sourcedir
=$(BLD
)
301 dh_installchangelogs
-p
$@
312 apt-transport-https
: build libapt-pkg-dev
318 dh_install
-p
$@
--sourcedir
=$(BLD
)
319 dh_installdocs
-p
$@ debian
/apt-transport-https.README
320 dh_installexamples
-p
$@
322 # Install the man pages..
325 dh_installchangelogs
-p
$@
339 -find .
-name Makefile.in
-print0 | xargs
--null
--no-run-if-empty
-- rm -f
340 find
-name ChangeLog | xargs
rm -f
343 binary
: binary-indep binary-arch
344 .PHONY
: build
clean binary-indep binary-arch binary