-configure: stamp-configure
-stamp-configure:
-ifeq ($(BUILD_SSL),1)
- 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
-else
- 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
-endif
- touch stamp-configure
- dh_testdir
-
- -rm -rf build
- mkdir build
- cd build; $(YAZSRCDIR)/configure $(CONFIG_FLAGS) $(SSL_FLAGS)
-
-ifdef DEB_YAZ_USE_CVS
- @echo "Now configured for using YAZ-CVS checkout with datestamp $(YAZ_VERSION)"
-endif
-
-
-build: stamp-build
-stamp-build: stamp-configure
- dh_testdir
-
- # Add here commands to compile the package.
- $(MAKE) -C build $(MCFLAGS)
-
- touch stamp-build
-
-clean:
-ifeq ($(BUILD_SSL),1)
- 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
-else
- 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
-endif
- dh_testdir
- #dh_testroot
- -rm -f stamp-*
- -rm -rf build
-
- dh_clean
- -rm -rf debian/yaz-runtime debian/yaz-runtime-ssl debian/yaz-devel \
- debian/with-ssl debian/*.debhelper debian/substvars debian/shlibs.yaz-*
-
-install: stamp-install
-stamp-install: stamp-build
- dh_testdir
- dh_testroot
- dh_clean -k -a
- dh_installdirs -a
-
- # Add here commands to install the package into debian/tmp.
- -mkdirhier debian/tmp/usr
- $(MAKE) -C build install prefix=`pwd`/debian/tmp/usr
-
- touch stamp-install
-
-# Build architecture-independent files here.
-binary-indep: build install
-# We have nothing to do by default.
-
-# Build architecture-dependent files here.
-binary-arch: build install
- dh_testdir
- dh_testroot
- dh_movefiles -p $(DEVEL_NAME) usr/share/aclocal usr/lib/*.a usr/include usr/bin
- dh_movefiles -p $(RUNTIME_NAME) usr/lib usr/share/yaz
- dh_installexamples -p $(DEVEL_NAME)
-
- dh_installdocs -p yaz-doc doc/
- dh_installdocs --all README TODO LICENSE CHANGELOG
- dh_installchangelogs
- dh_link
- dh_strip
- dh_compress -a
- dh_fixperms -a
-
-ifeq ($(BUILD_SSL),1)
- dh_installdeb -a
- #dh_makeshlibs -p $(RUNTIME_NAME) -V'libyaz 1 yaz-runtime-ssl' -V'libyazthread 1 yaz-runtime-ssl'
- dh_shlibdeps -p $(RUNTIME_NAME) -- debian/$(RUNTIME_NAME)/usr/lib/*.so
- dh_shlibdeps -p $(DEVEL_NAME) -- debian/$(DEVEL_NAME)/usr/bin/*
- echo "libyaz 1 $(RUNTIME_NAME)" > debian/$(RUNTIME_NAME)/DEBIAN/shlibs
- echo "libyazthread 1 $(RUNTIME_NAME)" >> debian/$(RUNTIME_NAME)/DEBIAN/shlibs
- echo "libyazmalloc 1 $(RUNTIME_NAME)" >> debian/$(RUNTIME_NAME)/DEBIAN/shlibs
- chmod 644 debian/$(RUNTIME_NAME)/DEBIAN/shlibs
-
-# dh_shlibdeps -a -- debian/yaz-runtime-ssl/usr/lib/*.so debian/yaz-runtime-ssl/usr/bin/*
- dh_gencontrol -p $(DEVEL_NAME) -u-DDepends="$(RUNTIME_NAME)"
- dh_gencontrol -p $(RUNTIME_NAME) -u-DConflicts=yaz-runtime
- dh_gencontrol -a
-
-else
- dh_installdeb -a
-
- #dh_makeshlibs -p $(RUNTIME_NAME) -V'libyaz 1 yaz-runtime' -V'libyazthread 1 yaz-runtime'
- dh_makeshlibs -p $(RUNTIME_NAME)
- dh_shlibdeps -a
-
- dh_gencontrol -a
- dh_gencontrol -p $(RUNTIME_NAME) -u-DConflicts=yaz-runtime-ssl
-endif
- dh_md5sums -a
- # Go kill those CVS-dirs before build
- -find debian/tmp -type d -name CVS | xargs rm -rf
- # For some reason it is necessary to remove empty-dirs in yaz-doc
- -rm -rf debian/tmp/usr/include debian/tmp/usr/share/aclocal debian/tmp/usr/lib debian/tmp/usr/bin \
- debian/tmp/usr/share/yaz
-
- dh_builddeb
-
-
-binary: binary-indep binary-arch
-.PHONY: build clean binary-indep binary-arch binary install install-stamp