NEWS instead of CHANGELOG. Revert lines in NEWS
[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 IRTCLDIR?=$(shell pwd)
24
25 # Local library path for linking with right dependencies
26 LOCAL_LINK=-ldebian/ir-tcl/usr/lib
27
28 configure: configure.in
29         autoconf
30
31 stamp-configure: configure
32         dh_testdir
33
34         ./configure $(CONFIG_FLAGS) --with-build-root=$(IRTCLDIR)/debian/tmp
35         touch stamp-configure
36
37 build: stamp-build
38 stamp-build: stamp-configure
39         dh_testdir
40
41         # Add here commands to compile the package.
42         $(MAKE) $(MCFLAGS)
43         cd doc; $(MAKE) $(MCFLAGS)
44
45         touch stamp-build
46
47 clean:
48         dh_testdir
49         #dh_testroot
50         -rm -f stamp-*
51         rm -f *.o *.so *.a config.* irclient
52
53         dh_clean
54         -rm -rf debian/ir-tcl debian/*.debhelper debian/substvars
55
56 install: stamp-install
57 stamp-install: stamp-build
58         dh_testdir
59         dh_testroot
60         dh_clean -k -a
61         dh_installdirs -a
62
63         # Add here commands to install the package into debian/tmp.
64         -mkdirhier debian/tmp/usr
65         $(MAKE) install
66         # $(MAKE) install prefix=`pwd`/debian/tmp/usr
67
68         touch stamp-install
69
70 # Build architecture-independent files here.
71 binary-indep: build install
72         dh_testdir
73         dh_testroot
74         dh_installdocs -p ir-tcl-doc doc/*.html doc/*.txt doc/*.ps
75         dh_installchangelogs -p ir-tcl-doc
76         dh_link -p ir-tcl-doc
77         dh_strip -p ir-tcl-doc
78         dh_compress -p ir-tcl-doc
79         dh_fixperms -p ir-tcl-doc
80         dh_gencontrol -p ir-tcl-doc
81         dh_md5sums -p ir-tcl-doc
82
83         dh_builddeb -p ir-tcl-doc
84
85 # Build architecture-dependent files here.
86 binary-arch: build install
87         dh_testdir
88         dh_testroot
89         dh_movefiles -p ir-tcl usr/lib/irtcl usr/bin
90
91         cp NEWS changelog
92         cp LICENSE debian/copyright
93         dh_installdocs --all README changelog debian/copyright
94
95         dh_installchangelogs
96         dh_link
97         dh_strip
98         dh_compress -a
99         dh_fixperms -a
100
101         dh_installdeb -p ir-tcl
102         for i in doc/*.n; do \
103                 m=`echo $$i|sed 's/\.n/.3tcl/g'`; \
104                 cp $$i $$m; \
105         done
106         dh_installman -p ir-tcl doc/*.3tcl
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
117         dh_builddeb -p ir-tcl
118
119 binary: binary-indep binary-arch
120 .PHONY: build clean binary-indep binary-arch binary install install-stamp configure
121