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 --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/zebra-runtime/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/zebra-runtime 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 zebra-doc doc/
80 dh_installchangelogs -p zebra-doc
83 dh_compress -p zebra-doc
84 dh_fixperms -p zebra-doc
85 dh_gencontrol -p zebra-doc
86 dh_md5sums -p zebra-doc
88 dh_builddeb -p zebra-doc
90 # Build architecture-dependent files here.
91 binary-arch: build install
94 dh_movefiles -p zebra-runtime 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 zebra-runtime
107 dh_installdeb -p zebra-devel
108 dh_undocumented -p zebra-runtime zebraidx.1 zebrasrv.1
109 dh_shlibdeps -p zebra-runtime $(LOCAL_LINK)
112 cat debian/postinst >> debian/zebra-runtime/DEBIAN/postinst
114 dh_gencontrol -p zebra-runtime
115 dh_md5sums -p zebra-runtime
117 # Go kill those CVS-dirs before build
118 -find debian/tmp -type d -name CVS | xargs rm -rf
119 # For some reason it is necessary to remove empty-dirs in zebra-doc
120 -rm -rf debian/tmp/usr/include debian/tmp/usr/share/aclocal debian/tmp/usr/lib debian/tmp/usr/bin \
121 debian/tmp/usr/share/zebra
123 dh_builddeb -p zebra-runtime
126 binary: binary-indep binary-arch
127 .PHONY: build clean binary-indep binary-arch binary install install-stamp configure
130 # Conveniency target for building zebra
132 dpkg-buildpackage $(EXTRA_OPTS) -rfakeroot