Tizen 2.0 Release
[external/mawk.git] / debian / rules
1 #!/usr/bin/make -f
2 # debian/rules file - for Mawk (1.3.3)
3 # Based on sample debian/rules file - for GNU Hello (1.3).
4 # Copyright 1994,1995 by Ian Jackson.
5 # Copyright 2001-2003 James Troup
6 # I hereby give you perpetual unlimited permission to copy,
7 # modify and relicense this file, provided that you do not remove
8 # my name from the file itself.  (I assert my moral right of
9 # paternity under the Copyright, Designs and Patents Act 1988.)
10 # This file may have to be extensively modified
11
12 install_dir=install -d -m 755
13 install_file=install -m 644
14 install_script=install -m 755
15 install_binary=install -m 755 -s
16
17 include /usr/share/dpatch/dpatch.make
18
19 build: patch-stamp
20         $(checkdir)
21         chmod 755 configure test/mawktest test/fpe_test
22         ./configure
23         $(MAKE) CC="$(CC)" CFLAGS="-g -Wall -O2" LDFLAGS="$(LDFLAGS)" mawk
24         touch build
25
26 clean: clean-patched unpatch
27         -rm -rf debian/patched
28
29 clean-patched:
30         $(checkdir)
31         -rm -f build parse.c parse.h
32         [ ! -f Makefile ] || make distclean
33         -rm -f man/index.db
34         -rm -rf debian/tmp debian/substvars debian/files*
35         find . -name \*~ | xargs rm -vf
36
37 binary-indep:
38
39 binary-arch:    checkroot build
40         $(checkdir)
41         rm -rf debian/tmp
42
43         $(install_dir) debian/tmp/DEBIAN
44         $(install_script) debian/prerm debian/postinst debian/tmp/DEBIAN/
45
46         $(install_dir) debian/tmp/usr/bin
47         $(install_binary) mawk debian/tmp/usr/bin/
48
49         $(install_dir) debian/tmp/usr/share/man/man1
50         $(install_file) man/mawk.1  debian/tmp/usr/share/man/man1/
51         gzip -9v debian/tmp/usr/share/man/man1/mawk.1
52
53         $(install_dir) debian/tmp/usr/share/doc/mawk/
54         $(install_file) CHANGES debian/tmp/usr/share/doc/mawk/changelog
55         $(install_file) debian/changelog debian/tmp/usr/share/doc/mawk/changelog.Debian
56         $(install_file) README ACKNOWLEDGMENT debian/tmp/usr/share/doc/mawk/
57         gzip  -9v debian/tmp/usr/share/doc/mawk/*
58
59         $(install_dir) debian/tmp/usr/share/doc/mawk/examples
60         $(install_file) examples/* debian/tmp/usr/share/doc/mawk/examples/
61         gzip -9v debian/tmp/usr/share/doc/mawk/examples/*
62
63         $(install_file) debian/copyright debian/tmp/usr/share/doc/mawk/
64
65         dpkg-shlibdeps mawk
66         dpkg-gencontrol -isp
67         chown -R root.root debian/tmp
68         chmod -R go=rX debian/tmp
69         dpkg --build debian/tmp ..
70
71 # Below here is fairly generic really
72
73 binary:         binary-indep binary-arch
74
75 checkroot:
76         $(checkdir)
77         test root = "`whoami`"
78
79 .PHONY: binary binary-arch binary-indep clean checkroot