- $(checkdir)
- rm -rf build
- rm -rf *~ debian/tmp debian/*~ debian/files* debian/substvars
-
-binary-indep: checkroot build
- $(checkdir)
-# There are no architecture-independent files to be uploaded
-# generated by this package. If there were any they would be
-# made here.
-
-binary-arch: checkroot build
- $(checkdir)
- rm -rf debian/tmp
- install -d debian/tmp/DEBIAN\
- -d debian/tmp/usr/share/doc/$(package)
- install -m 755 debian/postinst debian/prerm debian/tmp/DEBIAN
- install -m 644 debian/shlibs debian/tmp/DEBIAN
- cd build; $(MAKE) prefix=`pwd`/../debian/tmp/usr install
- if test -f doc/yaz.txt; then \
- install -m 644 doc/*.html doc/*.ps doc/*.txt debian/tmp/usr/share/doc/$(package); \
- else \
- install -m 644 build/doc/*.html build/doc/*.ps build/doc/*.txt debian/tmp/usr/share/doc/$(package); \
- fi
- gzip debian/tmp/usr/share/doc/$(package)/*.ps
- gzip debian/tmp/usr/share/doc/$(package)/*.txt
- cp debian/copyright debian/tmp/usr/share/doc/$(package)/.
- cp debian/changelog debian/tmp/usr/share/doc/$(package)/changelog.Debian
- cp CHANGELOG debian/tmp/usr/share/doc/$(package)/changelog
- strip --strip-debug debian/tmp/usr/lib/*.a
- strip --strip-unneeded debian/tmp/usr/lib/lib*.so.$(soversion)
- cp debian/shlibs debian/shlibs.local
- dpkg-shlibdeps debian/tmp/usr/bin/yaz-client debian/tmp/usr/bin/yaz-ztest
- dpkg-gencontrol
- chown -R root.root debian/tmp
- chmod -R g-ws debian/tmp
- dpkg --build debian/tmp ..
-
-define checkdir
- test -f debian/rules
-endef
-
-# Below here is fairly generic really
-
-binary: binary-indep binary-arch
-
-checkroot:
- $(checkdir)
- test root = "`whoami`"
-
-.PHONY: binary binary-arch binary-indep clean checkroot
+ dh_testdir
+ #dh_testroot
+ -rm -f stamp-*
+ -rm -rf build
+
+ dh_clean
+ -rm -rf debian/libyaz debian/libyaz-dev \
+ 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
+ dh_testdir
+ dh_testroot
+ dh_installdocs -p yaz-doc doc/*.html doc/*.pdf doc/*.png
+ dh_installchangelogs -p yaz-doc
+ dh_link -p yaz-doc
+ dh_strip -p yaz-doc
+ dh_compress -p yaz-doc
+ dh_fixperms -p yaz-doc
+ dh_gencontrol -p yaz-doc
+ dh_md5sums -p yaz-doc
+
+ dh_builddeb -p yaz-doc
+
+# Build architecture-dependent files here.
+binary-arch: build install
+ dh_testdir
+ dh_testroot
+ 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-asncomp usr/share/yaz/ill usr/share/yaz/z39.50
+ dh_movefiles -p yaz usr/bin
+ dh_movefiles -p libyaz usr/lib usr/share/yaz/etc
+ dh_installexamples -p libyaz-dev
+
+ cp LICENSE debian/copyright
+ cp CHANGELOG changelog
+ dh_installdocs --all README TODO changelog debian/copyright
+
+ dh_installchangelogs
+ dh_link
+
+ dh_installdeb -p libyaz
+ dh_installdeb -p libyaz-dev
+ dh_installdeb -p yaz
+
+ dh_installman -p libyaz-dev doc/yaz-config.8
+ dh_installman -p libyaz-dev doc/yaz-asncomp.1
+ dh_installman -p libyaz doc/yaz.7
+ dh_installman -p yaz doc/yaz-client.1 doc/yaz-ztest.8 doc/zoomsh.1
+ dh_installman -p yaz doc/yaz-client-ssl.1 doc/yaz-ztest-ssl.8
+
+ dh_strip
+ dh_compress -a
+ dh_fixperms -a
+
+ echo "libyaz 2 libyaz (>= 2.0.2)" > debian/libyaz/DEBIAN/shlibs
+ echo "libyazthread 2 libyaz (>= 2.0.2)" >> debian/libyaz/DEBIAN/shlibs
+ echo "libyazmalloc 2 libyaz (>= 2.0.2)" >> debian/libyaz/DEBIAN/shlibs
+ echo "libyazssl 2 libyaz (>= 2.0.2)" >> debian/libyaz/DEBIAN/shlibs
+ chmod 644 debian/libyaz/DEBIAN/shlibs
+ dh_shlibdeps -p libyaz $(LOCAL_LINK)
+
+ dh_gencontrol -p libyaz
+ dh_md5sums -p libyaz
+
+ dh_gencontrol -p libyaz-dev
+ dh_md5sums -p libyaz-dev
+
+ dh_gencontrol -p yaz
+ dh_md5sums -p yaz
+
+ # 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 -p libyaz
+ dh_builddeb -p libyaz-dev
+ dh_builddeb -p yaz
+
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install install-stamp configure
+
+yazrelease:
+ # Conveniency target for building YAZ
+ dh_testdir
+ dpkg-buildpackage $(EXTRA_OPTS) -rfakeroot