[Pkg-octave-commit] [SCM] Debian packaging for octave-pkg-dev branch, master, updated. debian/1.0.0-5-gf7f4a3a

Rafael Laboissiere rafael at laboissiere.net
Fri Mar 9 23:03:47 UTC 2012


The following commit has been merged in the master branch:
commit e5d652b87948e6e44bb86a8d9dcba2370fba285e
Author: Rafael Laboissiere <rafael at laboissiere.net>
Date:   Fri Mar 9 23:41:12 2012 +0100

    Check the current version of Octave against the upstream specification
    
    This change introduces a Makefile target (check-version) for checking
    whether the version of Octave currently installed satisfies the
    relationship specified in the upstream file DESCRIPTION.  For now, it only
    works with the greater-or-equal (>=) relationship and silently ignores
    other relationships.

diff --git a/octave-pkg.mk b/octave-pkg.mk
index 4de3610..7c8a914 100644
--- a/octave-pkg.mk
+++ b/octave-pkg.mk
@@ -4,7 +4,7 @@
 # This file is part of the octave-pkg-dev Debian package
 
 # Copyright (c) 2008  Olafur Jens Sigurðsson <ojsbug at gmail.com>
-# Copyright (c) 2008, 2009  Rafael Laboissiere <rafael at debian.org>
+# Copyright (c) 2008, 2009, 2012  Rafael Laboissiere <rafael at 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
@@ -30,6 +30,7 @@ shrpkg = /usr/share/octave/debian
 mpath = usr/share/octave/packages
 bpath = usr/lib/$(shell dpkg-architecture -qDEB_HOST_MULTIARCH)/octave/packages
 hosttype = $(shell octave-config -p CANONICAL_HOST_TYPE)
+version = $(shell octave-config -p VERSION)
 apiversion = $(shell octave-config -p API_VERSION)
 octave = /usr/bin/octave
 octave_options = --no-history --silent --no-init-file
@@ -42,6 +43,7 @@ export OCTAVE_HISTFILE=/dev/null
 # resulting in 'permission denied errors on the buildds
 
 install/$(package)::	\
+	check-version	\
 	create-dirs	\
 	install-pkg	\
 	clean-files	\
@@ -49,6 +51,21 @@ install/$(package)::	\
 	check-pkg	\
 	remove-dirs
 
+.PHONY: check-version
+check-version:
+	@echo -n "Checking the Octave version... "
+	@dep=$$(grep Depends DESCRIPTION				\
+               | perl -ne 'if (/octave\s+\(>=(.*)\)/) {print $$1}') ;	\
+	if [ "$$dep" != "" ] ; then					\
+		dpkg --compare-versions $(version) ge $$dep		\
+			&& (echo ok ; true)				\
+			|| (echo ;					\
+			    echo "Octave version mismatch:"		\
+				 "Needs >= $$dep, but version"		\
+				 "$(version) is installed" 1>&2 ;	\
+			    false) ;					\
+	fi
+
 .PHONY: create-dirs
 create-dirs:
 	mkdir -p $(CURDIR)/$(debpkg)/$(mpath)	\

-- 
Debian packaging for octave-pkg-dev



More information about the Pkg-octave-commit mailing list