chiark / gitweb /
gitignore
[chiark-tcl.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # chiark-tcl - various Tcl bindings and extensions
4 # Copyright 2006 Ian Jackson
5 #
6 # This program is free software; you can redistribute it and/or
7 # modify it under the terms of the GNU General Public License as
8 # published by the Free Software Foundation; either version 2 of the
9 # License, or (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful, but
12 # WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 # General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this library; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 # 02110-1301, USA.
20
21
22 majversion=1
23 srcpackage=chiark-tcl
24 libpackage=libtcl-chiark-$(majversion)
25 docpackage=libtcl-chiark-$(majversion)
26 docdir=usr/share/doc/$(docpackage)
27
28 tclh:=$(firstword $(wildcard /usr/include/tcl8.*/tcl.h))
29 tclversion:=$(patsubst /usr/include/tcl%/tcl.h,%,$(tclh))
30
31 define checkdir
32         test -f hbytes/hbytes.tct
33 endef
34
35 build: build-arch build-indep
36 build-arch:
37         $(checkdir)
38         $(MAKE) prefix=/usr VERSION=$(majversion) TCL_VERSION=$(tclversion)
39
40 build-indep:
41
42 clean:
43         $(checkdir)
44         $(MAKE) clean
45         rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars*
46         dh_clean
47
48 binary-indep:
49
50 binary-arch:    checkroot build
51         $(checkdir)
52         -rm -rf debian/$(docpackage) debian/$(libpackage)
53         install -d debian/$(libpackage)/usr/lib
54         install -d debian/$(docpackage)/usr/share/doc/$(docpackage)
55
56         set -e; for f in lintian; do                                         \
57                 install -d debian/$(libpackage)/usr/share/$$f/overrides;     \
58                 cp debian/$$f-overrides                                      \
59                  debian/$(libpackage)/usr/share/$$f/overrides/$(libpackage); \
60                 done
61
62         cp */*.so debian/$(libpackage)/usr/lib/.
63
64         set -e; for f in */*.[ch]; do                                   \
65                 perl debian/extractdoc <$$f                             \
66                         debian/$(docpackage)/$(docdir)/ $$f .txt;       \
67                 done
68         cp */*.tct debian/README debian/copyright \
69                 debian/$(docpackage)/$(docdir)
70
71         dh_installchangelogs
72         dh_strip
73
74         dh_makeshlibs
75         dh_shlibdeps -Xchiark_tcl_adns -Xchiark_tcl_crypto
76
77         # be consistent about what we compress:
78         dh_compress -X.c.txt -X.h.txt
79
80         dh_fixperms
81         dh_installdeb
82         dh_gencontrol
83         dh_md5sums
84         dh_builddeb
85
86 # Below here is fairly generic really
87
88 binary:         binary-indep binary-arch
89
90 source diff:
91         @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
92
93 checkroot:
94         $(checkdir)
95         dh_testroot
96
97 .PHONY: binary binary-arch binary-indep clean checkroot