0 | 0 |
#!/usr/bin/make -f
|
1 | |
# debian/rules file to build the "datefudge" Debian package.
|
2 | |
# GNU copyright 2002-2003 by Matthias Urlichs.
|
|
1 |
# This file is public domain software, originally written by Joey Hess.
|
3 | 2 |
|
4 | |
export CC=gcc
|
5 | |
export CFLAGS=-g -Wall
|
|
3 |
# Uncomment this to turn on verbose mode.
|
|
4 |
#export DH_VERBOSE=1
|
|
5 |
|
|
6 |
export CFLAGS = -g -Wall
|
6 | 7 |
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
7 | 8 |
CFLAGS += -O0
|
8 | 9 |
else
|
9 | 10 |
CFLAGS += -O2
|
10 | 11 |
endif
|
11 | |
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
12 | |
STRIP := strip --strip-unneeded \
|
13 | |
--remove-section=.comment --remove-section=.note
|
14 | |
else
|
15 | |
STRIP := :
|
16 | |
endif
|
17 | 12 |
|
18 | |
build-arch: build-stamp
|
|
13 |
build: build-stamp
|
19 | 14 |
build-stamp:
|
20 | |
@if ! test -f debian/control ; then echo "No debian/control file found!" >&2 ; exit 1; fi
|
|
15 |
dh_testdir
|
21 | 16 |
|
22 | 17 |
$(MAKE)
|
23 | 18 |
|
24 | 19 |
touch build-stamp
|
25 | 20 |
|
26 | 21 |
clean:
|
27 | |
@if ! test -f debian/control ; then echo "No debian/control file found!" >&2 ; exit 1; fi
|
28 | |
@if ! test $$(id -u) -eq 0 ; then echo "You are not root!" >&2 ; exit 1 ; fi
|
|
22 |
dh_testdir
|
|
23 |
dh_testroot
|
29 | 24 |
rm -f build-stamp
|
30 | 25 |
|
31 | |
-$(MAKE) clean
|
|
26 |
$(MAKE) clean
|
32 | 27 |
|
33 | |
-rm -f debian/substvars debian/files
|
34 | |
-rm -rf debian/tmp
|
|
28 |
dh_clean
|
35 | 29 |
|
36 | 30 |
install: build
|
37 | |
@if ! test -f debian/control ; then echo "No debian/control file found!" >&2 ; exit 1; fi
|
38 | |
@if ! test $$(id -u) -eq 0 ; then echo "You are not root!" >&2 ; exit 1 ; fi
|
|
31 |
dh_testdir
|
|
32 |
dh_testroot
|
|
33 |
dh_clean -k
|
|
34 |
dh_installdirs
|
39 | 35 |
|
40 | |
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
|
|
36 |
$(MAKE) install DESTDIR=$(CURDIR)/debian/datefudge
|
41 | 37 |
|
42 | |
# architecture-independent stuff
|
43 | |
build-indep binary-indep:
|
44 | |
# Nothing to do. (In fact there is, but it's too small to split.)
|
45 | |
build: build-arch build-indep
|
|
38 |
binary-indep: build install
|
46 | 39 |
|
47 | |
# architecture-dependent stuff
|
48 | 40 |
binary-arch: build install
|
49 | |
@if ! test -f debian/control ; then echo "No debian/control file found!" >&2 ; exit 1; fi
|
50 | |
@if ! test $$(id -u) -eq 0 ; then echo "You are not root!" >&2 ; exit 1 ; fi
|
51 | |
mkdir -p debian/tmp/DEBIAN
|
52 | |
|
53 | |
# install docs
|
54 | |
mkdir -p debian/tmp/usr/share/doc/datefudge
|
55 | |
chmod 755 debian/tmp/usr/share/doc
|
56 | |
chmod 755 debian/tmp/usr/share/doc/datefudge
|
57 | |
install -o root -g root -m 644 README debian/tmp/usr/share/doc/datefudge
|
58 | |
install -o root -g root -m 644 debian/copyright debian/tmp/usr/share/doc/datefudge
|
59 | |
install -o root -g root -m 644 debian/changelog debian/tmp/usr/share/doc/datefudge
|
60 | |
gzip -9f debian/tmp/usr/share/doc/datefudge/changelog
|
61 | |
gzip -9f debian/tmp/usr/share/man/man1/datefudge.1
|
62 | |
|
63 | |
# strip library and install control files
|
64 | |
$(STRIP) debian/tmp/usr/lib/datefudge.so
|
65 | |
dpkg-shlibdeps debian/tmp/usr/lib/datefudge.so
|
66 | |
|
67 | |
#install -m 644 debian/shlibs debian/tmp/DEBIAN
|
68 | |
install -d debian/tmp/usr/share/lintian/overrides
|
69 | |
install -m 644 debian/overrides debian/tmp/usr/share/lintian/overrides/datefudge
|
70 | |
dpkg-gencontrol -isp
|
71 | |
|
72 | |
cd debian/tmp; find . -type f ! -regex '.*/DEBIAN/.*' -printf '%P\0' | xargs -r0 md5sum > DEBIAN/md5sums
|
73 | |
chmod 644 debian/tmp/DEBIAN/md5sums
|
74 | |
dpkg-deb --build debian/tmp ..
|
|
41 |
dh_testdir
|
|
42 |
dh_testroot
|
|
43 |
dh_installchangelogs
|
|
44 |
dh_installdocs README
|
|
45 |
dh_installman
|
|
46 |
dh_link
|
|
47 |
dh_strip
|
|
48 |
dh_compress
|
|
49 |
dh_fixperms
|
|
50 |
dh_installdeb
|
|
51 |
dh_shlibdeps
|
|
52 |
dh_gencontrol
|
|
53 |
dh_md5sums
|
|
54 |
dh_builddeb
|
75 | 55 |
|
76 | 56 |
binary: binary-indep binary-arch
|
77 | |
.PHONY: build clean binary-indep binary-arch binary binary-arch \
|
78 | |
build-indep build-arch install
|
|
57 |
.PHONY: build clean binary-indep binary-arch binary install
|