fix over-zealous global search and replace of 'win32' token in rules
[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 buildarch := $(shell dpkg-architecture -qDEB_BUILD_ARCH)
15 ifeq ($(buildarch),amd64)
16 CFLAGS=-g -O2 -Wall -DUNALIGNED_OK
17 else
18 CFLAGS=-g -O2 -Wall
19 endif
20
21 reconf-stamp:
22         cp -f /usr/share/misc/config.sub build-aux/config.sub
23         cp -f /usr/share/misc/config.guess build-aux/config.guess
24         autoreconf -v
25
26 configure: configure-stamp
27 configure-stamp: reconf-stamp
28         dh_testdir
29         mkdir -p build
30         cd build && ../configure \
31                 --prefix=/usr --bindir=/bin \
32                 --infodir=`pwd`/debian/gzip/usr/share/info \
33                 --mandir=`pwd`/debian/gzip/usr/share/man $(CONFARGS)
34         touch configure-stamp
35
36 configure-indep: configure-indep-stamp
37 configure-indep-stamp: reconf-stamp
38         dh_testdir
39         mkdir -p build-indep
40         cd build-indep && ../configure --host=i686-w64-mingw32
41         touch configure-indep-stamp
42
43 build: build-arch build-indep
44
45 build-arch: build-stamp 
46 build-stamp: configure-stamp
47         dh_testdir
48         $(MAKE) -C build
49         touch build-stamp
50
51 build-indep: build-indep-stamp
52 build-indep-stamp: configure-indep-stamp
53         dh_testdir
54         $(MAKE) -C build-indep
55         touch build-indep-stamp
56
57 clean:
58         dh_testdir
59         dh_testroot
60         -rm -f build-stamp build-indep-stamp configure-stamp configure-indep-stamp reconf-stamp
61         -rm -rf build build-indep
62         dh_clean
63
64 install: build
65         dh_testdir
66         dh_testroot
67         dh_clean -k
68         dh_installdirs
69         $(MAKE) -C build install prefix=`pwd`/debian/gzip/usr bindir=`pwd`/debian/gzip/bin 
70
71 install-indep: build-indep
72         dh_testdir
73         dh_testroot
74         dh_clean -k
75         dh_installdirs
76         i686-w64-mingw32-strip build-indep/gzip.exe
77         install -m 0755 build-indep/gzip.exe debian/gzip-win32/usr/share/win32/
78
79 binary-indep:   build-indep install-indep
80         dh_testdir -i
81         dh_testroot -i
82         dh_installdocs -i README* TODO
83         dh_installchangelogs -i ChangeLog
84         dh_lintian -i
85         dh_compress -i
86         dh_fixperms -i
87         dh_installdeb -i
88         dh_gencontrol -i
89         dh_md5sums -i
90         dh_builddeb -i
91
92 binary-arch:    build install
93         dh_testdir -s
94         dh_testroot -s
95         dh_installdocs -s README* TODO
96         dh_installman *.1
97         dh_installinfo -s doc/gzip.info
98         dh_installchangelogs -s ChangeLog
99         dh_link -s
100         dh_lintian -s
101         dh_strip -s
102         dh_compress -s
103         ln -s gunzip.1.gz debian/gzip/usr/share/man/man1/uncompress.1.gz
104         ln -s zgrep.1.gz debian/gzip/usr/share/man/man1/zegrep.1.gz
105         ln -s zgrep.1.gz debian/gzip/usr/share/man/man1/zfgrep.1.gz
106         dh_fixperms -s
107         # You may want to make some executables suid here.
108         dh_makeshlibs -s
109         dh_installdeb -s
110         dh_shlibdeps -s
111         dh_gencontrol -s
112         dh_md5sums -s
113         dh_builddeb -s
114
115 binary: binary-indep binary-arch
116 .PHONY: build clean binary-indep binary-arch binary install configure
117 .PHONY: build-indep install-indep configure-indep
118