3 # Script for building YAZ from source to .deb-packages.
5 # Created by Morten Hendriksen <mgh@dbc.dk> based on sample
6 # debhelper script from Joey Hess. GPL copyright 1997 to 1999 by Joey Hess.
8 # Uncomment this to turn on verbose mode.
11 # This is the debhelper compatability version to use.
14 CONFIG_FLAGS=--with-xml2=/usr --enable-static --enable-shared --enable-tcpd --prefix=/usr --with-openssl
16 # Enable parallel builds if CONCURRENCY_LEVEL is set
17 ifdef CONCURRENCY_LEVEL
18 MCFLAGS=-j$(CONCURRENCY_LEVEL)
23 YAZSRCDIR?=$(shell pwd)
25 # Local library path for linking with right dependencies
26 LOCAL_LINK=-ldebian/libyaz/usr/lib
28 $(YAZSRCDIR)/configure: $(YAZSRCDIR)/configure.in
29 cd $(YAZSRCDIR); sh buildconf.sh
31 stamp-configure: $(YAZSRCDIR)/configure
36 cd build; $(YAZSRCDIR)/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/libyaz debian/libyaz-dev \
56 debian/*.debhelper debian/substvars debian/shlibs.yaz-*
58 install: stamp-install
59 stamp-install: stamp-build
65 # Add here commands to install the package into debian/tmp.
66 -mkdirhier debian/tmp/usr
67 $(MAKE) -C build install prefix=`pwd`/debian/tmp/usr
71 # Build architecture-independent files here.
72 binary-indep: build install
75 dh_installdocs -p yaz-doc doc/*.html doc/*.pdf doc/*.png
76 dh_installchangelogs -p yaz-doc
79 dh_compress -p yaz-doc
80 dh_fixperms -p yaz-doc
81 dh_gencontrol -p yaz-doc
84 dh_builddeb -p yaz-doc
86 # Build architecture-dependent files here.
87 binary-arch: build install
90 dh_movefiles -p libyaz-dev usr/share/aclocal usr/lib/*.a usr/lib/*.la usr/lib/*.so usr/include usr/bin/yaz-config usr/bin/yaz-comp usr/share/yaz
91 dh_movefiles -p yaz usr/bin
92 dh_movefiles -p libyaz usr/lib
93 dh_installexamples -p libyaz-dev
95 cp LICENSE debian/copyright
96 cp CHANGELOG changelog
97 dh_installdocs --all README TODO changelog debian/copyright
105 dh_installdeb -p libyaz
106 dh_installdeb -p libyaz-dev
109 dh_installman -p libyaz-dev doc/yaz-config.8
110 dh_undocumented -p libyaz-dev yaz-comp.1
111 dh_installman -p libyaz doc/yaz.7
112 dh_installman -p yaz doc/yaz-client.1 doc/yaz-ztest.8 doc/zoomsh.1
113 dh_installman -p yaz doc/yaz-client-ssl.1 doc/yaz-ztest-ssl.8
115 echo "libyaz 2 libyaz (>= 2.0.2)" > debian/libyaz/DEBIAN/shlibs
116 echo "libyazthread 2 libyaz (>= 2.0.2)" >> debian/libyaz/DEBIAN/shlibs
117 echo "libyazmalloc 2 libyaz (>= 2.0.2)" >> debian/libyaz/DEBIAN/shlibs
118 echo "libyazssl 2 libyaz (>= 2.0.2)" >> debian/libyaz/DEBIAN/shlibs
119 chmod 644 debian/libyaz/DEBIAN/shlibs
120 dh_shlibdeps -p libyaz $(LOCAL_LINK)
121 cat debian/postinst >> debian/libyaz/DEBIAN/postinst
123 dh_gencontrol -p libyaz
126 dh_gencontrol -p libyaz-dev
127 dh_md5sums -p libyaz-dev
132 # Go kill those CVS-dirs before build
133 -find debian/tmp -type d -name CVS | xargs rm -rf
134 # For some reason it is necessary to remove empty-dirs in yaz-doc
135 -rm -rf debian/tmp/usr/include debian/tmp/usr/share/aclocal debian/tmp/usr/lib debian/tmp/usr/bin \
136 debian/tmp/usr/share/yaz
138 dh_builddeb -p libyaz
139 dh_builddeb -p libyaz-dev
143 binary: binary-indep binary-arch
144 .PHONY: build clean binary-indep binary-arch binary install install-stamp configure
147 # Conveniency target for building YAZ
149 dpkg-buildpackage $(EXTRA_OPTS) -rfakeroot