Debian package
[ir-tcl-moved-to-github.git] / debian / rules
1 #!/usr/bin/make -f
2
3 # Script for building Zebra from source to .deb-packages.
4 #
5 # Created by Adam Dickmeiss, based on script by
6 # Morten Hendriksen <mgh@dbc.dk>  and from Joey Hess.
7
8 # Uncomment this to turn on verbose mode.
9 #export DH_VERBOSE=1
10
11 # This is the debhelper compatability version to use.
12 export DH_COMPAT=2
13
14 CONFIG_FLAGS=--with-tclconfig=/usr/lib/tcl8.3 --with-yazconfig=/usr/bin --prefix=/usr
15
16 # Enable parallel builds if CONCURRENCY_LEVEL is set
17 ifdef CONCURRENCY_LEVEL
18 MCFLAGS=-j$(CONCURRENCY_LEVEL)
19 else
20 MCFLAGS=
21 endif
22
23 IRTCL_VERSION=1.4
24 IRTCLDIR?=$(shell pwd)
25 # If this is not IndexData's release, then it is a cvs-checkout. Go cheat!
26 #   YAZ_VERSION:=$(YAZ_VERSION)-$(shell date -r$(YAZSRCDIR)/CVS +"CVS%Y%m%d")
27 export IRTCL_VERSION
28
29 # Local library path for linking with right dependencies
30 LOCAL_LINK=-ldebian/ir-tcl/usr/lib
31
32 configure: configure.in
33         autoconf
34
35 stamp-configure: configure
36         dh_testdir
37
38         ./configure $(CONFIG_FLAGS) --with-build-root=$(IRTCLDIR)/debian/tmp
39         touch stamp-configure
40
41 build: stamp-build
42 stamp-build: stamp-configure
43         dh_testdir
44
45         # Add here commands to compile the package.
46         $(MAKE) $(MCFLAGS)
47         cd doc; $(MAKE) $(MCFLAGS)
48
49         touch stamp-build
50
51 clean:
52         dh_testdir
53         #dh_testroot
54         -rm -f stamp-*
55         rm -f *.o *.so *.a config.* irclient
56
57         dh_clean
58         -rm -rf debian/ir-tcl debian/*.debhelper debian/substvars
59
60 install: stamp-install
61 stamp-install: stamp-build
62         dh_testdir
63         dh_testroot
64         dh_clean -k -a
65         dh_installdirs -a
66
67         # Add here commands to install the package into debian/tmp.
68         -mkdirhier debian/tmp/usr
69         $(MAKE) install
70         # $(MAKE) install prefix=`pwd`/debian/tmp/usr
71
72         touch stamp-install
73
74 # Build architecture-independent files here.
75 binary-indep: build install
76         dh_testdir
77         dh_testroot
78         dh_installdocs -p ir-tcl-doc doc/
79         dh_installchangelogs -p ir-tcl-doc
80         dh_link -p ir-tcl-doc
81         dh_strip -p ir-tcl-doc
82         dh_compress -p ir-tcl-doc
83         dh_fixperms -p ir-tcl-doc
84         dh_gencontrol -p ir-tcl-doc
85         dh_md5sums -p ir-tcl-doc
86
87         dh_builddeb -p ir-tcl-doc
88
89 # Build architecture-dependent files here.
90 binary-arch: build install
91         dh_testdir
92         dh_testroot
93         dh_movefiles -p ir-tcl usr/lib/ir-tcl usr/bin
94
95         cp CHANGELOG changelog
96         cp LICENSE debian/copyright
97         dh_installdocs --all README changelog debian/copyright
98
99         dh_installchangelogs
100         dh_link
101         dh_strip
102         dh_compress -a
103         dh_fixperms -a
104
105         dh_installdeb -p irtcl
106         # dh_undocumented -p ir-tcl.1
107         dh_shlibdeps -p ir-tcl
108
109         dh_gencontrol -p ir-tcl
110         dh_md5sums -p ir-tcl
111
112         # Go kill those CVS-dirs before build
113         -find debian/tmp -type d -name CVS | xargs rm -rf
114         # For some reason it is necessary to remove empty-dirs in doc
115         -rm -rf debian/tmp/usr/include debian/tmp/usr/lib debian/tmp/usr/bin \
116                 debian/tmp/usr/lib/ir-tcl
117
118         dh_builddeb -p ir-tcl
119
120 binary: binary-indep binary-arch
121 .PHONY: build clean binary-indep binary-arch binary install install-stamp configure
122