Version 3.0.45
[yaz-moved-to-github.git] / debian / rules
index c08f2d7..cde609f 100755 (executable)
 #!/usr/bin/make -f
-# Debian rules for YAZ
-# $Id: rules,v 1.1 2001-05-28 12:44:03 adam Exp $
-#
-# Sample debian/rules file - for GNU Hello (1.3).
-# Copyright 1994,1995 by Ian Jackson.
-# I hereby give you perpetual unlimited permission to copy,
-# modify and relicense this file, provided that you do not remove
-# my name from the file itself.  (I assert my moral right of
-# paternity under the Copyright, Designs and Patents Act 1988.)
-# This file may have to be extensively modified
-
-package=yaz
-version=1.0.0
-
-build:
-       $(checkdir)
-       ./configure --prefix=/usr --enable-shared
-       $(MAKE) CFLAGS=-O2 
-       cd doc; $(MAKE) CFLAGS=-O2 
-       touch build
+# -*- makefile -*-
+# Sample debian/rules that uses debhelper.
+# GNU copyright 1997 to 1999 by Joey Hess.
+
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
+
+# Force compat level four
+export DH_COMPAT=4
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+
+CFLAGS = -Wall -g
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+else
+       CFLAGS += -O2
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+       INSTALL_PROGRAM += -s
+endif
+
+
+config.status: configure
+       dh_testdir
+       # Add here commands to configure the package.
+       CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-shared --enable-static --enable-tcpd --with-xslt --with-gnutls --with-icu
+
+
+build: build-stamp
+build-stamp:  config.status
+       dh_testdir
+
+       # Add here commands to compile the package.
+       $(MAKE)
+
+       touch build-stamp
 
 clean:
-       $(checkdir)
-       rm -f build
-       -$(MAKE) -i distclean
-       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
-       $(MAKE) prefix=`pwd`/debian/tmp/usr install
-       install -m 644 doc/*.html debian/tmp/usr/share/doc/$(package)
-       install -m 644 doc/*.ps debian/tmp/usr/share/doc/$(package)
-       install -m 644 doc/*.txt debian/tmp/usr/share/doc/$(package)
-       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.$(version)
-       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 build-stamp 
+
+       # Add here commands to clean up after the build process.
+       -$(MAKE) distclean
+ifneq "$(wildcard /usr/share/misc/config.sub)" ""
+       -cp -f /usr/share/misc/config.sub config.sub
+endif
+ifneq "$(wildcard /usr/share/misc/config.guess)" ""
+       -cp -f /usr/share/misc/config.guess config.guess
+endif
+
+       dh_clean 
+
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k 
+       dh_installdirs
+
+       # Add here commands to install the package into debian/tmp
+       $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
+
+
+# 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
+       cp LICENSE debian/copyright
+       dh_installdocs -A README
+       dh_installchangelogs 
+       dh_installexamples
+       mv debian/tmp/usr/share/doc/yaz debian/tmp/usr/share/doc/yaz-doc
+       dh_install 
+#      dh_installmenu
+#      dh_installdebconf       
+#      dh_installlogrotate
+#      dh_installemacsen
+#      dh_installpam
+#      dh_installmime
+#      dh_installinit
+#      dh_installcron
+#      dh_installinfo
+       dh_installman
+       dh_link
+       dh_strip
+       dh_compress
+       dh_fixperms
+#      dh_perl
+#      dh_python
+       dh_makeshlibs -V 'libyaz3 (>= 3.0.45)'
+       dh_installdeb
+       dh_shlibdeps  -l debian/libyaz3/usr/lib
+       dh_gencontrol
+       dh_md5sums
+       dh_builddeb
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install