[ode] 13/14: Refactored rules. Conditional options depends on the platform

Leopold Palomo-Avellaneda leo at alaxarxa.net
Wed Sep 9 11:17:07 UTC 2015


This is an automated email from the git hooks/post-receive script.

lepalom-guest pushed a commit to branch master
in repository ode.

commit 17112def68ac70140326c83d92b687c490a37c8b
Author: Leopold Palomo-Avellaneda <leopold.palomo at upc.edu>
Date:   Wed Sep 9 13:10:12 2015 +0200

    Refactored rules. Conditional options depends on the platform
---
 debian/rules | 93 +++++++++++++++++++++++++++++++++++-------------------------
 1 file changed, 54 insertions(+), 39 deletions(-)

diff --git a/debian/rules b/debian/rules
index 8fbecfd..7ded5a3 100755
--- a/debian/rules
+++ b/debian/rules
@@ -5,6 +5,52 @@
 
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all
 
+CPPFLAGS:=$(shell dpkg-buildflags --get CPPFLAGS)
+CFLAGS:=$(shell dpkg-buildflags --get CFLAGS) $(CPPFLAGS)
+CXXFLAGS:=$(shell dpkg-buildflags --get CXXFLAGS) $(CPPFLAGS)
+LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) -Wl,--as-needed
+
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+
+DEB_HOST_GNU_CPU ?= $(shell dpkg-architecture -qDEB_HOST_GNU_CPU)
+DEB_HOST_ARCH ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
+DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+# Multiarch.
+DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
+
+#Arch 32 bits
+# armel armhf i386 powerpc powerpcspe sh4 
+
+#Arch 64 bits
+# alpha arm64 hppa mips mipsel ppc64 ppc64el s390x x32
+
+CONFIG_OPTS = --enable-double-precision
+
+ifeq ($(DEB_HOST_ARCH), armel )
+	CONFIG_OPTS = ""
+else ifeq ($(DEB_HOST_ARCH), armhf )
+	CONFIG_OPTS = ""
+else ifeq ($(DEB_HOST_ARCH), i386 )
+	CONFIG_OPTS = "" 
+else ifeq ($(DEB_HOST_ARCH), powerpc)
+        CONFIG_OPTS = ""
+else ifeq ($(DEB_HOST_ARCH), powerpcspe)
+	CONFIG_OPTS = ""
+else ifeq ($(DEB_HOST_ARCH), sh4)
+	CONFIG_OPTS = ""
+endif
+
+CONFIG_OPTS += --prefix=/usr \
+                    --mandir=/usr/share/man \
+                    --with-libccd=system \
+		    --enable-libccd \
+                    --enable-shared \
+		    --enable-static \
+                    --libdir='$${prefix}/lib/$(DEB_HOST_MULTIARCH)/'
+
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 	CXXFLAGS += -O0 -g3
 	CFLAGS += -O0 -g3
@@ -12,47 +58,16 @@ ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
 endif
 
 %:
-	dh $@ --parallel
+	dh $@ --parallel --with autotools-dev
 
 override_dh_auto_configure:
 	./bootstrap
-	mkdir -p debian/build/dp debian/build/sp
-	# SP: single precision build
-	cd debian/build/sp && ../../../configure --enable-shared --prefix=/usr LIBS="-lX11" $(shell dpkg-buildflags --export=configure)
-	# Adjust the SONAME of the single precision flavor
-	sed -i 's,^soname_spec=.*,soname_spec=libode.so.1sp,' debian/build/sp/libtool
-	cd debian/build/dp && ../../../configure --enable-shared --prefix=/usr --enable-double-precision LIBS="-lX11" $(shell dpkg-buildflags --export=configure)
-
+	dh_auto_configure -- $(CONFIG_OPTS)
 
 override_dh_auto_build:
-	cd debian/build/sp && $(MAKE)
-	cd debian/build/dp && $(MAKE)
-	#touch build-stamp
-	# Add here commands to install the package into debian/tmp
-	cd debian/build/sp && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp-sp
-	rm debian/tmp-sp/usr/lib/libode.so.1
-	mv debian/tmp-sp/usr/lib/libode.so.1.1.1 \
-		debian/tmp-sp/usr/lib/libode.so.1.1.1sp
-	cd debian/build/dp && $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp-dp
-	docbook-to-man debian/ode-config.man.sgml > \
-	debian/ode-config.1
-
-override_dh_clean:
-	rm -f build-stamp \
-	    configure-stamp
-	rm -rf \
-		debian/build \
-		debian/tmp-sp \
-		debian/tmp-dp	
-	# Add here commands to clean up after the build process.
-	[ ! -f Makefile ] || $(MAKE) distclean
-	dh_clean configure-stamp build-stamp debian/ode-config.1
-
-override_dh_installchangelogs:
-	dh_installchangelogs CHANGELOG.txt
-
-override_dh_install:
-	dh_install --sourcedir=debian/tmp-sp -plibode-sp-dev
-	dh_install --sourcedir=debian/tmp-sp -plibode1sp
-	dh_install --sourcedir=debian/tmp-dp -plibode-dev
-	dh_install --sourcedir=debian/tmp-dp -plibode1
\ No newline at end of file
+	dh_auto_build
+	docbook-to-man debian/ode-config.man.sgml > debian/ode-config.1
+
+override_dh_auto_clean:
+	dh_auto_clean
+	rm debian/ode-config.1

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/ode.git



More information about the Pkg-games-commits mailing list