]>
Commit | Line | Data |
---|---|---|
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. | |
0b5c85b5 | 5 | # $Id: rules,v 1.19 1999/12/07 07:38:19 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 | 15 | DEB_BUILD_PROG:=debuild -us -uc |
3a42cc3c AL |
16 | APT_DEBVER=$(shell dpkg-parsechangelog |sed -n -e '/^Version:/s/^Version: //p') |
17 | APT_CONFVER=$(shell sed -n -e 's/^AC_DEFINE_UNQUOTED(VERSION,"\(.*\)")/\1/p' configure.in) | |
18 | ||
cf6371d0 AL |
19 | # Determine the build directory to use |
20 | BASE=. | |
21 | ifdef BUILD | |
22 | BUILD_POSSIBLE := $(BUILD) $(BASE)/$(BUILD) | |
23 | else | |
24 | BUILD_POSSIBLE := $(BASE) $(BASE)/build-$(shell uname -m) $(BASE)/build | |
25 | endif | |
26 | BUILDX:= $(foreach i,$(BUILD_POSSIBLE),$(wildcard $(i)/environment.mak*)) | |
27 | BUILDX:= $(patsubst %/,%,$(firstword $(dir $(BUILDX)))) | |
28 | override BLD := $(BUILDX) | |
29 | ||
3a42cc3c AL |
30 | ifneq ($(APT_DEBVER),$(APT_CONFVER)) |
31 | .PHONY: configure.in | |
32 | configure.in: | |
33 | sed -e 's/$(APT_CONFVER)/$(APT_DEBVER)/' $@ > $@.$$$$;mv $@.$$$$ $@ | |
34 | else | |
35 | configure.in: | |
36 | endif | |
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 | 42 | export 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 |
48 | build: build-stamp |
49 | build-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 | |
0b5c85b5 | 56 | |
2d18d44e AL |
57 | # Add here commands to compile the package. |
58 | make | |
59 | touch build-stamp | |
60 | ||
61 | clean: | |
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 | 72 | binary-indep: libapt-pkg-doc |
2d18d44e | 73 | # Build architecture-independent files here. |
c64bcd92 AL |
74 | libapt-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 | |
0b5c85b5 AL |
81 | # |
82 | dh_installdocs -p$@ $(BLD)/docs/cache* $(BLD)/docs/design* $(BLD)/docs/dpkg-tech* \ | |
83 | $(BLD)/docs/files* $(BLD)/docs/method* | |
84 | ||
3fa81a4a AL |
85 | -cp -a debian/libapt-pkg-doc.dhelp debian/libapt-pkg-doc/usr/doc/libapt-pkg-doc/.dhelp |
86 | -cp -a debian/libapt-pkg-doc.dhelp debian/libapt-pkg-doc/usr/share/doc/libapt-pkg-doc/.dhelp | |
87 | ||
c64bcd92 AL |
88 | dh_installexamples -p$@ |
89 | # dh_installmenu -p$@ | |
90 | # dh_installinit -p$@ | |
91 | # dh_installcron -p$@ | |
82297457 | 92 | # dh_installmanpages -p$@ |
c64bcd92 AL |
93 | |
94 | # dh_undocumented -p$@ | |
95 | dh_installchangelogs -p$@ | |
96 | dh_strip -p$@ | |
97 | dh_compress -p$@ | |
98 | dh_fixperms -p$@ | |
99 | # dh_suidregister -p$@ | |
100 | dh_installdeb -p$@ | |
101 | dh_gencontrol -p$@ -u -Vlibapt-pkg:major=${LIBAPT_MAJOR} | |
102 | dh_md5sums -p$@ | |
103 | dh_builddeb -p$@ | |
2d18d44e | 104 | |
2d18d44e | 105 | |
3a42cc3c | 106 | # Build architecture-dependent files here. |
3a42cc3c | 107 | |
c64bcd92 AL |
108 | binary-arch: apt libapt-pkg-dev |
109 | apt: build debian/shlibs.local | |
110 | dh_testdir -p$@ | |
111 | dh_testroot -p$@ | |
112 | dh_clean -p$@ -k | |
113 | dh_installdirs -p$@ | |
3a42cc3c AL |
114 | # |
115 | # apt install | |
116 | # | |
cf6371d0 | 117 | cp $(BLD)/bin/apt-* debian/tmp/usr/bin/ |
2553a569 AL |
118 | |
119 | # install the shared libs | |
cf6371d0 AL |
120 | find $(BLD)/bin/ -type f -name "libapt-pkg.so.*" -exec cp -a "{}" debian/tmp/usr/lib/ \; |
121 | find $(BLD)/bin/ -type l -name "libapt-pkg.so.*" -exec cp -a "{}" debian/tmp/usr/lib/ \; | |
2553a569 | 122 | |
cf6371d0 | 123 | cp $(BLD)/bin/methods/* debian/tmp/usr/lib/apt/methods/ |
2d18d44e | 124 | |
cf6371d0 | 125 | cp $(BLD)/scripts/dselect/* debian/tmp/usr/lib/dpkg/methods/apt/ |
2d18d44e | 126 | |
3fa81a4a AL |
127 | # Copy the guides |
128 | dh_installdocs -p$@ $(BLD)/docs/guide.text $(BLD)/docs/guide.html \ | |
129 | $(BLD)/docs/offline.text $(BLD)/docs/offline.html | |
fc9d4b7b | 130 | |
3fa81a4a AL |
131 | # One or the other.. |
132 | -cp -a debian/dhelp debian/tmp/usr/doc/apt/.dhelp | |
133 | -cp -a debian/dhelp debian/tmp/usr/share/doc/apt/.dhelp | |
396f4b08 | 134 | |
2d18d44e AL |
135 | # head -n 500 ChangeLog > debian/ChangeLog |
136 | ||
cf6371d0 | 137 | dh_installexamples -papt $(BLD)/docs/examples/* |
c64bcd92 | 138 | dh_installmanpages -p$@ |
2d18d44e | 139 | |
c64bcd92 AL |
140 | dh_installchangelogs -p$@ |
141 | dh_strip -p$@ | |
142 | dh_compress -p$@ | |
143 | dh_fixperms -p$@ | |
c64bcd92 | 144 | dh_installdeb -p$@ |
3a42cc3c | 145 | LD_LIBRARY_PATH=`pwd`/debian/tmp/usr/lib dh_shlibdeps -papt |
c64bcd92 | 146 | dh_gencontrol -p$@ -u -Vlibapt-pkg:major=${LIBAPT_MAJOR} |
d153f53f | 147 | dh_makeshlibs -m${LIBAPT_MAJOR} -Vlibapt-pkg${LIBAPT_MAJOR} -papt |
c64bcd92 AL |
148 | dh_md5sums -p$@ |
149 | dh_builddeb -p$@ | |
150 | ||
151 | libapt-pkg-dev: build debian/shlibs.local | |
152 | dh_testdir -p$@ | |
153 | dh_testroot -p$@ | |
154 | dh_clean -p$@ -k | |
155 | dh_installdirs -p$@ | |
156 | # | |
157 | # libapt-pkg-dev install | |
158 | # | |
3fa81a4a AL |
159 | cp -a $(BLD)/bin/libapt-pkg.so debian/libapt-pkg-dev/usr/lib/ |
160 | #ln -s libapt-pkg.so.${LIBAPT_MAJOR} debian/libapt-pkg-dev/usr/lib/libapt-pkg.so | |
cf6371d0 | 161 | cp $(BLD)/include/apt-pkg/*.h debian/libapt-pkg-dev/usr/include/apt-pkg/ |
c64bcd92 AL |
162 | |
163 | dh_installdocs -p$@ | |
164 | # dh_installmenu -papt | |
165 | # dh_installinit -papt | |
166 | # dh_installcron -papt | |
82297457 | 167 | # dh_installmanpages -p$@ |
c64bcd92 AL |
168 | |
169 | dh_installchangelogs -p$@ | |
170 | dh_strip -p$@ | |
171 | dh_compress -p$@ | |
172 | dh_fixperms -p$@ | |
173 | # dh_suidregister -p$@ | |
174 | dh_installdeb -p$@ | |
175 | dh_gencontrol -p$@ -u -Vlibapt-pkg:major=${LIBAPT_MAJOR} | |
176 | dh_md5sums -p$@ | |
177 | dh_builddeb -p$@ | |
2d18d44e AL |
178 | |
179 | source diff: | |
180 | @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false | |
181 | ||
182 | # Update from CVS | |
183 | l33ch: really-clean | |
184 | cvs update | |
7bf6fd0c | 185 | buildlib/mkChangeLog |
2d18d44e AL |
186 | |
187 | # Update from CVS and then configure for build | |
188 | super-l33ch: l33ch Makefile.in | |
189 | ||
190 | configure: | |
3a42cc3c | 191 | make configure |
2d18d44e AL |
192 | |
193 | l33ch-stamp: super-l33ch | |
194 | touch l33ch-stamp | |
195 | ||
196 | really-clean: clean | |
197 | -find -name Makefile.in -print0 | xargs -0r rm -f | |
198 | find -name ChangeLog | xargs rm -f | |
199 | rm -f l33ch-stamp | |
200 | ||
201 | binary: binary-indep binary-arch | |
c64bcd92 | 202 | .PHONY: build clean binary-indep binary-arch binary debian/shlibs.local |
3a42cc3c AL |
203 | |
204 | ||
205 | # Done by the uploader. | |
206 | #cvs update.. | |
207 | #edit debian/changelog | |
208 | # configure.in has the version automatically updated now. | |
209 | # edit configure.in | |
210 | # debian/rules cvs-build | |
211 | ||
212 | cvs-build: | |
213 | rm -rf debian/cvs-build | |
214 | cvs update | |
215 | buildlib/mkChangeLog | |
c64bcd92 | 216 | make startup |
3a42cc3c AL |
217 | make doc |
218 | tar c --exclude CVS --exclude debian/cvs-build . |\ | |
219 | (mkdir -p debian/cvs-build/apt-$(APT_DEBVER);cd debian/cvs-build/apt-$(APT_DEBVER);tar x) | |
220 | # The next line isn't needed, as debuild will make the .tar.gz for us. | |
221 | # (cd debian/cvs-build;tar zcf apt_$(APT_DEBVER).tar.gz apt-$(APT_DEBVER)) | |
0f6b2443 | 222 | (cd debian/cvs-build/apt-$(APT_DEBVER);$(DEB_BUILD_PROG)) |
8cdf81e9 | 223 | rm ChangeLog |
0f6b2443 AL |
224 | |
225 | cvs-mkul: | |
226 | -mkdir -p ../upload-$(APT_DEBVER) | |
227 | cp `find debian/cvs-build -maxdepth 1 -type f` ../upload-$(APT_DEBVER) |