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