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 configure: stamp-configure
36 stamp-configure: $(ZEBRASRCDIR)/configure
41 cd build; $(ZEBRASRCDIR)/configure $(CONFIG_FLAGS)
45 stamp-build: stamp-configure
48 # Add here commands to compile the package.
49 $(MAKE) -C build $(MCFLAGS)
60 -rm -rf debian/idzebra debian/*.debhelper debian/substvars
62 install: stamp-install
63 stamp-install: stamp-build
69 # Add here commands to install the package into debian/tmp.
70 -mkdirhier debian/tmp/usr
71 $(MAKE) -C build install prefix=`pwd`/debian/tmp/usr
75 # Build architecture-independent files here.
76 binary-indep: build install
79 dh_installdocs -p idzebra-doc doc/
80 dh_installchangelogs -p idzebra-doc
81 dh_link -p idzebra-doc
82 dh_strip -p idzebra-doc
83 dh_compress -p idzebra-doc
84 dh_fixperms -p idzebra-doc
85 dh_gencontrol -p idzebra-doc
86 dh_md5sums -p idzebra-doc
88 dh_builddeb -p idzebra-doc
90 # Build architecture-dependent files here.
91 binary-arch: build install
94 dh_movefiles -p idzebra usr/share/zebra usr/bin
96 cp LICENSE.zebra debian/copyright
97 cp CHANGELOG changelog
98 dh_installdocs --all README TODO changelog debian/copyright
106 dh_installdeb -p idzebra
107 dh_undocumented -p idzebra zebraidx.1 zebrasrv.1
108 dh_shlibdeps -p idzebra $(LOCAL_LINK)
111 cat debian/postinst >> debian/idzebra/DEBIAN/postinst
113 dh_gencontrol -p idzebra
114 dh_md5sums -p idzebra
116 # Go kill those CVS-dirs before build
117 -find debian/tmp -type d -name CVS | xargs rm -rf
118 # For some reason it is necessary to remove empty-dirs in doc
119 -rm -rf debian/tmp/usr/include debian/tmp/usr/share/aclocal debian/tmp/usr/lib debian/tmp/usr/bin \
120 debian/tmp/usr/share/zebra
122 dh_builddeb -p idzebra
125 binary: binary-indep binary-arch
126 .PHONY: build clean binary-indep binary-arch binary install install-stamp configure
129 # Conveniency target for building zebra
131 dpkg-buildpackage $(EXTRA_OPTS) -rfakeroot