3 # Script for building Zebra from source to .deb-packages.
5 # Created by Adam Dickmeiss, based on script by
6 # Morten Hendriksen <mgh@dbc.dk> and from Joey Hess.
8 # Uncomment this to turn on verbose mode.
11 # This is the debhelper compatability version to use.
14 CONFIG_FLAGS=--with-tclconfig=/usr/lib/tcl8.3 --with-yazconfig=/usr/bin --prefix=/usr
16 # Enable parallel builds if CONCURRENCY_LEVEL is set
17 ifdef CONCURRENCY_LEVEL
18 MCFLAGS=-j$(CONCURRENCY_LEVEL)
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")
29 # Local library path for linking with right dependencies
30 LOCAL_LINK=-ldebian/idzebra/usr/lib
32 $(ZEBRASRCDIR)/configure: $(ZEBRASRCDIR)/configure.in
33 cd $(ZEBRASRCDIR); sh buildconf.sh
35 stamp-configure: $(ZEBRASRCDIR)/configure
40 cd build; $(ZEBRASRCDIR)/configure $(CONFIG_FLAGS)
44 stamp-build: stamp-configure
47 # Add here commands to compile the package.
48 $(MAKE) -C build $(MCFLAGS)
59 -rm -rf debian/idzebra debian/*.debhelper debian/substvars
61 install: stamp-install
62 stamp-install: stamp-build
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
74 # Build architecture-independent files here.
75 binary-indep: build install
78 dh_installdocs -p idzebra-doc doc/
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
87 dh_builddeb -p idzebra-doc
89 # Build architecture-dependent files here.
90 binary-arch: build install
93 dh_movefiles -p idzebra usr/share/idzebra usr/bin
95 cp CHANGELOG changelog
96 dh_installdocs --all README TODO changelog debian/copyright
104 dh_installdeb -p idzebra
105 dh_undocumented -p idzebra zebraidx.1 zebrasrv.1
106 dh_shlibdeps -p idzebra $(LOCAL_LINK)
108 cat debian/postinst >> debian/idzebra/DEBIAN/postinst
110 dh_gencontrol -p idzebra
111 dh_md5sums -p idzebra
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
119 dh_builddeb -p idzebra
121 binary: binary-indep binary-arch
122 .PHONY: build clean binary-indep binary-arch binary install install-stamp configure
125 # Conveniency target for building zebra
127 dpkg-buildpackage $(EXTRA_OPTS) -rfakeroot