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 export DEB_HOST_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_HOST_GNU_TYPE
)
7 export DEB_BUILD_GNU_TYPE ?
= $(shell dpkg-architecture
-qDEB_BUILD_GNU_TYPE
)
8 export DEB_HOST_MULTIARCH ?
= $(shell dpkg-architecture
-qDEB_HOST_MULTIARCH
)
10 # FOR AUTOCONF 2.52 AND NEWER ONLY
11 ifeq ($(DEB_BUILD_GNU_TYPE
), $(DEB_HOST_GNU_TYPE
))
12 confflags
+= --build
$(DEB_HOST_GNU_TYPE
)
14 confflags
+= --build
$(DEB_BUILD_GNU_TYPE
) --host
$(DEB_HOST_GNU_TYPE
)
18 -include build
/environment.mak
20 ifneq (,$(shell which dpkg-buildflags
))
21 export CXXFLAGS
= $(shell dpkg-buildflags
--get CXXFLAGS
)
23 ifneq (,$(findstring noopt
,$(DEB_BUILD_OPTIONS
)))
24 export CXXFLAGS
= -O0
-g
-Wall
26 export CXXFLAGS
= -O2
-g
-Wall
34 DEB_BUILD_PROG
:=debuild
--preserve-envvar PATH
--preserve-envvar CCACHE_DIR
-us
-uc
$(DEB_BUILD_PROG_OPTS
)
35 APT_DEBVER
=$(shell dpkg-parsechangelog |sed
-n
-e
'/^Version:/s/^Version: //p' | sed
-e
's/\+.*$$//')
36 APT_CONFVER
=$(shell sed
-n
-e
's/^AC_DEFINE_UNQUOTED(VERSION,"\(.*\)")/\1/p' configure.in
)
37 APT_CVSTAG
=$(shell echo
"$(APT_DEBVER)" | sed
-e
's/^/v/' -e
's/\./_/g')
39 # Determine the build directory to use
42 BUILD_POSSIBLE
:= $(BUILD
) $(BASE
)/$(BUILD
)
44 BUILD_POSSIBLE
:= $(BASE
) $(BASE
)/build-
$(shell uname
--machine
) $(BASE
)/build
46 BUILDX
:= $(foreach i
,$(BUILD_POSSIBLE
),$(wildcard $(i
)/environment.mak
*))
47 BUILDX
:= $(patsubst %/,%,$(firstword $(dir $(BUILDX
))))
48 override BLD
:= $(BUILDX
)
50 ifeq ($(words $(BLD
)),0)
51 override BLD
:= .
/build
54 # Rebuild configure.in to have the correct version from the change log
55 ifneq ($(APT_DEBVER
),$(APT_CONFVER
))
56 ifneq ($(APT_DEBVER
),)
59 sed
-e
's/$(APT_CONFVER)/$(APT_DEBVER)/' $@
> $@.
$$$$ && mv
$@.
$$$$ $@
65 # APT Programs in apt-utils
66 APT_UTILS
=ftparchive sortpkgs extracttemplates internal-solver
68 # Uncomment this to turn on verbose mode.
71 # Find the libapt-pkg major version for use in other control files
72 include buildlib
/libversion.mak
74 # Determine which library package names to use
75 LIBAPT_PKG
=libapt-pkg
$(LIBAPTPKG_MAJOR
)
76 LIBAPT_INST
=libapt-inst
$(LIBAPTINST_MAJOR
)
78 # do not fail as we are just experimenting with symbol files for now
79 export DPKG_GENSYMBOLS_CHECK_LEVEL
=0
81 build
: build
/build-stamp
82 build-doc
: build
/build-doc-stamp
84 # Note that this is unconditionally done first as part of loading environment.mak
85 # The true is needed to force make to reload environment.mak after running
86 # configure-stamp. Otherwise we can get stale or invalid, or missing config data.
87 build
/environment.mak
: build
/configure-stamp
90 configure
: configure.in
91 build
/configure-stamp
: configure
94 cp COPYING debian
/copyright
95 cd build
&& CXXFLAGS
="$(CXXFLAGS)" ..
/configure
$(confflags
)
98 build
/build-stamp
: build
/configure-stamp
99 # Add here commands to compile the package.
101 # compat symlink for the locale split
102 mkdir
-p build
/usr
/share
103 cd build
/usr
/share
&& ln
-f
-s ..
/..
/locale .
104 # compile and run tests
105 ifeq (,$(findstring nocheck
, $(DEB_BUILD_OPTIONS
)))
108 @echo
"Tests DISABLED"
112 build
/build-doc-stamp
: build
/configure-stamp
113 # Add here commands to compile the package.
120 [ ! -f Makefile
] ||
$(MAKE
) clean distclean
122 rm -f debian
/$(LIBAPT_PKG
).
install debian
/$(LIBAPT_INST
).
install \
123 debian
/libapt-pkg-dev.
install
125 debian
/%.
install: debian
/%.
install.in
126 sed
's/@DEB_HOST_MULTIARCH@/$(DEB_HOST_MULTIARCH)/g' $< > $@
128 binary-indep
: libapt-common apt-doc libapt-pkg-doc
129 # Build architecture-independent files here.
136 dh_install
-p
$@
--sourcedir
=$(BLD
)
138 dh_installchangelogs
-p
$@
147 libapt-pkg-doc
: build-doc
153 # libapt-pkg-doc install
155 dh_installdocs
-p
$@
$(BLD
)/docs
/design
* \
156 $(BLD
)/docs
/dpkg-tech
* \
158 $(BLD
)/docs
/method
* \
159 doc
/libapt-pkg2_to_3.txt \
161 $(BLD
)/doc
/doxygen
/html
162 dh_installexamples
-p
$@
164 dh_installchangelogs
-p
$@
181 dh_installdocs
-p
$@
$(BLD
)/docs
/guide
*.text \
182 $(BLD
)/docs
/guide
*.html \
183 $(BLD
)/docs
/offline
*.text \
184 $(BLD
)/docs
/offline
*.html
185 dh_installchangelogs
-p
$@
195 # Build architecture-dependent files here.
197 binary-arch
: $(LIBAPT_PKG
) $(LIBAPT_INST
) apt libapt-pkg-dev apt-utils apt-transport-https
198 apt_MANPAGES
= apt-cache apt-cdrom apt-config apt-get apt-key apt-mark apt-secure apt apt.conf apt_preferences sources.list
207 cp debian
/apt.conf.autoremove debian
/$@
/etc
/apt
/apt.conf.d
/01autoremove
209 # make rosetta happy and remove pot files in po/ (but leave stuff
210 # in po/domains/* untouched) and cp *.po into each domain dir
214 dh_install
-p
$@
--sourcedir
=$(BLD
)
216 # Remove the bits that are in apt-utils
217 rm $(addprefix debian
/$@
/usr
/bin
/apt-
,$(APT_UTILS
) dump-solver
)
219 # https has its own package
220 rm debian
/$@
/usr
/lib
/apt
/methods
/https
222 # move the mirror failure script in place
223 #mv debian/$@/usr/bin/apt-report-mirror-failure \
224 # debian/$@/usr/lib/apt/apt-report-mirror-failure \
228 dh_installexamples
-p
$@
$(BLD
)/docs
/examples
/*
229 dh_installman
-p
$@
$(wildcard $(patsubst %,doc
/%.
[158],$(apt_MANPAGES
)) $(patsubst %,doc
/*/%.
*.
[158],$(apt_MANPAGES
)))
232 dh_installchangelogs
-p
$@
233 dh_installlogrotate
-p
$@
243 libapt-pkg-dev
: build debian
/libapt-pkg-dev.
install
249 # libapt-pkg-dev install
251 dh_install
-p
$@
--sourcedir
=$(BLD
)
253 dh_installchangelogs
-p
$@
258 dh_gencontrol
-p
$@
-- -Vlibapt-pkg-name
=$(LIBAPT_PKG
) -Vlibapt-inst-name
=$(LIBAPT_INST
)
262 apt-utils_MANPAGES
= apt-sortpkgs apt-ftparchive apt-extracttemplates
269 cp
$(addprefix $(BLD
)/bin
/apt-
,$(APT_UTILS
)) debian
/$@
/usr
/bin
/
270 cp
$(BLD
)/bin
/apt-dump-solver debian
/$@
/usr
/lib
/apt
/solvers
/dump
272 dh_install
-p
$@
--sourcedir
=$(BLD
)
275 dh_installexamples
-p
$@
277 # Install the man pages..
278 dh_installman
-p
$@
$(wildcard $(patsubst %,doc
/%.
[158],$(apt-utils_MANPAGES
)) $(patsubst %,doc
/*/%.
*.
[158],$(apt-utils_MANPAGES
)))
280 dh_installchangelogs
-p
$@
291 $(LIBAPT_PKG
): build debian
/$(LIBAPT_PKG
).
install
297 dh_install
-p
$@
--sourcedir
=$(BLD
)
299 dh_installchangelogs
-p
$@
310 $(LIBAPT_INST
): build debian
/$(LIBAPT_INST
).
install
316 dh_install
-p
$@
--sourcedir
=$(BLD
)
318 dh_installchangelogs
-p
$@
329 apt-transport-https
: build libapt-pkg-dev
335 dh_install
-p
$@
--sourcedir
=$(BLD
)
336 dh_installdocs
-p
$@ debian
/apt-transport-https.README
337 dh_installexamples
-p
$@
339 # Install the man pages..
342 dh_installchangelogs
-p
$@
356 -find .
-name Makefile.in
-print0 | xargs
--null
--no-run-if-empty
-- rm -f
357 find
-name ChangeLog | xargs
rm -f
360 binary
: binary-indep binary-arch
361 .PHONY
: build
clean binary-indep binary-arch binary