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