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