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

Re: [Pkg-octave-devel] Proceeding with the switch to 3.6



* Thomas Weber <tweber@debian.org> [2012-03-06 20:35]:

> I've just uploaded octave-pkg-dev to delayed/2, so if there's still
> something that needs to be done, we can defer the switch. 

Thanks for that.  I did two changes for octave-pkg-dev in my local Git
repository, the associated patches are attached below.  The first one is
important for getting the octave-signal package being properly checked.
The second patch is just for the sake of minimalism.  They apply in
succession.

Rafael

P.S.: I still do not have SSH access to git.debian.org.  As soon as I
have it, I will stop sending patches to the mailing list, of course!
>From 2f9650b162005edc9ec5e9ba1930bc9fcc91ea15 Mon Sep 17 00:00:00 2001
From: Rafael Laboissiere <rafael@laboissiere.net>
Date: Tue, 6 Mar 2012 21:37:36 +0100
Subject: [PATCH 1/2] Allow class methods to be properly checked

In order to have proper unit testing of class methods, we should issue
"test @class/method.m".  The code in octave-pkg.mk was issuing "test
method.m", which obviously does not work, since files under a @-leading
directory name are not in the path.  Besides, it would make no sense
to test a method function outside its class scope.
---
 debian/changelog |    7 +++++++
 octave-pkg.mk.in |    2 +-
 2 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 1119d22..1ae84ce 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+octave-pkg-dev (0.7.7) UNRELEASED; urgency=low
+
+  * octave-pkg.mk.in (check-pkg): Allow class methods to be properly
+    checked
+
+ -- Rafael Laboissiere <rafael@laboissiere.net>  Tue, 06 Mar 2012 21:36:29 +0100
+
 octave-pkg-dev (0.7.6) unstable; urgency=low
 
   [ Rafael Laboissiere ]
diff --git a/octave-pkg.mk.in b/octave-pkg.mk.in
index 701c2e7..0cc26e3 100644
--- a/octave-pkg.mk.in
+++ b/octave-pkg.mk.in
@@ -92,7 +92,7 @@ check-pkg:
 	echo "addpath (genpath ([pwd(),'/debian']));" > $$tmp ;	\
 	find debian/ -name \*.m					\
 		| xargs grep -l '^%!\(assert\|test\)'		\
-		| perl -pe 's:.*/(.*)\.m::;			\
+		| perl -pe 's:[^@]*/(.*)\.m::;			\
 			 print "disp (\"[$$1]\")\ntest $$1"'	\
 		>> $$tmp ;					\
 	@OCTAVE@ $(octave_options) $$tmp ;			\
-- 
1.7.9.1

>From d688a7e52676d3c6aa614fe9d8a02f45865dc0cd Mon Sep 17 00:00:00 2001
From: Rafael Laboissiere <rafael@laboissiere.net>
Date: Tue, 6 Mar 2012 21:44:53 +0100
Subject: [PATCH 2/2] Stop doing content substitution in octave-pkg.mk

The substitution of the @OCTAVE@ tag was necessary in the days when we had
octave packages with versioned names.  This is not necessary anymore, so
(1) the octave-pkg.mk.in has been renamed to octave-pkg.mk, (2) the full
path for octave has been set in the new variable $(octave), and (3) the
code in debian/rules for doing the substitution via sed has been removed.

Also, update the list of exclusions for Git.
---
 .gitignore       |    2 -
 debian/changelog |    6 ++-
 debian/rules     |   11 +----
 octave-pkg.mk    |  154 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 octave-pkg.mk.in |  153 -----------------------------------------------------
 5 files changed, 159 insertions(+), 167 deletions(-)
 create mode 100644 octave-pkg.mk
 delete mode 100644 octave-pkg.mk.in

diff --git a/.gitignore b/.gitignore
index 1b4f8b6..e7c0337 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,5 +2,3 @@ debian/files
 debian/octave-pkg-dev.debhelper.log
 debian/octave-pkg-dev/
 debian/octave-pkg-dev.substvars
-octave-pkg-helper
-octave-pkg.mk
diff --git a/debian/changelog b/debian/changelog
index 1ae84ce..656760c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,7 +1,9 @@
 octave-pkg-dev (0.7.7) UNRELEASED; urgency=low
 
-  * octave-pkg.mk.in (check-pkg): Allow class methods to be properly
-    checked
+  * octave-pkg.mk:
+    + Renamed from octave-pkg.mk.in, since we do not change content
+      anymore.  The code in debian/rules has been changed accordingly.
+    + (check-pkg): Allow class methods to be properly checked
 
  -- Rafael Laboissiere <rafael@laboissiere.net>  Tue, 06 Mar 2012 21:36:29 +0100
 
diff --git a/debian/rules b/debian/rules
index a8750c5..740d2d0 100755
--- a/debian/rules
+++ b/debian/rules
@@ -3,16 +3,7 @@
 #
 # debian/rules for the octave-pkg-dev Debian package
 
-OCTPKG = octave
-FILES = octave-pkg.mk
-
 include /usr/share/cdbs/1/rules/debhelper.mk
 
-%: %.in
-	sed 's/@OCTAVE@/$(OCTPKG)/' < $< > $@
-
-build/octave-pkg-dev:: $(FILES)
+build/octave-pkg-dev::
 	chmod +x octave-pkg-helper
-
-clean::
-	rm -f $(FILES)
diff --git a/octave-pkg.mk b/octave-pkg.mk
new file mode 100644
index 0000000..4de3610
--- /dev/null
+++ b/octave-pkg.mk
@@ -0,0 +1,154 @@
+# -*- makefile -*-
+# octave-pkg.mk: CDBS-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  Rafael Laboissiere <rafael@debian.org>
+#
+# 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# 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
+
+package = $(shell awk '/^Package:/ {print $$2; exit 0}' debian/control)
+debpkg = debian/$(package)
+shrpkg = /usr/share/octave/debian
+# The directories below are versioned.  We only support the packages for the
+# stable version of Octave
+mpath = usr/share/octave/packages
+bpath = usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/octave/packages
+hosttype = $(shell octave-config -p CANONICAL_HOST_TYPE)
+apiversion = $(shell octave-config -p API_VERSION)
+octave = /usr/bin/octave
+octave_options = --no-history --silent --no-init-file
+global_list = global-list
+local_list = local-list
+
+export LDFLAGS=-Wl,--as-needed
+export OCTAVE_HISTFILE=/dev/null
+# even with '--no-history', Octave creates an empty .octave_hist at startup,
+# resulting in 'permission denied errors on the buildds
+
+install/$(package)::	\
+	create-dirs	\
+	install-pkg	\
+	clean-files	\
+	install-docs	\
+	check-pkg	\
+	remove-dirs
+
+.PHONY: create-dirs
+create-dirs:
+	mkdir -p $(CURDIR)/$(debpkg)/$(mpath)	\
+		 $(CURDIR)/$(debpkg)/$(bpath)
+
+.PHONY: install-pkgs
+install-pkg:
+	-[ -e PKG_ADD ] && mv PKG_ADD PKG_ADD.bak
+	$(octave) $(octave_options) --eval				\
+		 "pkg ('prefix', [pwd(),'/$(debpkg)/$(mpath)'],		\
+		      [pwd(),'/$(debpkg)/$(bpath)']);			\
+		 pkg ('local_list', [pwd(),'/$(local_list)']);		\
+		 pkg ('global_list', [pwd(),'/$(global_list)']);	\
+		 if (exist ('PKG_ADD.bak') == 2),			\
+		     movefile ('PKG_ADD.bak', 'PKG_ADD');		\
+		 endif;							\
+		 pkg -verbose -nodeps install ."
+	$(shrpkg)/dh/octave-pkg-helper
+	dh_install --package=$(package)
+
+.PHONY: clean-files
+clean-files::
+	( cd  $(shell find . -name packinfo) ; rm -f COPYING ChangeLog )
+
+.PHONY: install-docs
+install-docs:
+	if [ -d doc ] ; then				\
+		dh_installdocs -p$(package);		\
+		rm -rf $(debpkg)/$(mpath)/*/doc ;	\
+	fi
+
+.PHONY: check-pkg
+ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+check-pkg:
+	-[ -e PKG_ADD ] && mv PKG_ADD PKG_ADD.bak
+
+	@echo Checking package...
+
+# Extract tests from installed m files
+	@echo Checking m files ...
+	@tmp=$$(tempfile) ;					\
+	echo "addpath (genpath ([pwd(),'/debian']));" > $$tmp ;	\
+	find debian/ -name \*.m					\
+		| xargs grep -l '^%!\(assert\|test\)'		\
+		| perl -pe 's:[^@]*/(.*)\.m::;			\
+			 print "disp (\"[$$1]\")\ntest $$1"'	\
+		>> $$tmp ;					\
+	$(octave) $(octave_options) $$tmp ;			\
+	rm -f $$tmp
+
+# Extract tests from .cc files - these are not installed, but the
+# compiled .oct files are.
+# We search for the tests in the .cc files, but invoke the .oct files;
+# this means we must add generate a loadpath starting at the current
+# directory and source PKG_ADD files (they might add autoload()
+# directives)
+
+# We deactivate the warning about relative paths used for the PKG_ADD file.
+	@echo Checking CC files ...
+	@tmp=$$(tempfile) ;					\
+	echo "addpath (genpath ([pwd()]));" >> $$tmp ;		\
+	echo "warning ('off', 'Octave:autoload-relative-file-name');" >> $$tmp ;	\
+	if [ -f PKG_ADD ] ; then				\
+		echo "source('PKG_ADD');" >> $$tmp ; 		\
+	fi ;							\
+	if [ -f PKG_ADD.bak ] ; then				\
+		echo "source('PKG_ADD.bak');" >> $$tmp ;	\
+	fi ;							\
+	if [ -d src ] ; then					\
+		find src/ -name \*.cc				\
+			| xargs grep -l '^%!\(assert\|test\)'	\
+			| perl -pe 's:.*/(.*)\.cc::;		\
+				print "disp (\"[$$1]\")\ntest $$1"'	\
+			>> $$tmp ;				\
+	fi ;							\
+	octave $(octave_options) $$tmp ;			\
+	rm -f $$tmp
+
+	@if [ -f debian/check.m ] ; then			\
+		$(octave) $(octave_options) --eval		\
+			"addpath (genpath ([pwd(),'/debian']));	\
+			 source ('debian/check.m');" ;		\
+	fi
+
+	-[ -e PKG_ADD.bak ] && mv PKG_ADD.bak PKG_ADD
+else
+check-pkg:
+endif
+
+.PHONY: remove-dirs
+remove-dirs:
+	rmdir --ignore-fail-on-non-empty -p	\
+		 $(CURDIR)/$(debpkg)/$(mpath)	\
+		 $(CURDIR)/$(debpkg)/$(bpath)
+
+
+DEB_MAKE_CLEAN_TARGET = -C src clean
+
+clean::
+ifneq ($(DEB_MAKE_CLEAN_TARGET),)
+	-$(MAKE) -k $(DEB_MAKE_CLEAN_TARGET)
+endif
+	rm -rf inst/$(hosttype)-$(apiversion) $(global_list) $(local_list)
diff --git a/octave-pkg.mk.in b/octave-pkg.mk.in
deleted file mode 100644
index 0cc26e3..0000000
--- a/octave-pkg.mk.in
+++ /dev/null
@@ -1,153 +0,0 @@
-# -*- makefile -*-
-# octave-pkg.mk: CDBS-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  Rafael Laboissiere <rafael@debian.org>
-#
-# 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
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License along
-# 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
-
-package = $(shell awk '/^Package:/ {print $$2; exit 0}' debian/control)
-debpkg = debian/$(package)
-shrpkg = /usr/share/octave/debian
-# The directories below are versioned.  We only support the packages for the
-# stable version of Octave
-mpath = usr/share/octave/packages
-bpath = usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/octave/packages
-hosttype = $(shell octave-config -p CANONICAL_HOST_TYPE)
-apiversion = $(shell octave-config -p API_VERSION)
-octave_options = --no-history --silent --no-init-file
-global_list = global-list
-local_list = local-list
-
-export LDFLAGS=-Wl,--as-needed
-export OCTAVE_HISTFILE=/dev/null
-# even with '--no-history', Octave creates an empty .octave_hist at startup,
-# resulting in 'permission denied errors on the buildds
-
-install/$(package)::	\
-	create-dirs	\
-	install-pkg	\
-	clean-files	\
-	install-docs	\
-	check-pkg	\
-	remove-dirs
-
-.PHONY: create-dirs
-create-dirs:
-	mkdir -p $(CURDIR)/$(debpkg)/$(mpath)	\
-		 $(CURDIR)/$(debpkg)/$(bpath)
-
-.PHONY: install-pkgs
-install-pkg:
-	-[ -e PKG_ADD ] && mv PKG_ADD PKG_ADD.bak
-	@OCTAVE@ $(octave_options) --eval				\
-		 "pkg ('prefix', [pwd(),'/$(debpkg)/$(mpath)'],		\
-		      [pwd(),'/$(debpkg)/$(bpath)']);			\
-		 pkg ('local_list', [pwd(),'/$(local_list)']);		\
-		 pkg ('global_list', [pwd(),'/$(global_list)']);	\
-		 if (exist ('PKG_ADD.bak') == 2),			\
-		     movefile ('PKG_ADD.bak', 'PKG_ADD');		\
-		 endif;							\
-		 pkg -verbose -nodeps install ."
-	$(shrpkg)/dh/octave-pkg-helper
-	dh_install --package=$(package)
-
-.PHONY: clean-files
-clean-files::
-	( cd  $(shell find . -name packinfo) ; rm -f COPYING ChangeLog )
-
-.PHONY: install-docs
-install-docs:
-	if [ -d doc ] ; then				\
-		dh_installdocs -p$(package);		\
-		rm -rf $(debpkg)/$(mpath)/*/doc ;	\
-	fi
-
-.PHONY: check-pkg
-ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
-check-pkg:
-	-[ -e PKG_ADD ] && mv PKG_ADD PKG_ADD.bak
-
-	@echo Checking package...
-
-# Extract tests from installed m files
-	@echo Checking m files ...
-	@tmp=$$(tempfile) ;					\
-	echo "addpath (genpath ([pwd(),'/debian']));" > $$tmp ;	\
-	find debian/ -name \*.m					\
-		| xargs grep -l '^%!\(assert\|test\)'		\
-		| perl -pe 's:[^@]*/(.*)\.m::;			\
-			 print "disp (\"[$$1]\")\ntest $$1"'	\
-		>> $$tmp ;					\
-	@OCTAVE@ $(octave_options) $$tmp ;			\
-	rm -f $$tmp
-
-# Extract tests from .cc files - these are not installed, but the
-# compiled .oct files are.
-# We search for the tests in the .cc files, but invoke the .oct files;
-# this means we must add generate a loadpath starting at the current
-# directory and source PKG_ADD files (they might add autoload()
-# directives)
-
-# We deactivate the warning about relative paths used for the PKG_ADD file.
-	@echo Checking CC files ...
-	@tmp=$$(tempfile) ;					\
-	echo "addpath (genpath ([pwd()]));" >> $$tmp ;		\
-	echo "warning ('off', 'Octave:autoload-relative-file-name');" >> $$tmp ;	\
-	if [ -f PKG_ADD ] ; then				\
-		echo "source('PKG_ADD');" >> $$tmp ; 		\
-	fi ;							\
-	if [ -f PKG_ADD.bak ] ; then				\
-		echo "source('PKG_ADD.bak');" >> $$tmp ;	\
-	fi ;							\
-	if [ -d src ] ; then					\
-		find src/ -name \*.cc				\
-			| xargs grep -l '^%!\(assert\|test\)'	\
-			| perl -pe 's:.*/(.*)\.cc::;		\
-				print "disp (\"[$$1]\")\ntest $$1"'	\
-			>> $$tmp ;				\
-	fi ;							\
-	octave $(octave_options) $$tmp ;			\
-	rm -f $$tmp
-
-	@if [ -f debian/check.m ] ; then			\
-		@OCTAVE@ $(octave_options) --eval		\
-			"addpath (genpath ([pwd(),'/debian']));	\
-			 source ('debian/check.m');" ;		\
-	fi
-
-	-[ -e PKG_ADD.bak ] && mv PKG_ADD.bak PKG_ADD
-else
-check-pkg:
-endif
-
-.PHONY: remove-dirs
-remove-dirs:
-	rmdir --ignore-fail-on-non-empty -p	\
-		 $(CURDIR)/$(debpkg)/$(mpath)	\
-		 $(CURDIR)/$(debpkg)/$(bpath)
-
-
-DEB_MAKE_CLEAN_TARGET = -C src clean
-
-clean::
-ifneq ($(DEB_MAKE_CLEAN_TARGET),)
-	-$(MAKE) -k $(DEB_MAKE_CLEAN_TARGET)
-endif
-	rm -rf inst/$(hosttype)-$(apiversion) $(global_list) $(local_list)
-- 
1.7.9.1


Reply to: