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