File: rules

package info (click to toggle)
bibclean 2.11.4-5
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 5,204 kB
  • ctags: 1,545
  • sloc: ansic: 10,711; makefile: 817; perl: 65; sh: 40; awk: 27; sed: 6
file content (102 lines) | stat: -rwxr-xr-x 2,871 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# This is the debhelper compatibility version to use.
export DH_COMPAT=4

# 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-stamp

build-stamp: config.status
	$(MAKE)
	touch build-stamp

clean: autogen-check
	[ -z "`find -uid 0`" ] || dh_testroot
	rm -f build-stamp
	-$(MAKE) -o config.status -o Makefile.in distclean
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k
	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.

LINTIAN=usr/share/lintian/overrides

# 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
	cp debian/overrides debian/bibclean/$(LINTIAN)/bibclean
	dh_installman bibclean.man
	dh_installchangelogs ChangeLog
	dh_strip
	dh_compress
	dh_fixperms
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.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