]> git.saurik.com Git - apt.git/blame - debian/rules
Arch build dir support
[apt.git] / debian / rules
CommitLineData
2d18d44e
AL
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.
cf6371d0 5# $Id: rules,v 1.16 1999/04/18 06:51:35 jgg Exp $
0f6b2443
AL
6
7
8# For the deb builder, you can run 'debian/rules cvs-build', which does all
9# steps nescessary to produce a proper source tarball with the CVS/ removed.
10# It builds in debian/cvs-build/apt-<VER>/, and places files in
11# debian/cvs-build/. Optionally, you can run 'debian/rules cvs-mkul' to
12# create ../upload-<VER>, with all the files needed to be uploaded placed
13# in it.
2d18d44e 14
e356ae6b 15DEB_BUILD_PROG:=debuild -us -uc
3a42cc3c
AL
16APT_DEBVER=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p')
17APT_CONFVER=$(shell sed -n -e 's/^AC_DEFINE_UNQUOTED(VERSION,"\(.*\)")/\1/p' configure.in)
18
cf6371d0
AL
19# Determine the build directory to use
20BASE=.
21ifdef BUILD
22BUILD_POSSIBLE := $(BUILD) $(BASE)/$(BUILD)
23else
24BUILD_POSSIBLE := $(BASE) $(BASE)/build-$(shell uname -m) $(BASE)/build
25endif
26BUILDX:= $(foreach i,$(BUILD_POSSIBLE),$(wildcard $(i)/environment.mak*))
27BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX))))
28override BLD := $(BUILDX)
29
3a42cc3c
AL
30ifneq ($(APT_DEBVER),$(APT_CONFVER))
31.PHONY: configure.in
32configure.in:
33 sed -e 's/$(APT_CONFVER)/$(APT_DEBVER)/' $@ > $@.$$$$;mv $@.$$$$ $@
34else
35configure.in:
36endif
2d18d44e
AL
37
38# Uncomment this to turn on verbose mode.
39#export DH_VERBOSE=1
40
d153f53f 41# Find the libapt-pkg major version for use in other control files
c64bcd92 42export LIBAPT_MAJOR:=$(shell egrep '^MAJOR=' apt-pkg/makefile |cut -d '=' -f 2)
0f6b2443
AL
43#debian/shlibs.local:
44# rm -f $@
45# echo "libapt-pkg $(LIBAPT_MAJOR) libapt-pkg$(LIBAPT_MAJOR)" >> $@
46# echo "libapt-pkg $(LIBAPT_MAJOR) apt $(APT_DEBVER)" >> $@
d153f53f 47
2d18d44e
AL
48build: build-stamp
49build-stamp: configure
50 dh_testdir
2ee6f3cb 51 -mkdir build
3a42cc3c 52 (cd build; ../configure)
2d18d44e
AL
53# cd build && CXXFLAGS="-g -Wall -D_POSIX_C_SOURCE=199309" ../configure --disable-nls --disable-static --prefix=/usr
54# cd build && make all-hdr
55# cd build && make -s
56
57 # Add here commands to compile the package.
58 make
59 touch build-stamp
60
61clean:
62 dh_testdir
63# dh_testroot
64 rm -f build-stamp
65 rm -rf build
66
67 # Add here commands to clean up after the build process.
68 -$(MAKE) clean
69 -$(MAKE) distclean
70 dh_clean
71
c64bcd92 72binary-indep: libapt-pkg-doc
2d18d44e 73# Build architecture-independent files here.
c64bcd92
AL
74libapt-pkg-doc: build debian/shlibs.local
75 dh_testdir -p$@
76 dh_testroot -p$@
77 dh_clean -p$@ -k
78 dh_installdirs -p$@
3a42cc3c
AL
79#
80# libapt-pkg-doc install
81#
cf6371d0
AL
82 -cp -a $(BLD)/docs/cache* $(BLD)/docs/design* $(BLD)/docs/dpkg-tech* \
83 $(BLD)/docs/files* $(BLD)/docs/method* debian/libapt-pkg-doc/usr/doc/apt/
3a42cc3c 84 cp -a debian/libapt-pkg-doc.dhelp debian/libapt-pkg-doc/usr/doc/libapt-pkg-doc/.dhelp
c64bcd92
AL
85 dh_installdocs -p$@
86 dh_installexamples -p$@
87# dh_installmenu -p$@
88# dh_installinit -p$@
89# dh_installcron -p$@
90 dh_installmanpages -p$@
91
92# dh_undocumented -p$@
93 dh_installchangelogs -p$@
94 dh_strip -p$@
95 dh_compress -p$@
96 dh_fixperms -p$@
97# dh_suidregister -p$@
98 dh_installdeb -p$@
99 dh_gencontrol -p$@ -u -Vlibapt-pkg:major=${LIBAPT_MAJOR}
100 dh_md5sums -p$@
101 dh_builddeb -p$@
2d18d44e 102
2d18d44e 103
3a42cc3c 104# Build architecture-dependent files here.
3a42cc3c 105
c64bcd92
AL
106binary-arch: apt libapt-pkg-dev
107apt: build debian/shlibs.local
108 dh_testdir -p$@
109 dh_testroot -p$@
110 dh_clean -p$@ -k
111 dh_installdirs -p$@
3a42cc3c
AL
112#
113# apt install
114#
cf6371d0 115 cp $(BLD)/bin/apt-* debian/tmp/usr/bin/
2553a569
AL
116
117 # install the shared libs
cf6371d0
AL
118 find $(BLD)/bin/ -type f -name "libapt-pkg.so.*" -exec cp -a "{}" debian/tmp/usr/lib/ \;
119 find $(BLD)/bin/ -type l -name "libapt-pkg.so.*" -exec cp -a "{}" debian/tmp/usr/lib/ \;
2553a569 120
cf6371d0 121 cp $(BLD)/bin/methods/* debian/tmp/usr/lib/apt/methods/
2d18d44e 122
cf6371d0 123 cp $(BLD)/scripts/dselect/* debian/tmp/usr/lib/dpkg/methods/apt/
2d18d44e
AL
124# cp debian/sources.list debian/tmp/etc/apt/
125
fc9d4b7b 126 # Copy the users guide
cf6371d0
AL
127 -cp $(BLD)/docs/guide.text debian/tmp/usr/doc/apt/users-guide.txt
128 -cp -a $(BLD)/docs/guide.html/* debian/tmp/usr/doc/apt/users-guide.html/
fc9d4b7b
AL
129
130 # Copy the offline guide
cf6371d0
AL
131 -cp $(BLD)/docs/offline.text debian/tmp/usr/doc/apt/offline.txt
132 -cp -a $(BLD)/docs/offline.html/* debian/tmp/usr/doc/apt/offline.html/
fc9d4b7b 133
396f4b08
AL
134 cp -a debian/dhelp debian/tmp/usr/doc/apt/.dhelp
135
2d18d44e
AL
136# head -n 500 ChangeLog > debian/ChangeLog
137
3a42cc3c
AL
138
139
c64bcd92 140 dh_installdocs -p$@
cf6371d0 141 dh_installexamples -papt $(BLD)/docs/examples/*
2d18d44e
AL
142# dh_installmenu -papt
143# dh_installinit -papt
144# dh_installcron -papt
c64bcd92 145 dh_installmanpages -p$@
2d18d44e
AL
146
147# dh_undocumented -papt
c64bcd92
AL
148 dh_installchangelogs -p$@
149 dh_strip -p$@
150 dh_compress -p$@
151 dh_fixperms -p$@
152# dh_suidregister -p$@
153 dh_installdeb -p$@
3a42cc3c 154 LD_LIBRARY_PATH=`pwd`/debian/tmp/usr/lib dh_shlibdeps -papt
c64bcd92 155 dh_gencontrol -p$@ -u -Vlibapt-pkg:major=${LIBAPT_MAJOR}
d153f53f 156 dh_makeshlibs -m${LIBAPT_MAJOR} -Vlibapt-pkg${LIBAPT_MAJOR} -papt
c64bcd92
AL
157 dh_md5sums -p$@
158 dh_builddeb -p$@
159
160libapt-pkg-dev: build debian/shlibs.local
161 dh_testdir -p$@
162 dh_testroot -p$@
163 dh_clean -p$@ -k
164 dh_installdirs -p$@
165#
166# libapt-pkg-dev install
167#
168 ln -s libapt-pkg.so.${LIBAPT_MAJOR} debian/libapt-pkg-dev/usr/lib/libapt-pkg.so
cf6371d0 169 cp $(BLD)/include/apt-pkg/*.h debian/libapt-pkg-dev/usr/include/apt-pkg/
c64bcd92
AL
170
171 dh_installdocs -p$@
172# dh_installmenu -papt
173# dh_installinit -papt
174# dh_installcron -papt
175 dh_installmanpages -p$@
176
177 dh_installchangelogs -p$@
178 dh_strip -p$@
179 dh_compress -p$@
180 dh_fixperms -p$@
181# dh_suidregister -p$@
182 dh_installdeb -p$@
183 dh_gencontrol -p$@ -u -Vlibapt-pkg:major=${LIBAPT_MAJOR}
184 dh_md5sums -p$@
185 dh_builddeb -p$@
2d18d44e
AL
186
187source diff:
188 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
189
190# Update from CVS
191l33ch: really-clean
192 cvs update
7bf6fd0c 193 buildlib/mkChangeLog
2d18d44e
AL
194
195# Update from CVS and then configure for build
196super-l33ch: l33ch Makefile.in
197
198configure:
3a42cc3c 199 make configure
2d18d44e
AL
200
201l33ch-stamp: super-l33ch
202 touch l33ch-stamp
203
204really-clean: clean
205 -find -name Makefile.in -print0 | xargs -0r rm -f
206 find -name ChangeLog | xargs rm -f
207 rm -f l33ch-stamp
208
209binary: binary-indep binary-arch
c64bcd92 210.PHONY: build clean binary-indep binary-arch binary debian/shlibs.local
3a42cc3c
AL
211
212
213# Done by the uploader.
214#cvs update..
215#edit debian/changelog
216# configure.in has the version automatically updated now.
217# edit configure.in
218# debian/rules cvs-build
219
220cvs-build:
221 rm -rf debian/cvs-build
222 cvs update
223 buildlib/mkChangeLog
c64bcd92 224 make startup
3a42cc3c
AL
225 make doc
226 tar c --exclude CVS --exclude debian/cvs-build . |\
227 (mkdir -p debian/cvs-build/apt-$(APT_DEBVER);cd debian/cvs-build/apt-$(APT_DEBVER);tar x)
228# The next line isn't needed, as debuild will make the .tar.gz for us.
229# (cd debian/cvs-build;tar zcf apt_$(APT_DEBVER).tar.gz apt-$(APT_DEBVER))
0f6b2443 230 (cd debian/cvs-build/apt-$(APT_DEBVER);$(DEB_BUILD_PROG))
8cdf81e9 231 rm ChangeLog
0f6b2443
AL
232
233cvs-mkul:
234 -mkdir -p ../upload-$(APT_DEBVER)
235 cp `find debian/cvs-build -maxdepth 1 -type f` ../upload-$(APT_DEBVER)