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.17 1999/05/14 02:51:37 jgg Exp $
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
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
)
19 # Determine the build directory to use
22 BUILD_POSSIBLE
:= $(BUILD
) $(BASE
)/$(BUILD
)
24 BUILD_POSSIBLE
:= $(BASE
) $(BASE
)/build-
$(shell uname
-m
) $(BASE
)/build
26 BUILDX
:= $(foreach i
,$(BUILD_POSSIBLE
),$(wildcard $(i
)/environment.mak
*))
27 BUILDX
:= $(patsubst %/,%,$(firstword $(dir $(BUILDX
))))
28 override BLD
:= $(BUILDX
)
30 ifneq ($(APT_DEBVER
),$(APT_CONFVER
))
33 sed
-e
's/$(APT_CONFVER)/$(APT_DEBVER)/' $@
> $@.
$$$$;mv
$@.
$$$$ $@
38 # Uncomment this to turn on verbose mode.
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)
45 # echo "libapt-pkg $(LIBAPT_MAJOR) libapt-pkg$(LIBAPT_MAJOR)" >> $@
46 # echo "libapt-pkg $(LIBAPT_MAJOR) apt $(APT_DEBVER)" >> $@
49 build-stamp
: configure
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
57 # Add here commands to compile the package.
67 # Add here commands to clean up after the build process.
72 binary-indep
: libapt-pkg-doc
73 # Build architecture-independent files here.
74 libapt-pkg-doc
: build debian
/shlibs.local
80 # libapt-pkg-doc install
82 -cp
-a
$(BLD
)/docs
/cache
* $(BLD
)/docs
/design
* $(BLD
)/docs
/dpkg-tech
* \
83 $(BLD
)/docs
/files
* $(BLD
)/docs
/method
* debian
/libapt-pkg-doc
/usr
/doc
/apt
/
84 cp
-a debian
/libapt-pkg-doc.dhelp debian
/libapt-pkg-doc
/usr
/doc
/libapt-pkg-doc
/.dhelp
86 dh_installexamples
-p
$@
90 # dh_installmanpages -p$@
92 # dh_undocumented -p$@
93 dh_installchangelogs
-p
$@
97 # dh_suidregister -p$@
99 dh_gencontrol
-p
$@
-u
-Vlibapt-pkg
:major
=${LIBAPT_MAJOR}
104 # Build architecture-dependent files here.
106 binary-arch
: apt libapt-pkg-dev
107 apt
: build debian
/shlibs.local
115 cp
$(BLD
)/bin
/apt-
* debian
/tmp
/usr
/bin
/
117 # install the shared libs
118 find
$(BLD
)/bin
/ -type f
-name
"libapt-pkg.so.*" -exec cp
-a
"{}" debian
/tmp
/usr
/lib
/ \
;
119 find
$(BLD
)/bin
/ -type l
-name
"libapt-pkg.so.*" -exec cp
-a
"{}" debian
/tmp
/usr
/lib
/ \
;
121 cp
$(BLD
)/bin
/methods
/* debian
/tmp
/usr
/lib
/apt
/methods
/
123 cp
$(BLD
)/scripts
/dselect
/* debian
/tmp
/usr
/lib
/dpkg
/methods
/apt
/
124 # cp debian/sources.list debian/tmp/etc/apt/
126 # Copy the users guide
127 -cp
$(BLD
)/docs
/guide.text debian
/tmp
/usr
/doc
/apt
/users-guide.txt
128 -cp
-a
$(BLD
)/docs
/guide.html
/* debian
/tmp
/usr
/doc
/apt
/users-guide.html
/
130 # Copy the offline guide
131 -cp
$(BLD
)/docs
/offline.text debian
/tmp
/usr
/doc
/apt
/offline.txt
132 -cp
-a
$(BLD
)/docs
/offline.html
/* debian
/tmp
/usr
/doc
/apt
/offline.html
/
134 cp
-a debian
/dhelp debian
/tmp
/usr
/doc
/apt
/.dhelp
136 # head -n 500 ChangeLog > debian/ChangeLog
141 dh_installexamples
-papt
$(BLD
)/docs
/examples
/*
142 # dh_installmenu -papt
143 # dh_installinit -papt
144 # dh_installcron -papt
145 dh_installmanpages
-p
$@
147 # dh_undocumented -papt
148 dh_installchangelogs
-p
$@
152 # dh_suidregister -p$@
154 LD_LIBRARY_PATH
=`pwd`/debian
/tmp
/usr
/lib dh_shlibdeps
-papt
155 dh_gencontrol
-p
$@
-u
-Vlibapt-pkg
:major
=${LIBAPT_MAJOR}
156 dh_makeshlibs
-m
${LIBAPT_MAJOR} -Vlibapt-pkg
${LIBAPT_MAJOR} -papt
160 libapt-pkg-dev
: build debian
/shlibs.local
166 # libapt-pkg-dev install
168 ln
-s libapt-pkg.so.
${LIBAPT_MAJOR} debian
/libapt-pkg-dev
/usr
/lib
/libapt-pkg.so
169 cp
$(BLD
)/include/apt-pkg
/*.h debian
/libapt-pkg-dev
/usr
/include/apt-pkg
/
172 # dh_installmenu -papt
173 # dh_installinit -papt
174 # dh_installcron -papt
175 # dh_installmanpages -p$@
177 dh_installchangelogs
-p
$@
181 # dh_suidregister -p$@
183 dh_gencontrol
-p
$@
-u
-Vlibapt-pkg
:major
=${LIBAPT_MAJOR}
188 @echo
>&2 'source and diff are obsolete - use dpkg-source -b'; false
195 # Update from CVS and then configure for build
196 super-l33ch
: l33ch Makefile.in
201 l33ch-stamp
: super-l33ch
205 -find
-name Makefile.in
-print0 | xargs
-0r
rm -f
206 find
-name ChangeLog | xargs
rm -f
209 binary
: binary-indep binary-arch
210 .PHONY
: build
clean binary-indep binary-arch binary debian
/shlibs.local
213 # Done by the uploader.
215 #edit debian/changelog
216 # configure.in has the version automatically updated now.
218 # debian/rules cvs-build
221 rm -rf debian
/cvs-build
226 tar c
--exclude CVS
--exclude debian
/cvs-build . |\
227 (mkdir
-p debian
/cvs-build
/apt-
$(APT_DEBVER
);cd debian
/cvs-build
/apt-
$(APT_DEBVER
);tar x
)
228 # The next line isn't needed, as debuild will make the .tar.gz for us.
229 # (cd debian/cvs-build;tar zcf apt_$(APT_DEBVER).tar.gz apt-$(APT_DEBVER))
230 (cd debian
/cvs-build
/apt-
$(APT_DEBVER
);$(DEB_BUILD_PROG
))
234 -mkdir
-p ..
/upload-
$(APT_DEBVER
)
235 cp
`find debian/cvs-build -maxdepth 1 -type f` ..
/upload-
$(APT_DEBVER
)