Code

Rewrote rules to use debhelper.
authorSebastian Harl <sh@tokkee.org>
Wed, 1 Nov 2006 13:07:10 +0000 (13:07 +0000)
committerSebastian Harl <sh@tokkee.org>
Wed, 1 Nov 2006 13:07:10 +0000 (13:07 +0000)
* Set compat level to 5.
* Changed debmake build dependency to debhelper (>= 5).

debian/compat [new file with mode: 0644]
debian/control
debian/rules

diff --git a/debian/compat b/debian/compat
new file mode 100644 (file)
index 0000000..7ed6ff8
--- /dev/null
@@ -0,0 +1 @@
+5
index ff6f80a21bca5eff8e49e4e29796e5ce5437ff7f..ffac80bd7c67aad1ee306a251312b21ce2e33423 100644 (file)
@@ -2,7 +2,8 @@ Source: cadaver
 Section: web
 Priority: optional
 Maintainer: Bernd Eckenfels <ecki@debian.org>
-Build-Depends: libncurses5-dev, libxml2-dev | libxml-dev, libreadline5-dev, zlib1g-dev (>= 1:1.1.3), libssl-dev (>= 0.9.6f), debmake
+Build-Depends: debhelper (>= 5), libncurses5-dev, libxml2-dev | libxml-dev, 
+ libreadline5-dev, zlib1g-dev (>= 1:1.1.3), libssl-dev (>= 0.9.6f)
 Standards-Version: 3.6.1
 
 Package: cadaver
index edb4efa1fb846d10bcade46615cd4b262658ee2c..1fdc8d05ff47d09bb3b492363b6eb1189231c799 100755 (executable)
@@ -1,57 +1,82 @@
 #!/usr/bin/make -f
-# Copyright Bernd Eckenfels Thu,  6 Jan 2000 10:04:56 +0100. It's GPL
-# Made with the aid of debmake, by Christoph Lameter,
-# based on the sample debian/rules file for GNU hello by Ian Jackson.
+# debian/rules for cadaver
+#
+# Written by Sebastian Harl <sh@tokkee.org>.
 
-package=cadaver
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
 
-build:
-       $(checkdir)
-       -rm config.cache
-       # this configure will watch DEB_BUILD_OPTIONS for CFLAGS (-g)
-       ./configure --prefix=/usr --enable-warnings --with-included-neon --enable-netrc --without-ssl
-       $(MAKE)
-       touch build
+# 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
+
+BUILDDIR = ./debian/build/
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       CFLAGS += -O0
+else
+       CFLAGS += -O2
+endif
+
+$(BUILDDIR)/config.status: configure
+       dh_testdir
+       [ -e $(BUILDDIR) ] || mkdir $(BUILDDIR)
+       cd $(BUILDDIR) && CFLAGS="$(CFLAGS)" ../../configure \
+                       --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) \
+                       --prefix=/usr --mandir=\$${prefix}/share/man \
+                       --enable-warnings --enable-netrc --without-ssl
+
+build: build-stamp
+
+build-stamp: $(BUILDDIR)/config.status
+       dh_testdir
+       dh_clean
+       
+       cp -r ./src/ $(BUILDDIR)
+       $(MAKE) -C $(BUILDDIR)
+       
+       touch build-stamp
 
 clean:
-       $(checkdir)
-       -rm -f build
-       -$(MAKE) clean
-       -(cd po ; rm -f Makefile.in POTFILES cat-id-tbl.c stamp-cat-id ; $(MAKE) distclean)
-       -(cd intl ; $(MAKE) distclean)
-       -(cd libneon ; $(MAKE) clean ; rm Makefile)
-       -rm -f `find . -name "*~"`
-       -rm -f config.h config.status config.log config.cache Makefile
-       -rm -rf debian/tmp debian/files* core 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
-       cd debian/tmp && install -d `cat ../dirs`
-       $(MAKE) install prefix=`pwd`/debian/tmp/usr
-# Must have debmake installed for this to work. Otherwise please copy
-# /usr/bin/debstd into the debian directory and change debstd to debian/debstd
-       debstd ChangeLog INTEROP FAQ NEWS README TODO THANKS cadaver.lsm.in
-       dpkg-gencontrol -isp
-       chown -R root.root debian/tmp
-       chmod -R go=rX debian/tmp
-       dpkg --build debian/tmp ..
-
-define checkdir
-       test -f debian/rules
-endef
+       dh_testdir
+       dh_testroot
+       rm -f build-stamp
+       
+       rm -rf $(BUILDDIR)
+       
+       dh_clean
 
-binary: binary-indep binary-arch
+install: build
+       dh_testdir
+       dh_testroot
+       dh_clean -k
+       dh_installdirs
+       
+       $(MAKE) -C $(BUILDDIR) install prefix=$(CURDIR)/debian/cadaver/usr
+
+binary-indep:
+       # nothing to do here
 
-checkroot:
-       $(checkdir)
-       test root = "`whoami`"
+binary-arch: build install
+       dh_testdir
+       dh_testroot
+       dh_installchangelogs -a ChangeLog
+       dh_installdocs -a BUGS FAQ INTEROP NEWS README THANKS TODO
+       dh_installmenu -a
+       dh_installman -a
+       dh_link -a
+       dh_strip -a
+       dh_compress -a
+       dh_fixperms -a
+       dh_installdeb -a
+       dh_shlibdeps -a
+       dh_gencontrol -a
+       dh_md5sums -a
+       dh_builddeb -a
+
+binary: binary-indep binary-arch
+.PHONY: build clean install binary-indep binary-arch binary
 
-.PHONY: binary binary-arch binary-indep clean checkroot