[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Pkg-octave-devel] Switch octave-pkg-dev from CDBS into dh



* Sébastien Villemot <sebastien@debian.org> [2017-12-27 17:26]:

On Wed, Dec 27, 2017 at 04:35:59PM +0100, Rafael Laboissière wrote:

It would be great to switch from CDBS into dh. That should not be too difficult to do, because the code in octave-pkg.mk depends already heavily on debhelper.

This is something that has been in my ToDo list for ages. I will take a look at this, as time permits.

That would be great. dh has become a de facto standard, and cdbs is gradually becoming obsolete.

As I expected, it was not difficult to adapt the code in octave-pkg-dev for switching from CDBS into dh. It is implemented in the Git branch dh-instead-of-cdbs. Just for the record, I am attaching below the diff against master.

Once this change will be uploaded, there will be three things that must be changed in the packages using octave-pkg-dev:

1) In debian/rules, use the include line:

   include /usr/share/octave-pkg-dev/octave-pkg.mk

(I could have kept the old path /usr/share/cdbs/1/class/, so that no change would be need, but it would be misleading.)

2) Drop the build-dependency on CDBS.

3) Bump the build-dependency on octave-pkg-dev. I am planning to use 2.0.0 for the upcoming version number. Even though the changes are not big, this is an important move for the project. So, the packages will have to use:

   Build-Depends: octave-pkg-dev (>= 2)

If there are no objections, I will upload the new dh-based version to unstable. I will then immediately update all the other packages in Git, accordingly.

Rafael
diff --git a/README b/README
index 318b7a7..6feccef 100644
--- a/README
+++ b/README
@@ -8,9 +8,9 @@ system.
 To use this package, make your add-on source package build-depend on
 octave-pkg-dev and add the following line to debian/rules:
 
-    include /usr/share/cdbs/1/class/octave-pkg.mk
+    include /usr/share/octave-pkg-dev/octave-pkg.mk
 
-Also, build-depend on debhelper and cdbs.
+Also, build-depend on debhelper.
 
 Add ${octave:Depends} to the Depends field of the package in
 debian/control. This ensures that dependencies in upstream's DESCRIPTION file
@@ -37,7 +37,7 @@ built and detecting those containing "%!test" and/or "%!assert"
 directives.  Additional tests not contained in the upstream source
 files may be put in debian/check.m.
 
-The clean target follows the convention of CDBS.  For specifying it,
+The clean target follows the convention of dh.  For specifying it,
 use the DEB_MAKE_CLEAN_TARGET variable.  Its default value is "-C src clean".
 
- -- Thomas Weber <tweber@debian.org> Thu, 16 Feb 2012 15:55:15 +0100
+ -- Rafael Laboissière <rafael@debian.org> Thu, 28 Dec 2017 15:55:15 +0100
diff --git a/debian/octave-pkg-dev.install b/debian/octave-pkg-dev.install
index 8c0aa14..e412cf6 100644
--- a/debian/octave-pkg-dev.install
+++ b/debian/octave-pkg-dev.install
@@ -1,4 +1,4 @@
-octave-pkg.mk                   usr/share/cdbs/1/class
+octave-pkg.mk                   usr/share/octave-pkg-dev
 octave-pkg-helper	        usr/share/octave/debian/dh
 make-octave-forge-debpkg        usr/bin
 check-version			usr/share/octave-pkg-dev
diff --git a/make-octave-forge-debpkg.in b/make-octave-forge-debpkg.in
index d25d85b..036b51c 100755
--- a/make-octave-forge-debpkg.in
+++ b/make-octave-forge-debpkg.in
@@ -183,7 +183,7 @@ writefile (">", "debian/rules",
            "#!/usr/bin/make -f
 # -*- makefile -*-
 
-include /usr/share/cdbs/1/class/octave-pkg.mk
+include /usr/share/octave-pkg-dev/octave-pkg.mk
 ");
 system ("chmod +x debian/rules");
 
@@ -204,7 +204,7 @@ writefile (">", "debian/control",
 Section: math
 Priority: optional
 Maintainer: Debian Octave Group <pkg-octave-devel\@lists.alioth.debian.org>
-${uploaders}Build-Depends: debhelper (>= $compat), cdbs, octave-pkg-dev (>= #Version#)
+${uploaders}Build-Depends: debhelper (>= $compat), octave-pkg-dev (>= #Version#)
 Standards-Version: #Standards-Version#
 Homepage: http://octave.sourceforge.net/$name/
 Vcs-Git: #Vcs-Git#
diff --git a/octave-pkg.mk b/octave-pkg.mk
index 8f785f9..30c49c8 100644
--- a/octave-pkg.mk
+++ b/octave-pkg.mk
@@ -1,10 +1,10 @@
 # -*- makefile -*-
-# octave-pkg.mk: CDBS-based debian/rules scrap for building/installing
+# octave-pkg.mk: dh-based debian/rules scrap for building/installing
 #                octave-forge pkg add-ons
 # This file is part of the octave-pkg-dev Debian package
 
 # Copyright (c) 2008  Olafur Jens Sigurðsson <ojsbug@gmail.com>
-# Copyright (c) 2008, 2009, 2012  Rafael Laboissiere <rafael@laboissiere.net>
+# Copyright (c) 2008, 2009, 2012, 2017  Rafael Laboissiere <rafael@laboissiere.net>
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -20,8 +20,6 @@
 # with this program; if not, write to the Free Software Foundation,
 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
-include /usr/share/cdbs/1/rules/debhelper.mk
-
 export package = $(shell awk '/^Package:/ {print $$2; exit 0}' debian/control)
 export debpkg = debian/$(package)
 export shrpkg = /usr/share/octave/debian
@@ -69,57 +67,36 @@ include /usr/share/dpkg/buildflags.mk
 # Oct-files ldflags are taken from the following variable
 export OCT_LINK_OPTS=$(LDFLAGS)
 
-install/$(package)::	\
-	check-version	\
-	create-dirs	\
-	install-pkg	\
-	clean-files	\
-	install-docs	\
-	check-pkg	\
-	remove-dirs
+%:
+	dh $@
 
-.PHONY: check-version
-check-version::
-	$(libdir)/check-version
+override_dh_auto_build:
 
-.PHONY: create-dirs
-create-dirs::
+override_dh_auto_install:
+	# Check version
+	$(libdir)/check-version
+	# Create directories
 	mkdir -p $(CURDIR)/$(debpkg)/$(mpath)	\
 		 $(CURDIR)/$(debpkg)/$(bpath)
-
-.PHONY: install-pkg
-install-pkg::
+	# Install packages
 	$(libdir)/install-pkg
-
-.PHONY: clean-files
-clean-files::
-	( cd  $(shell find . -name packinfo) ; rm -f COPYING ChangeLog )
-
-.PHONY: install-docs
-install-docs::
+	ls -R $(CURDIR)/$(debpkg)
+	# Clean files
+	pwd
+	( cd $$(find $(CURDIR)/$(debpkg) -name packinfo) ; 	\
+	  rm -f COPYING ChangeLog )
+	# Install documentation files
 	$(libdir)/install-docs
-
-ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
-# Compose the expression for exclusion of requested files from the find command
-export excluded_files_expr = $(shell for i in $(OCTPKG_EXCLUDE_TEST) ; do echo " -a ! -name $$i " ; done)
-
-.PHONY: check-pkg
-check-pkg::
+	# Check package
 	$(libdir)/check-pkg
-else
-check-pkg::
-endif
-
-.PHONY: remove-dirs
-remove-dirs::
+	# Remove directories
 	rmdir --ignore-fail-on-non-empty -p	\
 		 $(CURDIR)/$(debpkg)/$(mpath)	\
 		 $(CURDIR)/$(debpkg)/$(bpath)
 
-
 DEB_MAKE_CLEAN_TARGET = -C src clean
 
-clean::
+override_dh_auto_clean:
 ifneq ($(DEB_MAKE_CLEAN_TARGET),)
 	-$(MAKE) -k $(DEB_MAKE_CLEAN_TARGET)
 endif

Reply to: