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