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)
23 ZEBRASRCDIR?=$(shell pwd)
25 # Local library path for linking with right dependencies
26 LOCAL_LINK=-ldebian/idzebra/usr/lib
28 $(ZEBRASRCDIR)/configure: $(ZEBRASRCDIR)/configure.in
29 cd $(ZEBRASRCDIR); sh buildconf.sh
31 stamp-configure: $(ZEBRASRCDIR)/configure
36 cd build; $(ZEBRASRCDIR)/configure $(CONFIG_FLAGS)
40 stamp-build: stamp-configure
43 # Add here commands to compile the package.
44 $(MAKE) -C build $(MCFLAGS)
55 -rm -rf debian/idzebra debian/*.debhelper debian/substvars
57 install: stamp-install
58 stamp-install: stamp-build
64 # Add here commands to install the package into debian/tmp.
65 -mkdirhier debian/tmp/usr
66 $(MAKE) -C build install prefix=`pwd`/debian/tmp/usr
70 # Build architecture-independent files here.
71 binary-indep: build install
74 #dh_installdocs -p idzebra-doc doc/*.html doc/*.pdf doc/*.png
75 dh_installdocs -p idzebra-doc debian/tmp/usr/share/doc/idzebra/*.html debian/tmp/usr/share/doc/idzebra/*.pdf debian/tmp/usr/share/doc/idzebra/*.png
76 dh_installchangelogs -p idzebra-doc
77 dh_link -p idzebra-doc
78 dh_strip -p idzebra-doc
79 dh_compress -p idzebra-doc
80 dh_fixperms -p idzebra-doc
81 dh_gencontrol -p idzebra-doc
82 dh_md5sums -p idzebra-doc
84 dh_builddeb -p idzebra-doc
86 # Build architecture-dependent files here.
87 binary-arch: build install
90 dh_movefiles -p idzebra usr/share/idzebra usr/bin
93 dh_installdocs --all README TODO changelog debian/copyright
98 dh_installdeb -p idzebra
99 #dh_installman -p idzebra doc/zebraidx.1 doc/zebrasrv.8
100 dh_installman -p idzebra debian/tmp/usr/man/man1/zebraidx.1 debian/tmp/usr/man/man8/zebrasrv.8
106 dh_shlibdeps -p idzebra $(LOCAL_LINK)
108 cat debian/postinst >> debian/idzebra/DEBIAN/postinst
109 chmod +x debian/idzebra/DEBIAN/postinst
111 dh_gencontrol -p idzebra
112 dh_md5sums -p idzebra
114 # Go kill those CVS-dirs before build
115 -find debian/tmp -type d -name CVS | xargs rm -rf
116 # For some reason it is necessary to remove empty-dirs in doc
117 -rm -rf debian/tmp/usr/include debian/tmp/usr/share/aclocal debian/tmp/usr/lib debian/tmp/usr/bin \
118 debian/tmp/usr/share/idzebra
120 dh_builddeb -p idzebra
122 binary: binary-indep binary-arch
123 .PHONY: build clean binary-indep binary-arch binary install install-stamp configure
126 # Conveniency target for building zebra
128 dpkg-buildpackage $(EXTRA_OPTS) -rfakeroot