Debian Codegraph @

debian/rules

raw
1 #!/usr/bin/make -f
2
3 testdir = test -f src/lrz.c && test -f debian/rules
4
5 export DEB_CFLAGS_MAINT_APPEND = -std=gnu17
6
7 include /usr/share/dpkg/architecture.mk
8
9 ifeq ($(origin CC),default)
10 CC = $(DEB_HOST_GNU_TYPE)-gcc
11 endif
12 export CC
13
14 export AUTOHEADER=true
15
16 CPPFLAGS = $(shell dpkg-buildflags --get CPPFLAGS)
17 CFLAGS = $(shell dpkg-buildflags --get CFLAGS)
18 LDFLAGS = $(shell dpkg-buildflags --get LDFLAGS)
19 BUILD_DATE=$(shell dpkg-parsechangelog --show-field Date)
20 export CPPFLAGS
21 export CFLAGS
22 export LDFLAGS
23
24 build: build-arch build-indep
25
26 build-arch: build-stamp
27
28 build-indep: build-stamp
29
30 build-stamp:
31 $(testdir)
32 touch config.rpath
33 dh_autoreconf
34 dh_auto_configure -- --disable-nls --disable-rpath --prefix=/usr --mandir='$${prefix}/share/man' --program-transform-name=s/l//
35 $(MAKE)
36 touch $@
37
38 clean:
39 $(testdir)
40 # Neutralise the autotools while cleaning. The build-time dh_autoreconf
41 # regenerates Makefile.in with automake's maintainer-mode rebuild rules. On a
42 # second build "make clean" would otherwise see Makefile.am newer than the
43 # leftover Makefile.in and re-run automake against the pre-modern configure.in,
44 # which automake >= 1.16 rejects. Forcing the tools to ":" turns those rebuild
45 # rules into harmless no-ops; the assignments propagate to the sub-makes.
46 [ ! -f Makefile ] || $(MAKE) clean ACLOCAL=: AUTOCONF=: AUTOMAKE=: AUTOHEADER=:
47 dh_autoreconf_clean
48 dh_clean
49 rm -rf debian/tmp
50 rm -f build-stamp po/lrzsz.pot po/*.gmo debian/substvars
51 # Remove the files produced by configure/config.status. "make clean" only
52 # deletes objects and binaries, leaving these behind; on a rebuild they would
53 # count as unexpected changes to the 3.0 (quilt) upstream tree and make
54 # dpkg-source -b abort. They are all generated from .in templates shipped in
55 # the orig tarball, so removing them restores the pristine (patched) source.
56 rm -f Makefile config.h config.log config.status stamp-h stamp-h1 \
57 Specfile systype src/lrzszbug \
58 intl/Makefile lib/Makefile man/Makefile src/Makefile \
59 testsuite/Makefile po/Makefile po/Makefile.in
60
61 binary: binary-arch binary-indep
62
63 binary-arch: build
64 $(testdir)
65 rm -rf debian/tmp
66
67 $(MAKE) prefix=$(CURDIR)/debian/tmp/usr install
68
69 ifeq "$(findstring nostrip,$(DEB_BUILD_OPTIONS))" ""
70 $(DEB_HOST_GNU_TYPE)-strip -R .comment -R .note debian/tmp/usr/bin/*
71 endif
72
73 install -d -m 0755 debian/tmp/usr/share/doc/lrzsz
74 install -p -m 0644 NEWS README README.cvs README.isdn4linux TODO debian/copyright debian/tmp/usr/share/doc/lrzsz
75 install -p -m 0644 -D ChangeLog debian/tmp/usr/share/doc/lrzsz/changelog
76 install -p -m 0644 -D debian/changelog debian/tmp/usr/share/doc/lrzsz/changelog.Debian
77
78 find debian/tmp/usr/share/man -type f -print0 | xargs -0 gzip -9n
79 find debian/tmp/usr/share/doc -type f ! -name copyright ! -name '*.html' \
80 \( -name 'changelog*' -o -size +8 \) -print0 | xargs -0 gzip -9n
81
82 ln -s rz.1.gz debian/tmp/usr/share/man/man1/rb.1.gz
83 ln -s rz.1.gz debian/tmp/usr/share/man/man1/rx.1.gz
84 ln -s sz.1.gz debian/tmp/usr/share/man/man1/sb.1.gz
85 ln -s sz.1.gz debian/tmp/usr/share/man/man1/sx.1.gz
86
87 install -d -m 0755 debian/tmp/DEBIAN
88 install -p -m 0644 debian/control debian/tmp/DEBIAN
89 cd debian/tmp && find usr -type f -print0 | LC_ALL=C sort -z | xargs -0 md5sum > DEBIAN/md5sums
90
91 chmod -R go=u-w debian/tmp
92
93 dpkg-shlibdeps debian/tmp/usr/bin/*
94 # This hand-written rules file does not run the debhelper tools that would
95 # normally define ${misc:Depends}; declare it empty so the substvar referenced
96 # in debian/control resolves without a warning (no debhelper-added deps here).
97 echo 'misc:Depends=' >> debian/substvars
98 dpkg-gencontrol -plrzsz
99 find debian/tmp -depth -newermt '$(BUILD_DATE)' -print0 | xargs -0r touch --no-dereference --date='$(BUILD_DATE)'
100 dpkg-deb --root-owner-group --build debian/tmp ..
101
102 binary-indep:
103
104 .PHONY: clean build build-arch build-indep binary binary-arch binary-indep