Fix search for complete fields. Update version
[idzebra-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 ZEBRA_VERSION=1.3.3
24 ZEBRASRCDIR?=$(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 ZEBRA_VERSION
28
29 # Local library path for linking with right dependencies
30 LOCAL_LINK=-ldebian/idzebra/usr/lib
31
32 $(ZEBRASRCDIR)/configure: $(ZEBRASRCDIR)/configure.in
33         cd $(ZEBRASRCDIR); sh buildconf.sh
34
35 stamp-configure: $(ZEBRASRCDIR)/configure
36         dh_testdir
37
38         -rm -rf build
39         mkdir build
40         cd build; $(ZEBRASRCDIR)/configure $(CONFIG_FLAGS)
41         touch stamp-configure
42
43 build: stamp-build
44 stamp-build: stamp-configure
45         dh_testdir
46
47         # Add here commands to compile the package.
48         $(MAKE) -C build $(MCFLAGS)
49
50         touch stamp-build
51
52 clean:
53         dh_testdir
54         #dh_testroot
55         -rm -f stamp-*
56         -rm -rf build
57
58         dh_clean
59         -rm -rf debian/idzebra debian/*.debhelper debian/substvars
60
61 install: stamp-install
62 stamp-install: stamp-build
63         dh_testdir
64         dh_testroot
65         dh_clean -k -a
66         dh_installdirs -a
67
68         # Add here commands to install the package into debian/tmp.
69         -mkdirhier debian/tmp/usr
70         $(MAKE) -C build 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 idzebra-doc doc/*.html doc/*.pdf
79         dh_installchangelogs -p idzebra-doc
80         dh_link -p idzebra-doc
81         dh_strip -p idzebra-doc
82         dh_compress -p idzebra-doc
83         dh_fixperms -p idzebra-doc
84         dh_gencontrol -p idzebra-doc
85         dh_md5sums -p idzebra-doc
86
87         dh_builddeb -p idzebra-doc
88
89 # Build architecture-dependent files here.
90 binary-arch: build install
91         dh_testdir
92         dh_testroot
93         dh_movefiles -p idzebra usr/share/idzebra usr/bin
94
95         cp CHANGELOG changelog
96         dh_installdocs --all README TODO changelog debian/copyright
97
98         dh_installchangelogs
99         dh_link
100         dh_strip
101         dh_compress -a
102         dh_fixperms -a
103
104         dh_installdeb -p idzebra
105         dh_undocumented -p idzebra zebraidx.1 zebrasrv.1
106         dh_shlibdeps -p idzebra $(LOCAL_LINK) 
107
108         cat debian/postinst >> debian/idzebra/DEBIAN/postinst
109
110         dh_gencontrol -p idzebra
111         dh_md5sums -p idzebra
112
113         # Go kill those CVS-dirs before build
114         -find debian/tmp -type d -name CVS | xargs rm -rf
115         # For some reason it is necessary to remove empty-dirs in doc
116         -rm -rf debian/tmp/usr/include debian/tmp/usr/share/aclocal debian/tmp/usr/lib debian/tmp/usr/bin \
117                 debian/tmp/usr/share/idzebra
118
119         dh_builddeb -p idzebra
120
121 binary: binary-indep binary-arch
122 .PHONY: build clean binary-indep binary-arch binary install install-stamp configure
123
124 zebrarelease:
125         # Conveniency target for building zebra
126         dh_testdir
127         dpkg-buildpackage $(EXTRA_OPTS) -rfakeroot