[Pkg-octave-commit] rev 653 - trunk/packages/octave2.1-forge/debian

Thomas Weber thomas-guest at costa.debian.org
Fri Jul 21 08:43:40 UTC 2006


Author: thomas-guest
Date: 2006-07-21 08:43:39 +0000 (Fri, 21 Jul 2006)
New Revision: 653

Modified:
   trunk/packages/octave2.1-forge/debian/rules
Log:
Change rules file to CDBS 


Modified: trunk/packages/octave2.1-forge/debian/rules
===================================================================
--- trunk/packages/octave2.1-forge/debian/rules	2006-07-21 08:20:07 UTC (rev 652)
+++ trunk/packages/octave2.1-forge/debian/rules	2006-07-21 08:43:39 UTC (rev 653)
@@ -2,174 +2,81 @@
 # 							-*- makefile -*-
 # debian.rules file for the Debian/GNU Linux octave-forge package
 # Copyright 2000 - 2004 by Dirk Eddelbuettel <edd at debian.org>
+# Copyright 2005 - 2006 by Debian Octave Group <pkg-octave-devel at lists.alioth.debian.org>
 
-PACKAGE		= octave-forge
 
+# TODO:
+#   - examples and docs
+#   - call dh_shlibdeps ?
+
+include /usr/share/cdbs/1/rules/debhelper.mk
 include /usr/share/cdbs/1/rules/simple-patchsys.mk
+include /usr/share/cdbs/1/class/autotools.mk
 include /usr/share/octave/debian/defs.make
+	# If one (and only one) of Octave 2.1 or 2.9 (-headers) is installed,
+	# defs.make points to the correct defs.make-x.y.z
+	# We ensure the correct version by build-conflicts in control
 
-altname         = octave-forge-alternatives
-debtmp		:= $(CURDIR)/debian/$(PACKAGE)
-debdoc          := $(debtmp)/usr/share/doc/$(PACKAGE)
-octdir  	:= $(OCTDIR)
-mdir	  	:= $(MDIR)
-altoctdir       := /usr/lib/$(altname)
-altmdir         := /usr/share/$(altname)
-octbin		:= $(shell octave-config -p LOCALARCHLIBDIR)
+PACKAGE := $(DEB_PACKAGES)
+	# octave2.1-forge; we only build one binary, so we can use this variable
+major := $(shell echo $(PACKAGE) | grep -o [0-9].[0-9] -)
+	# 2.1 or 2.9
 
-mycheck:
-		@echo "debtmp $(debtmp)"
-		@echo "debdic $(debdoc)"
-		@echo "otdir  $(octdir)"
-		@echo "mdir   $(mdir)"
-		@echo "octbin $(octbin)"
+      
+# We should probably exchange LOCALAPIFCNFILEDIR for LOCALFCNFILEDIR in defs.make 
+# Unless this happens, overwrite it here
+# FIXME
+# MDIR := $(shell octave-config  --print LOCALAPIFCNFILEDIR)
 
-arch 		:= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+altname := $(PACKAGE)-alternatives
+altmdir  := /usr/share/$(altname)
+altoctdir := /usr/lib/$(altname)
 
-## edd 22 Feb 2003 now use 3.2 versions everywhere
-## edd 27 Jun 2003  now that gcc 3.3 is in unstable and testing, relax this
-#compilerpath	= /usr/bin/gcc-3.2
-#cpppath		= /usr/bin/g++-3.2
-#fcpath		= /usr/bin/g77-3.2
-compilerpath	= /usr/bin/gcc
-cpppath		= /usr/bin/g++
-fcpath		= /usr/bin/gfortran
-compilerflags	= "-O2"
-linkerflags	= "-s"
+# Hopefully, we will get a LOCALAPIARCHLIBDIR by upstream; until then, work
+# around it
+# octbin := $(shell octave-config -p LOCALARCHLIBDIR)
+octbin := $(shell octave-config -p LOCALARCHLIBDIR)/$(shell octave-config -p API_VERSION)
 
-## hppa needs g++-3.3
-## edd 27 Jun 2003  now that gcc 3.3 is in unstable and testing, relax this
-#ifeq ($(arch),hppa-linux)
-#compilerpath	= /usr/bin/gcc-3.3
-#cpppath		= /usr/bin/g++-3.3
-#fcpath		= /usr/bin/g77-3.3
-#endif
 
-get-orig-source: upstream
-upstream:
-		links http://octave.sf.net
 
-upstreamcvs:
-                # see the script cvs_checkout.sh instead
+# Installation paths, handed to configure
+# in order: m-files, oct-files, executables, alternative m-files, alternative
+#       oct-files,
+# All variables contain the API version
+MPATH:=$(DESTDIR)/$(MDIR)/$(PACKAGE)
+OPATH:=$(DESTDIR)/$(OCTDIR)/$(PACKAGE)
+XPATH:=$(DESTDIR)/$(octbin)/$(PACKAGE)
+	# This one is forced to have an API version
+ALTMPATH:=$(DESTDIR)/$(altmdir)
+ALTOPATH:=$(DESTDIR)/$(altoctdir)
 
-configure:	configure-stamp
-configure-stamp: apply-patches
-		dh_testdir
-		test -f configure-orig || mv configure configure-orig
-		touch extra/MacOSX/NOINSTALL
-		[ -f autogen.sh ] && ./autogen.sh && chmod 0755 configure
-		CC=$(compilerpath)			\
-		CXX=$(cpppath)				\
-		FC=$(fcpath)				\
-		F77=$(fcpath)				\
-		CFLAGS=$(compilerflags)			\
-		CXXFLAGS=$(compilerflags)		\
-		FFLAGS=$(compilerflags)			\
-		./configure --prefix=/usr --with-altmpath=$(altmdir)
-                # clean the tsa/ directory
-                # ( cd extra/tsa && ../../debian/tsacleanup.pl )
-		touch configure-stamp
 
-build: 		configure-stamp build-stamp
-build-stamp:
-		$(MAKE)
-                # $(MAKE) index.html
-		touch build-stamp
+DEB_CONFIGURE_EXTRA_FLAGS := 	--with-mpath=$(MPATH) \
+				--with-opath=$(OPATH) \
+				--with-xpath=$(XPATH) \
+				--with-altmpath=$(ALTMPATH) \
+				--with-altopath=$(ALTOPATH) \
+				MKOCTFILE=mkoctfile$(major)
 
-install: 	install-stamp
-install-stamp:
-		dh_testdir
-		dh_testroot
-		dh_clean -k
-		dh_installdirs
-		strip */*/*.oct
-		$(MAKE) install MPATH=$(debtmp)/$(mdir)/$(PACKAGE)	\
-				OPATH=$(debtmp)/$(octdir)/$(PACKAGE) 	\
-				XPATH=$(debtmp)/$(octbin)		\
-				ALTMPATH=$(debtmp)/$(altmdir)           \
-				ALTOPATH=$(debtmp)/$(altoctdir)         \
-				prefix=$(debtmp)/usr			\
-				mandir=$(debtmp)/usr/share/man
-		rm -vf $(debtmp)/rasmol.sh
-		touch install-stamp
+# don't run the check commands 
+# 'test' is a command available only in octave-forge and Octave 2.9, so for
+# Octave 2.1, we would need an earlier version of octave-forge already
+# built/installed
+# DEB_MAKE_CHECK_TARGET := check 
 
-check:		check-stamp
-check-stamp:
-		dh_testdir
-		-$(MAKE) check 	OCTAVE=octave2.1
-		touch check-stamp
+# calculate correct dependencies and move mex to mex2.1
+install/$(PACKAGE)::
+	octave-depends
+	mv debian/$(PACKAGE)/usr/bin/mex debian/$(PACKAGE)/usr/bin/mex$(major)
+	mv debian/$(PACKAGE)/usr/share/man/man1/mex.1 debian/$(PACKAGE)/usr/share/man/man1/mex$(major).1 
 
-clean::
-		dh_testdir
-		dh_testroot
-		-test -f configure-orig && mv configure-orig configure
-		rm -f configure-stamp build-stamp install-stamp check-stamp
+# what we don't want in the package
+makebuilddir/$(PACKAGE)::
+	touch $(CURDIR)/extra/MacOSX/NOINSTALL
+		# we aren't MacOS, honest
+	touch $(CURDIR)/main/sparse/NOINSTALL 
+	touch $(CURDIR)/extra/testfun/NOINSTALL
+		# sparse code and testfunctions are in Octave 2.9 
+	# touch $(CURDIR)/FIXES/NOINSTALL
+		# the FIXES directory has been removed upstream
 
-		# The following hack involving the Debian patches should be
-		# removed as soon as the patches 50_make-clean and
-		# 60_make-distclean are integraded upstream
-		./debian/rules apply-patches
-		-test -f Makefile && $(MAKE) distclean
-		./debian/rules reverse-patches
-		rm -f debian/patches/*.log
-
-		-( cd main/fixed/doc ; $(MAKE) realclean )
-		-rm -rf *~ $(debtmp) debian/*~ debian/files*
-
-		dh_clean
-
-binary-indep: 	build install check
-
-binary-arch: 	build install check
-#		dh_testversion
-		dh_testdir
-		dh_testroot
-#		dh_installdebconf
-		dh_installdocs		AUTHORS TODO README RELEASE-NOTES
-		dh_installexamples	extra/pdb/bin/rasmol.sh
-#		dh_installmenu
-#		dh_installemacsen
-#		dh_installpam
-#		dh_installmime
-#		dh_installinit
-#		dh_installcron
-#		dh_installman		debian/aurecord.1
-#		dh_installinfo
-#		dh_undocumented
-		dh_installchangelogs
-		dh_link			$(mdir)/$(PACKAGE) \
-					/usr/share/doc/$(PACKAGE)/scripts
-		dh_strip
-		strip --remove-section=.comment \
-		      --remove-section=.note 	\
-				$(debtmp)$(octdir)/$(PACKAGE)/*.oct
-                # this only affects one file (mex.o) and it needs
-                # symbols (c.f. #207542)
-                ## strip --remove-section=.comment \
-                ##       --remove-section=.note 	\
-                ##		$(debtmp)$(octdir)/$(PACKAGE)/*.o
-		dh_compress
-		dh_fixperms
-#		dh_suidregister
-#		dh_makeshlibs
-		dh_installdeb
-#		dh_perl
-                # call with three explicit files to cover our bases
-
-		octave-depends
-		dh_shlibdeps 	$(debtmp)$(octdir)/$(PACKAGE)/convhulln.oct \
-			 	$(debtmp)$(octdir)/$(PACKAGE)/jpgwrite.oct  \
-			 	$(debtmp)$(octdir)/$(PACKAGE)/gsl_sf.oct    \
-			 	$(debtmp)$(octdir)/$(PACKAGE)/symbols.oct
-		dh_gencontrol
-		dh_md5sums
-		dh_builddeb
-
-binary-arch: 	build
-
-source diff:
-		@echo >&2 'obsolete targets - use dpkg-source -b'; false
-
-binary: 	binary-indep binary-arch
-.PHONY: 	build clean binary-indep binary-arch binary upstream upstreamcvs
-




More information about the Pkg-octave-commit mailing list