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 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
# This target makes sure that timestamps of files are in the
# right order after dpkg-deb has unpacked the package. It prevents
# the upstream Makefile from trying to regenerate the files (which
# would be problematic because we don't build-depend on the appropriate
# tools).
autogen-check: configure bibclean.h
dh_testdir
touch configure
touch bibclean.h
config.status: autogen-check
CFLAGS="$(CFLAGS)" ./configure \
--with-pager=/usr/bin/pager --with-fhs-rcfiles \
--host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
--prefix=/usr --mandir=\$${prefix}/share/man
build: build-arch build-indep
build-stamp: config.status
$(MAKE)
$(MAKE) -C ./doc bibclean.dvi
touch build-stamp
clean: autogen-check
[ -z "`find -uid 0`" ] || dh_testroot
rm -f build-stamp
[ ! -f Makefile ] || $(MAKE) -o config.status -o Makefile.in distclean
rm -f Makefile
dh_clean
install: build
dh_testdir
dh_testroot
dh_prep
dh_installdirs
$(MAKE) install-exe prefix=$(CURDIR)/debian/bibclean/usr
mv debian/bibclean/usr/share/bibcleanrc debian/bibclean/etc/
rm debian/bibclean/usr/bin/bibclean-*
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.
# Build architecture-dependent files here.
binary-arch: build install
echo misc:Depends= > debian/bibclean.substvars
dh_testdir
dh_testroot
dh_installdirs $(LINTIAN)
dh_installdocs doc/bibclean.dvi
dh_installman bibclean.man
dh_installchangelogs ChangeLog
dh_strip
dh_compress
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
rm -f debian/bibclean.substvars
binary: binary-indep binary-arch
# build targets as suggested by explanation to lintian warning
build-arch: build-stamp
build-indep: build-stamp
.PHONY: build clean binary-indep binary-arch binary install autogen-check
# The following two rules will should not fire when the Debian source
# package is unpacked, because the two files in question should already
# exist in that case. However, they *will* fire for a clean checkout
# of my cvs repository, e.g. when cvs-buildpackage runs the clean
# target before creating a source package.
configure:
dh_testdir
autoconf2.13
# Special magic to reproduce the same layout as the bibclean.h
# distributed by upstream:
bibclean.h:
dh_testdir
make -f Makefile.in AWK=awk NROFF='nroff -rLL=74n' SED=sed bibclean.h
perl -pi -e's/" /"/' bibclean.h
|