]> git.saurik.com Git - apt.git/blob - debian/rules
Neuros fix for missing Provides
[apt.git] / debian / rules
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.
5 # $Id: rules,v 1.32 2001/04/17 06:46:13 jgg Exp $
6
7 # LD_LIBRARY_PATH=pwd/debian/apt/usr/lib dh_shlibdeps -papt
8 # dpkg: /home/jgg/work/apt2/debian/apt/usr/lib/libapt-pkg.so.2.9 not found.
9
10 # For the deb builder, you can run 'debian/rules cvs-build', which does all
11 # steps nescessary to produce a proper source tarball with the CVS/ removed.
12 # It builds in debian/cvs-build/apt-<VER>/, and places files in
13 # debian/cvs-build/. Optionally, you can run 'debian/rules cvs-mkul' to
14 # create ../upload-<VER>, with all the files needed to be uploaded placed
15 # in it.
16
17 export DH_COMPAT=2
18
19 # See below
20 include build/environment.mak
21
22 # Default rule
23 build:
24
25 DEB_BUILD_PROG:=debuild -us -uc
26 APT_DEBVER=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p')
27 APT_CONFVER=$(shell sed -n -e 's/^AC_DEFINE_UNQUOTED(VERSION,"\(.*\)")/\1/p' configure.in)
28
29 # Determine the build directory to use
30 BASE=.
31 ifdef BUILD
32 BUILD_POSSIBLE := $(BUILD) $(BASE)/$(BUILD)
33 else
34 BUILD_POSSIBLE := $(BASE) $(BASE)/build-$(shell uname -m) $(BASE)/build
35 endif
36 BUILDX:= $(foreach i,$(BUILD_POSSIBLE),$(wildcard $(i)/environment.mak*))
37 BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX))))
38 override BLD := $(BUILDX)
39
40 ifeq ($(words $(BLD)),0)
41 override BLD := ./build
42 endif
43
44 # Rebuild configure.in to have the correct version from the change log
45 ifneq ($(APT_DEBVER),$(APT_CONFVER))
46 .PHONY: configure.in
47 configure.in:
48 sed -e 's/$(APT_CONFVER)/$(APT_DEBVER)/' $@ > $@.$$$$;mv $@.$$$$ $@
49 else
50 configure.in:
51 endif
52
53 # APT Programs in apt-utils
54 APT_UTILS=ftparchive sortpkgs extracttemplates
55
56 # Uncomment this to turn on verbose mode.
57 #export DH_VERBOSE=1
58
59 # Find the libapt-pkg major version for use in other control files
60 export LIBAPTPKG_MAJOR:=$(shell egrep '^MAJOR=' apt-pkg/makefile |cut -d '=' -f 2)
61 export LIBAPTINST_MAJOR:=$(shell egrep '^MAJOR=' apt-inst/makefile |cut -d '=' -f 2)
62
63 # Determine which package we should provide in the control files
64 LIBAPTPKG_PROVIDE=libapt-pkg$(GLIBC_VER)$(LIBSTDCPP_VER)-$(LIBAPTPKG_MAJOR)
65 LIBAPTINST_PROVIDE=libapt-inst$(GLIBC_VER)$(LIBSTDCPP_VER)-$(LIBAPTINST_MAJOR)
66
67 debian/shlibs.local: apt-pkg/makefile
68 # We have 3 shlibs.local files.. One for 'apt', one for 'apt-utils' and
69 # one for the rest of the packages. This ensures that each package gets
70 # the right overrides..
71 rm -rf $@ $@.apt $@.apt-utils
72 echo "libapt-pkg$(GLIBC_VER)$(LIBSTDCPP_VER) $(LIBAPTPKG_MAJOR)" > $@.apt
73
74 echo "libapt-pkg$(GLIBC_VER)$(LIBSTDCPP_VER) $(LIBAPTPKG_MAJOR) $(LIBAPTPKG_PROVIDE)" > $@.apt-utils
75 echo "libapt-inst$(GLIBC_VER)$(LIBSTDCPP_VER) $(LIBAPTINST_MAJOR)" >> $@.apt-utils
76
77 echo "libapt-pkg$(GLIBC_VER)$(LIBSTDCPP_VER) $(LIBAPTPKG_MAJOR) $(LIBAPTPKG_PROVIDE)" > $@
78 echo "libapt-inst$(GLIBC_VER)$(LIBSTDCPP_VER) $(LIBAPTINST_MAJOR) $(LIBAPTINST_PROVIDE)" >> $@
79
80 build: build/build-stamp
81
82 # Note that this is unconditionally done first as part of loading environment.mak
83 # The true is needed to force make to reload environment.mak after running
84 # configure-stamp. Otherwise we can get stale or invalid, or missing config data.
85 build/environment.mak: build/configure-stamp
86 @true
87
88 configure: configure.in
89 build/configure-stamp: configure
90 dh_testdir
91 -mkdir build
92 (cd build; ../configure)
93 touch $@
94
95 build/build-stamp: build/configure-stamp
96 # Add here commands to compile the package.
97 $(MAKE) -s
98 touch $@
99
100 clean:
101 dh_testdir
102 # dh_testroot
103 rm -f build-stamp debian/shlibs.local
104 rm -rf build
105 rm -f debian/shlibs.local.apt debian/shlibs.local.apt-utils
106
107 # Add here commands to clean up after the build process.
108 -$(MAKE) clean
109 -$(MAKE) distclean
110 dh_clean
111
112 binary-indep: libapt-pkg-doc
113 # Build architecture-independent files here.
114 libapt-pkg-doc: build debian/shlibs.local
115 dh_testdir -p$@
116 dh_testroot -p$@
117 dh_clean -p$@ -k
118 dh_installdirs -p$@
119 #
120 # libapt-pkg-doc install
121 #
122 dh_installdocs -p$@ $(BLD)/docs/cache* $(BLD)/docs/design* $(BLD)/docs/dpkg-tech* \
123 $(BLD)/docs/files* $(BLD)/docs/method* \
124 doc/libapt-pkg2_to_3.txt doc/style.txt
125
126 -cp -a debian/libapt-pkg-doc.dhelp debian/libapt-pkg-doc/usr/doc/libapt-pkg-doc/.dhelp
127 -cp -a debian/libapt-pkg-doc.dhelp debian/libapt-pkg-doc/usr/share/doc/libapt-pkg-doc/.dhelp
128
129 dh_installexamples -p$@
130 # dh_installmenu -p$@
131 # dh_installinit -p$@
132 # dh_installcron -p$@
133 # dh_installmanpages -p$@
134
135 # dh_undocumented -p$@
136 dh_installchangelogs -p$@
137 dh_strip -p$@
138 dh_compress -p$@
139 dh_fixperms -p$@
140 # dh_suidregister -p$@
141 dh_installdeb -p$@
142 dh_gencontrol -p$@ -u -Vlibapt-pkg:provides=$(LIBAPTPKG_PROVIDE)
143 dh_md5sums -p$@
144 dh_builddeb -p$@
145
146
147 # Build architecture-dependent files here.
148
149 binary-arch: apt libapt-pkg-dev apt-utils
150 apt: build debian/shlibs.local
151 dh_testdir -p$@
152 dh_testroot -p$@
153 dh_clean -p$@ -k
154 dh_installdirs -p$@
155 #
156 # apt install
157 #
158 cp $(BLD)/bin/apt-* debian/apt/usr/bin/
159
160 # Remove the bits that are in apt-utils
161 rm $(addprefix debian/apt/usr/bin/apt-,$(APT_UTILS))
162
163 # install the shared libs
164 find $(BLD)/bin/ -type f -name "libapt-pkg*.so.*" -exec cp -a "{}" debian/apt/usr/lib/ \;
165 find $(BLD)/bin/ -type l -name "libapt-pkg*.so.*" -exec cp -a "{}" debian/apt/usr/lib/ \;
166
167 cp $(BLD)/bin/methods/* debian/apt/usr/lib/apt/methods/
168
169 cp $(BLD)/scripts/dselect/* debian/apt/usr/lib/dpkg/methods/apt/
170
171 # Copy the guides
172 dh_installdocs -p$@ $(BLD)/docs/guide*.text $(BLD)/docs/guide*.html \
173 $(BLD)/docs/offline.text $(BLD)/docs/offline.html
174
175 # One or the other..
176 -cp -a debian/dhelp debian/apt/usr/doc/apt/.dhelp
177 -cp -a debian/dhelp debian/apt/usr/share/doc/apt/.dhelp
178
179 # head -n 500 ChangeLog > debian/ChangeLog
180
181 dh_installexamples -p$@ $(BLD)/docs/examples/*
182 dh_installmanpages -p$@ apt-ftparchive.1 apt-sortpkgs.1 apt-extracttemplates.1
183
184 dh_installchangelogs -p$@
185 dh_strip -p$@
186 dh_compress -p$@
187 dh_fixperms -p$@
188 dh_installdeb -p$@
189 dh_shlibdeps -papt -l`pwd`/debian/apt/usr/lib -- -Ldebian/shlibs.local.apt
190 # LD_LIBRARY_PATH=`pwd`/debian/apt/usr/lib dh_shlibdeps -papt
191 dh_gencontrol -p$@ -u -Vlibapt-pkg:provides=$(LIBAPTPKG_PROVIDE)
192 dh_makeshlibs -m$(LIBAPTPKG_MAJOR) -V '$(LIBAPTPKG_PROVIDE)' -papt
193 dh_md5sums -p$@
194 dh_builddeb -p$@
195
196 libapt-pkg-dev: build debian/shlibs.local
197 dh_testdir -p$@
198 dh_testroot -p$@
199 dh_clean -p$@ -k
200 dh_installdirs -p$@
201 #
202 # libapt-pkg-dev install
203 #
204 cp -a $(BLD)/bin/libapt-pkg*.so debian/libapt-pkg-dev/usr/lib/
205 cp -a $(BLD)/bin/libapt-inst*.so debian/libapt-pkg-dev/usr/lib/
206 #ln -s libapt-pkg.so.$(LIBAPTPKG_MAJOR) debian/libapt-pkg-dev/usr/lib/libapt-pkg.so
207 cp $(BLD)/include/apt-pkg/*.h debian/libapt-pkg-dev/usr/include/apt-pkg/
208
209 dh_installdocs -p$@
210 # dh_installmenu -p$@
211 # dh_installinit -p$@
212 # dh_installcron -p$@
213 # dh_installmanpages -p$@
214
215 dh_installchangelogs -p$@
216 dh_strip -p$@
217 dh_compress -p$@
218 dh_fixperms -p$@
219 # dh_suidregister -p$@
220 dh_installdeb -p$@
221 dh_gencontrol -p$@ -u -Vlibapt-pkg:provides=$(LIBAPTPKG_PROVIDE)
222 dh_md5sums -p$@
223 dh_builddeb -p$@
224
225 apt-utils: build debian/shlibs.local
226 dh_testdir -p$@
227 dh_testroot -p$@
228 dh_clean -p$@ -k
229 dh_installdirs -p$@
230
231 # install the shared libs
232 find $(BLD)/bin/ -type f -name "libapt-inst*.so.*" -exec cp -a "{}" debian/$@/usr/lib/ \;
233 find $(BLD)/bin/ -type l -name "libapt-inst*.so.*" -exec cp -a "{}" debian/$@/usr/lib/ \;
234
235 cp $(addprefix $(BLD)/bin/apt-,$(APT_UTILS)) debian/$@/usr/bin/
236 dh_installdocs -p$@
237
238 # Install the man pages..
239 mkdir -p debian/$@/usr/share/man/man1
240 -cp doc/apt-sortpkgs.1 doc/apt-ftparchive.1 doc/apt-extracttemplates.1 debian/$@/usr/share/man/man1/
241
242 dh_installchangelogs -p$@
243 dh_strip -p$@
244 dh_compress -p$@
245 dh_fixperms -p$@
246 dh_installdeb -p$@
247 LD_LIBRARY_PATH=`pwd`/debian/apt/usr/lib:`pwd`/debian/$@/usr/lib dh_shlibdeps -p$@ -- -Ldebian/shlibs.local.apt-utils
248 dh_gencontrol -p$@ -u -Vlibapt-inst:provides=$(LIBAPTINST_PROVIDE)
249 dh_makeshlibs -m$(LIBAPTINST_MAJOR) -V '$(LIBAPTINST_PROVIDE)' -p$@
250 dh_md5sums -p$@
251 dh_builddeb -p$@
252
253 source diff:
254 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
255
256 # Update from CVS
257 l33ch: really-clean
258 cvs update
259 buildlib/mkChangeLog
260
261 # Update from CVS and then configure for build
262 super-l33ch: l33ch Makefile.in
263
264 configure:
265 $(MAKE) configure
266
267 l33ch-stamp: super-l33ch
268 touch $@
269
270 really-clean: clean
271 -find -name Makefile.in -print0 | xargs -0r rm -f
272 find -name ChangeLog | xargs rm -f
273 rm -f l33ch-stamp
274
275 binary: binary-indep binary-arch
276 .PHONY: build clean binary-indep binary-arch binary debian/shlibs.local
277
278
279 # Done by the uploader.
280 #cvs update..
281 #edit debian/changelog
282 # configure.in has the version automatically updated now.
283 # edit configure.in
284 # debian/rules cvs-build
285
286 cvs-build:
287 rm -rf debian/cvs-build
288 cvs update
289 #buildlib/mkChangeLog
290 $(MAKE) startup
291 $(MAKE) doc
292 tar c --exclude CVS --exclude cvs-build . |\
293 (mkdir -p debian/cvs-build/apt-$(APT_DEBVER);cd debian/cvs-build/apt-$(APT_DEBVER);tar x)
294 # The next line isn't needed, as debuild will make the .tar.gz for us.
295 # (cd debian/cvs-build;tar zcf apt_$(APT_DEBVER).tar.gz apt-$(APT_DEBVER))
296 (cd debian/cvs-build/apt-$(APT_DEBVER);$(DEB_BUILD_PROG))
297 #rm ChangeLog
298
299 cvs-mkul:
300 -mkdir -p ../upload-$(APT_DEBVER)
301 cp `find debian/cvs-build -maxdepth 1 -type f` ../upload-$(APT_DEBVER)