2 # Sample debian/rules that uses debhelper.
3 # GPL copyright 1997 to 1999 by Joey Hess.
5 # Uncomment this to turn on verbose mode.
8 # This is the debhelper compatability version to use.
12 CONFIG_FLAGS=--enable-static --enable-shared --enable-tcpd --prefix=/usr
14 # Enable parallel builds if CONCURRENCY_LEVEL is set
15 ifdef CONCURRENCY_LEVEL
16 MCFLAGS=-j$(CONCURRENCY_LEVEL)
21 ifeq ($(YAZ_WITH_SSL),1)
23 SSL_FLAGS=--with-openssl
24 DEVEL_NAME=yaz-devel-ssl
25 RUNTIME_NAME=yaz-runtime-ssl
29 RUNTIME_NAME=yaz-runtime
33 YAZSRCDIR=$(shell pwd)
34 YAZ_VERSION=$(shell date -r$(YAZSRCDIR)/CVS +"CVS%Y%m%d")
36 YAZSRCDIR=$(shell pwd)
40 configure: stamp-configure
43 cat debian/control.templ | sed -e "s/@YAZ_RUNTIME@/yaz-runtime-ssl/g; s/@YAZ_DEVEL@/yaz-devel-ssl/g; s/@YAZ_VERSION@/$(YAZ_VERSION)/g" > debian/control
45 cat debian/control.templ | sed -e "s/@YAZ_RUNTIME@/yaz-runtime/g; s/@YAZ_DEVEL@/yaz-devel/g; s/@YAZ_VERSION@/$(YAZ_VERSION)/g" > debian/control
52 cd build; $(YAZSRCDIR)/configure $(CONFIG_FLAGS) $(SSL_FLAGS)
55 @echo "Now configured for using YAZ-CVS checkout with datestamp $(YAZ_VERSION)"
60 stamp-build: stamp-configure
63 # Add here commands to compile the package.
64 $(MAKE) -C build $(MCFLAGS)
70 cat debian/control.templ | sed -e "s/@YAZ_RUNTIME@/yaz-runtime-ssl/g; s/@YAZ_DEVEL@/yaz-devel-ssl/g; s/@YAZ_VERSION@/$(YAZ_VERSION)/g" > debian/control
72 cat debian/control.templ | sed -e "s/@YAZ_RUNTIME@/yaz-runtime/g; s/@YAZ_DEVEL@/yaz-devel/g; s/@YAZ_VERSION@/$(YAZ_VERSION)/g" > debian/control
80 -rm -rf debian/yaz-runtime debian/yaz-runtime-ssl debian/yaz-devel \
81 debian/with-ssl debian/*.debhelper debian/substvars debian/shlibs.yaz-*
83 install: stamp-install
84 stamp-install: stamp-build
90 # Add here commands to install the package into debian/tmp.
91 -mkdirhier debian/tmp/usr
92 $(MAKE) -C build install prefix=`pwd`/debian/tmp/usr
96 # Build architecture-independent files here.
97 binary-indep: build install
98 # We have nothing to do by default.
100 # Build architecture-dependent files here.
101 binary-arch: build install
104 dh_movefiles -p $(DEVEL_NAME) usr/share/aclocal usr/lib/*.a usr/include usr/bin
105 dh_movefiles -p $(RUNTIME_NAME) usr/lib usr/share/yaz
106 dh_installexamples -p $(DEVEL_NAME)
108 dh_installdocs -p yaz-doc doc/
109 dh_installdocs --all README TODO LICENSE CHANGELOG
116 ifeq ($(BUILD_SSL),1)
118 #dh_makeshlibs -p $(RUNTIME_NAME) -V'libyaz 1 yaz-runtime-ssl' -V'libyazthread 1 yaz-runtime-ssl'
119 dh_shlibdeps -p $(RUNTIME_NAME) -- debian/$(RUNTIME_NAME)/usr/lib/*.so
120 dh_shlibdeps -p $(DEVEL_NAME) -- debian/$(DEVEL_NAME)/usr/bin/*
121 echo "libyaz 1 $(RUNTIME_NAME)" > debian/$(RUNTIME_NAME)/DEBIAN/shlibs
122 echo "libyazthread 1 $(RUNTIME_NAME)" >> debian/$(RUNTIME_NAME)/DEBIAN/shlibs
123 echo "libyazmalloc 1 $(RUNTIME_NAME)" >> debian/$(RUNTIME_NAME)/DEBIAN/shlibs
124 chmod 644 debian/$(RUNTIME_NAME)/DEBIAN/shlibs
126 # dh_shlibdeps -a -- debian/yaz-runtime-ssl/usr/lib/*.so debian/yaz-runtime-ssl/usr/bin/*
127 dh_gencontrol -p $(DEVEL_NAME) -u-DDepends="$(RUNTIME_NAME)"
128 dh_gencontrol -p $(RUNTIME_NAME) -u-DConflicts=yaz-runtime
134 #dh_makeshlibs -p $(RUNTIME_NAME) -V'libyaz 1 yaz-runtime' -V'libyazthread 1 yaz-runtime'
135 dh_makeshlibs -p $(RUNTIME_NAME)
139 dh_gencontrol -p $(RUNTIME_NAME) -u-DConflicts=yaz-runtime-ssl
142 # Go kill those CVS-dirs before build
143 -find debian/tmp -type d -name CVS | xargs rm -rf
144 # For some reason it is necessary to remove empty-dirs in yaz-doc
145 -rm -rf debian/tmp/usr/include debian/tmp/usr/share/aclocal debian/tmp/usr/lib debian/tmp/usr/bin \
146 debian/tmp/usr/share/yaz
151 binary: binary-indep binary-arch
152 .PHONY: build clean binary-indep binary-arch binary install install-stamp