Fixed up share/doc stuff
[ntk/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.18 1999/11/23 05:36:52 jgg Exp $
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.
14
15 DEB_BUILD_PROG:=debuild -us -uc
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
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
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
37
38 # Uncomment this to turn on verbose mode.
39 #export DH_VERBOSE=1
40
41 # Find the libapt-pkg major version for use in other control files
42 export LIBAPT_MAJOR:=$(shell egrep '^MAJOR=' apt-pkg/makefile |cut -d '=' -f 2)
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)" >> $@
47
48 build: build-stamp
49 build-stamp: configure
50 dh_testdir
51 -mkdir build
52 (cd build; ../configure)
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
56
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
72 binary-indep: libapt-pkg-doc
73 # Build architecture-independent files here.
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$@
79 #
80 # libapt-pkg-doc install
81 #
82 -cp -a debian/libapt-pkg-doc.dhelp debian/libapt-pkg-doc/usr/doc/libapt-pkg-doc/.dhelp
83 -cp -a debian/libapt-pkg-doc.dhelp debian/libapt-pkg-doc/usr/share/doc/libapt-pkg-doc/.dhelp
84
85 dh_installdocs -p$@ $(BLD)/docs/cache* $(BLD)/docs/design* $(BLD)/docs/dpkg-tech* \
86 $(BLD)/docs/files* $(BLD)/docs/method*
87 dh_installexamples -p$@
88 # dh_installmenu -p$@
89 # dh_installinit -p$@
90 # dh_installcron -p$@
91 # dh_installmanpages -p$@
92
93 # dh_undocumented -p$@
94 dh_installchangelogs -p$@
95 dh_strip -p$@
96 dh_compress -p$@
97 dh_fixperms -p$@
98 # dh_suidregister -p$@
99 dh_installdeb -p$@
100 dh_gencontrol -p$@ -u -Vlibapt-pkg:major=${LIBAPT_MAJOR}
101 dh_md5sums -p$@
102 dh_builddeb -p$@
103
104
105 # Build architecture-dependent files here.
106
107 binary-arch: apt libapt-pkg-dev
108 apt: build debian/shlibs.local
109 dh_testdir -p$@
110 dh_testroot -p$@
111 dh_clean -p$@ -k
112 dh_installdirs -p$@
113 #
114 # apt install
115 #
116 cp $(BLD)/bin/apt-* debian/tmp/usr/bin/
117
118 # install the shared libs
119 find $(BLD)/bin/ -type f -name "libapt-pkg.so.*" -exec cp -a "{}" debian/tmp/usr/lib/ \;
120 find $(BLD)/bin/ -type l -name "libapt-pkg.so.*" -exec cp -a "{}" debian/tmp/usr/lib/ \;
121
122 cp $(BLD)/bin/methods/* debian/tmp/usr/lib/apt/methods/
123
124 cp $(BLD)/scripts/dselect/* debian/tmp/usr/lib/dpkg/methods/apt/
125
126 # Copy the guides
127 dh_installdocs -p$@ $(BLD)/docs/guide.text $(BLD)/docs/guide.html \
128 $(BLD)/docs/offline.text $(BLD)/docs/offline.html
129
130 # One or the other..
131 -cp -a debian/dhelp debian/tmp/usr/doc/apt/.dhelp
132 -cp -a debian/dhelp debian/tmp/usr/share/doc/apt/.dhelp
133
134 # head -n 500 ChangeLog > debian/ChangeLog
135
136 dh_installexamples -papt $(BLD)/docs/examples/*
137 dh_installmanpages -p$@
138
139 dh_installchangelogs -p$@
140 dh_strip -p$@
141 dh_compress -p$@
142 dh_fixperms -p$@
143 dh_installdeb -p$@
144 LD_LIBRARY_PATH=`pwd`/debian/tmp/usr/lib dh_shlibdeps -papt
145 dh_gencontrol -p$@ -u -Vlibapt-pkg:major=${LIBAPT_MAJOR}
146 dh_makeshlibs -m${LIBAPT_MAJOR} -Vlibapt-pkg${LIBAPT_MAJOR} -papt
147 dh_md5sums -p$@
148 dh_builddeb -p$@
149
150 libapt-pkg-dev: build debian/shlibs.local
151 dh_testdir -p$@
152 dh_testroot -p$@
153 dh_clean -p$@ -k
154 dh_installdirs -p$@
155 #
156 # libapt-pkg-dev install
157 #
158 cp -a $(BLD)/bin/libapt-pkg.so debian/libapt-pkg-dev/usr/lib/
159 #ln -s libapt-pkg.so.${LIBAPT_MAJOR} debian/libapt-pkg-dev/usr/lib/libapt-pkg.so
160 cp $(BLD)/include/apt-pkg/*.h debian/libapt-pkg-dev/usr/include/apt-pkg/
161
162 dh_installdocs -p$@
163 # dh_installmenu -papt
164 # dh_installinit -papt
165 # dh_installcron -papt
166 # dh_installmanpages -p$@
167
168 dh_installchangelogs -p$@
169 dh_strip -p$@
170 dh_compress -p$@
171 dh_fixperms -p$@
172 # dh_suidregister -p$@
173 dh_installdeb -p$@
174 dh_gencontrol -p$@ -u -Vlibapt-pkg:major=${LIBAPT_MAJOR}
175 dh_md5sums -p$@
176 dh_builddeb -p$@
177
178 source diff:
179 @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
180
181 # Update from CVS
182 l33ch: really-clean
183 cvs update
184 buildlib/mkChangeLog
185
186 # Update from CVS and then configure for build
187 super-l33ch: l33ch Makefile.in
188
189 configure:
190 make configure
191
192 l33ch-stamp: super-l33ch
193 touch l33ch-stamp
194
195 really-clean: clean
196 -find -name Makefile.in -print0 | xargs -0r rm -f
197 find -name ChangeLog | xargs rm -f
198 rm -f l33ch-stamp
199
200 binary: binary-indep binary-arch
201 .PHONY: build clean binary-indep binary-arch binary debian/shlibs.local
202
203
204 # Done by the uploader.
205 #cvs update..
206 #edit debian/changelog
207 # configure.in has the version automatically updated now.
208 # edit configure.in
209 # debian/rules cvs-build
210
211 cvs-build:
212 rm -rf debian/cvs-build
213 cvs update
214 buildlib/mkChangeLog
215 make startup
216 make doc
217 tar c --exclude CVS --exclude debian/cvs-build . |\
218 (mkdir -p debian/cvs-build/apt-$(APT_DEBVER);cd debian/cvs-build/apt-$(APT_DEBVER);tar x)
219 # The next line isn't needed, as debuild will make the .tar.gz for us.
220 # (cd debian/cvs-build;tar zcf apt_$(APT_DEBVER).tar.gz apt-$(APT_DEBVER))
221 (cd debian/cvs-build/apt-$(APT_DEBVER);$(DEB_BUILD_PROG))
222 rm ChangeLog
223
224 cvs-mkul:
225 -mkdir -p ../upload-$(APT_DEBVER)
226 cp `find debian/cvs-build -maxdepth 1 -type f` ../upload-$(APT_DEBVER)