3f9891e0ab9d746975a959d5a51ad69bb4731e4a
[debian/gzip] / debian / rules
1 #!/usr/bin/make -f
2 #       Debian rules file for gzip, requires the debhelper package.
3 #       Crafted by Bdale Garbee, bdale@gag.com, 5 November 2000
4
5 # Comment this to turn off debhelper verbose mode.
6 export DH_VERBOSE=1
7
8 DEB_BUILD_GNU_TYPE = $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
9 DEB_HOST_GNU_TYPE = $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
10 ifneq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
11 CONFARGS = --host=$(DEB_HOST_GNU_TYPE)
12 endif
13
14 ifeq ($(shell dpkg-architecture -qDEB_HOST_ARCH),amd64)
15 CFLAGS=-g -O2 -Wall -DUNALIGNED_OK
16 else
17 CFLAGS=-g -O2 -Wall
18 endif
19
20 reconf-stamp:
21         cp -f /usr/share/misc/config.sub build-aux/config.sub
22         cp -f /usr/share/misc/config.guess build-aux/config.guess
23         autoreconf -v
24
25 configure: configure-stamp
26 configure-stamp: reconf-stamp
27         dh_testdir
28         mkdir -p build
29         cd build && ../configure \
30                 --prefix=/usr --bindir=/bin \
31                 --infodir=`pwd`/debian/gzip/usr/share/info \
32                 --mandir=`pwd`/debian/gzip/usr/share/man $(CONFARGS)
33         touch configure-stamp
34
35 configure-indep: configure-indep-stamp
36 configure-indep-stamp: reconf-stamp
37         dh_testdir
38         mkdir -p build-indep
39         cd build-indep && ../configure --host=i686-w64-mingw32
40         touch configure-indep-stamp
41
42 build: build-arch build-indep
43
44 build-arch: build-stamp 
45 build-stamp: configure-stamp
46         dh_testdir
47         $(MAKE) -C build
48 ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
49 ifeq ($(DEB_BUILD_GNU_TYPE),$(DEB_HOST_GNU_TYPE))
50         $(MAKE) -C build check
51 endif
52 endif
53         touch build-stamp
54
55 build-indep: build-indep-stamp
56 build-indep-stamp: configure-indep-stamp
57         dh_testdir
58         $(MAKE) -C build-indep
59         touch build-indep-stamp
60
61 clean:
62         dh_testdir
63         dh_testroot
64         -rm -f build-stamp build-indep-stamp configure-stamp configure-indep-stamp reconf-stamp
65         -rm -rf build build-indep
66         dh_clean
67
68 install: build
69         dh_testdir
70         dh_testroot
71         dh_clean -k
72         dh_installdirs
73         $(MAKE) -C build install prefix=`pwd`/debian/gzip/usr bindir=`pwd`/debian/gzip/bin 
74
75 install-indep: build-indep
76         dh_testdir
77         dh_testroot
78         dh_clean -k
79         dh_installdirs
80         i686-w64-mingw32-strip build-indep/gzip.exe
81         install -m 0755 build-indep/gzip.exe debian/gzip-win32/usr/share/win32/
82
83 binary-indep:   build-indep install-indep
84         dh_testdir -i
85         dh_testroot -i
86         dh_installdocs -i README* TODO
87         dh_installchangelogs -i ChangeLog
88         dh_lintian -i
89         dh_compress -i
90         dh_fixperms -i
91         dh_installdeb -i
92         dh_gencontrol -i
93         dh_md5sums -i
94         dh_builddeb -i
95
96 binary-arch:    build install
97         dh_testdir -s
98         dh_testroot -s
99         dh_installdocs -s README* TODO
100         dh_installman *.1
101         dh_installinfo -s doc/gzip.info
102         dh_installchangelogs -s ChangeLog
103         dh_link -s
104         dh_lintian -s
105         dh_strip -s
106         dh_compress -s
107         ln -s gunzip.1.gz debian/gzip/usr/share/man/man1/uncompress.1.gz
108         ln -s zgrep.1.gz debian/gzip/usr/share/man/man1/zegrep.1.gz
109         ln -s zgrep.1.gz debian/gzip/usr/share/man/man1/zfgrep.1.gz
110         dh_fixperms -s
111         # You may want to make some executables suid here.
112         dh_makeshlibs -s
113         dh_installdeb -s
114         dh_shlibdeps -s
115         dh_gencontrol -s
116         dh_md5sums -s
117         dh_builddeb -s
118
119 binary: binary-indep binary-arch
120 .PHONY: build clean binary-indep binary-arch binary install configure
121 .PHONY: build-indep install-indep configure-indep
122