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