chiark / gitweb /
debian: Replace Debian build system with CDBS.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 27 Dec 2008 00:02:57 +0000 (00:02 +0000)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 27 Dec 2008 13:46:09 +0000 (13:46 +0000)
Somewhat fiddly to get the ADNS build to work, but still simpler than
the one before.

debian/.gitignore
debian/clean [new file with mode: 0644]
debian/mlib-bin.install [new file with mode: 0644]
debian/mlib-dev.install [new file with mode: 0644]
debian/mlib2-adns.install [new file with mode: 0644]
debian/mlib2.install [new file with mode: 0644]
debian/rules

index 5760211..dcad8f7 100644 (file)
@@ -1,10 +1,16 @@
+## General stuff.
 files
-mlib-dev
 tmp
+tmp-*
 substvars
 *.debhelper
-mlib
 *.substvars
+compat
+stamp-*
+*.log
+
+## Individual packages.
 mlib2
 mlib2-adns
 mlib-bin
+mlib-dev
diff --git a/debian/clean b/debian/clean
new file mode 100644 (file)
index 0000000..7825f92
--- /dev/null
@@ -0,0 +1 @@
+tmp-adns
diff --git a/debian/mlib-bin.install b/debian/mlib-bin.install
new file mode 100644 (file)
index 0000000..58cd505
--- /dev/null
@@ -0,0 +1,2 @@
+debian/tmp/usr/bin
+debian/tmp/usr/share/man/man1
diff --git a/debian/mlib-dev.install b/debian/mlib-dev.install
new file mode 100644 (file)
index 0000000..2a4e59c
--- /dev/null
@@ -0,0 +1,5 @@
+debian/tmp/usr/include
+debian/tmp/usr/lib/libmLib.a
+debian/tmp/usr/lib/libmLib.so
+debian/tmp/usr/lib/pkgconfig
+debian/tmp/usr/share/man/man3
diff --git a/debian/mlib2-adns.install b/debian/mlib2-adns.install
new file mode 100644 (file)
index 0000000..db8e227
--- /dev/null
@@ -0,0 +1 @@
+debian/tmp-adns/usr/lib/libmLib.so.* /usr/lib
diff --git a/debian/mlib2.install b/debian/mlib2.install
new file mode 100644 (file)
index 0000000..68af946
--- /dev/null
@@ -0,0 +1,2 @@
+debian/tmp/usr/lib/libmLib.so.*
+debian/tmp/usr/lib/mlib/bres
index a4e5864..5545dd1 100755 (executable)
@@ -1,82 +1,42 @@
 #! /usr/bin/make -f
 
-export DH_COMPAT = 4
+CDBS = /usr/share/cdbs/1
 
-build:
-       rm -rf deb-build deb-noadns build; mkdir deb-build deb-noadns
-       cd deb-build; ../configure \
-               --with-adns \
-               --prefix=/usr \
-               --mandir=/usr/share/man \
-               --libexecdir=/usr/lib
-       make -C deb-build
-       make -C deb-build check
-       cd deb-noadns; ../configure \
-               --without-adns \
-               --prefix=/usr \
-               --mandir=/usr/share/man \
-               --libexecdir=/usr/lib
-       make -C deb-noadns
-       make -C deb-noadns check
-       touch build
+include $(CDBS)/rules/debhelper.mk
+include $(CDBS)/class/autotools.mk
 
-clean:
-       dh_clean
-       rm -rf deb-build deb-noadns build
+###--------------------------------------------------------------------------
+### General settings.
 
-install: build
-       dh_clean
-       make -C deb-noadns install DESTDIR=`pwd`/debian/mlib2
-       mkdir -p debian/mlib-dev/usr/lib
-       mkdir -p debian/mlib-dev/usr/share/man
-       mkdir -p debian/mlib-dev/usr/bin
-       mkdir -p debian/mlib-dev/usr/lib/pkgconfig
-       mv debian/mlib2/usr/lib/pkgconfig/mLib.pc \
-         debian/mlib-dev/usr/lib/pkgconfig/
-       mv debian/mlib2/usr/share/man/man3 debian/mlib-dev/usr/share/man
-       mv debian/mlib2/usr/lib/*.a debian/mlib-dev/usr/lib
-       mv debian/mlib2/usr/lib/*.so debian/mlib-dev/usr/lib
-       mv debian/mlib2/usr/lib/*.la debian/mlib-dev/usr/lib
-       mv debian/mlib2/usr/include debian/mlib-dev/usr
-       mkdir -p debian/mlib-bin/usr/share/man
-       mv debian/mlib2/usr/bin debian/mlib-bin/usr
-       mv debian/mlib2/usr/share/man/man1 debian/mlib-bin/usr/share/man
-       make -C deb-build install DESTDIR=`pwd`/debian/mlib2-adns
-       rmdir debian/mlib2-adns/usr/lib/mLib
-       rm -rf debian/mlib2-adns/usr/bin
-       rm -rf debian/mlib2-adns/usr/lib/pkgconfig
-       rm -rf debian/mlib2-adns/usr/share/man
-       rm -rf debian/mlib2-adns/usr/include
-       rm debian/mlib2-adns/usr/lib/*.a
-       rm debian/mlib2-adns/usr/lib/*.so
-       rm debian/mlib2-adns/usr/lib/*.la
-       dh_strip -a
+DEB_BUILDDIR = $(CURDIR)/build
+DEB_MAKE_CHECK_TARGET = check
 
-binary-indep:
+DEB_CONFIGURE_EXTRA_FLAGS = --without-adns
+DEB_CONFIGURE_LIBEXECDIR = "\$${prefix}/lib"
 
-binary-arch: install
-       dh_testdir -a
-       dh_testroot -a
-       dh_makeshlibs -a -V"mlib2 (>= 2.0.3) | mlib2-adns (>= 2.0.3)"
-       dh_installman -a
-       dh_compress -a
-       dh_installdocs -a
-       dh_strip -a
-       dh_shlibdeps -a
-       dh_gencontrol -a
-       dh_fixperms -a
-       dh_installdeb -a
-       dh_md5sums -a
-       dh_builddeb -a
+DEB_DH_MAKESHLIBS_ARGS_ALL = \
+       -V"mlib2 (>= $(DEB_UPSTREAM_VERSION)) | mlib2-adns (>= $(DEB_UPSTREAM_VERSION))"
 
-binary: binary-indep binary-arch
+###--------------------------------------------------------------------------
+### Building the ADNS version.
 
-source:
-       rm -rf deb-build/*.tar.gz deb-build/=deb=
-       make -C deb-build dist PACKAGE=mlib
-       mkdir deb-build/=deb=
-       cd deb-build/=deb=; tar xvfz ../*.tar.gz
-       d=`pwd`; cd ..; dpkg-source -i -b $$d/deb-build/=deb=/*
-       rm -rf deb-build/=deb=
+DEB_CONFIGURE_EXTRA_FLAGS_mlib2-adns = --with-adns
+DEB_BUILDDIR_mlib2-adns = $(CURDIR)/build-adns
 
-.PHONY: binary binary-arch binary-indep clean install source
+configure/mlib2-adns::
+       $(DEB_CONFIGURE_INVOKE) \
+               $(cdbs_configure_flags) \
+               $(DEB_CONFIGURE_EXTRA_FLAGS_mlib2-adns) \
+               $(DEB_CONFIGURE_USER_FLAGS)
+
+build/mlib2-adns::
+       $(DEB_MAKE_ENVVARS) $(MAKE) -C $(DEB_BUILDDIR_mlib2-adns)
+
+install/mlib2-adns::
+       $(DEB_MAKE_ENVVARS) $(MAKE) -C $(DEB_BUILDDIR_mlib2-adns) \
+               install DESTDIR=$(CURDIR)/debian/tmp-adns
+
+clean::
+       rm -rf $(CURDIR)/debian/tmp-adns
+
+###----- That's all, folks --------------------------------------------------