[petsc] 01/02: alternatives set default major version (3.6) in /usr/lib/petscdir

Drew Parsons dparsons at moszumanska.debian.org
Thu Jun 2 18:26:12 UTC 2016


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

dparsons pushed a commit to branch master
in repository petsc.

commit 33c398654aaaf572af82909b7c30123722b54fd2
Author: Drew Parsons <dparsons at debian.org>
Date:   Thu Jun 2 22:37:38 2016 +0800

    alternatives set default major version (3.6) in /usr/lib/petscdir
    
    including real and complex versions, i.e. controlling
    /usr/lib/petscdir/3.6
    /usr/lib/petscdir/3.6-real
    /usr/lib/petscdir/3.6-complex
---
 debian/changelog                         |  7 +++++++
 debian/libpetsc-complex-3.6-dev.postinst | 25 +++++++++++++++++++++++++
 debian/libpetsc-complex-3.6-dev.prerm    | 18 ++++++++++++++++++
 debian/libpetsc-complex-3.6.4.postinst   |  4 +---
 debian/libpetsc-complex-3.6.4.prerm      |  3 +--
 debian/libpetsc3.6-dev.postinst          | 25 +++++++++++++++++++++++++
 debian/libpetsc3.6-dev.prerm             | 18 ++++++++++++++++++
 debian/libpetsc3.6.4.postinst            |  4 +---
 debian/libpetsc3.6.4.prerm               |  3 +--
 debian/rules                             |  2 +-
 10 files changed, 98 insertions(+), 11 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index 98eabf0..e80af5a 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
+petsc (3.6.4.dfsg1-2) UNRELEASED; urgency=medium
+
+  * Use alternatives to set default versions for soname (3.6) in
+    /usr/lib/petscdir, including real and complex versions.
+
+ -- Drew Parsons <dparsons at debian.org>  Thu, 02 Jun 2016 22:34:18 +0800
+
 petsc (3.6.4.dfsg1-1) unstable; urgency=low
 
   * New upstream version.
diff --git a/debian/libpetsc-complex-3.6-dev.postinst b/debian/libpetsc-complex-3.6-dev.postinst
new file mode 100644
index 0000000..ee02cfc
--- /dev/null
+++ b/debian/libpetsc-complex-3.6-dev.postinst
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+
+DEB_HOST_MULTIARCH=__DEB_HOST_MULTIARCH__
+
+PETSC_VERSION=__PETSC_VERSION__
+PETSC_ARCH=${DEB_HOST_MULTIARCH}
+PETSC_COMPLEX_ARCH=${PETSC_ARCH}-complex
+PETSC_VERSION_NUMBER=$( echo ${PETSC_VERSION} | sed "s/\.//g" )
+SONAME=__PETSC_SONAME_VERSION__
+
+PETSC_DIR_COMPLEX=/usr/lib/petscdir/${PETSC_VERSION}/${PETSC_COMPLEX_ARCH}
+
+# Make alternatives links
+if [ "$1" = "configure" ]; then
+
+# alternative petsc for this soname (e.g. real or complex)
+update-alternatives --install /usr/lib/petscdir/${SONAME} petsc${SONAME} ${PETSC_DIR_COMPLEX} ${PETSC_VERSION_NUMBER}73
+
+# alternative complex petsc for this soname
+update-alternatives --install /usr/lib/petscdir/${SONAME}-complex petsc${SONAME}-complex ${PETSC_DIR_COMPLEX} ${PETSC_VERSION_NUMBER}73
+
+fi
+
+
+#DEBHELPER#
diff --git a/debian/libpetsc-complex-3.6-dev.prerm b/debian/libpetsc-complex-3.6-dev.prerm
new file mode 100644
index 0000000..40532d6
--- /dev/null
+++ b/debian/libpetsc-complex-3.6-dev.prerm
@@ -0,0 +1,18 @@
+#!/bin/sh -e
+
+DEB_HOST_MULTIARCH=__DEB_HOST_MULTIARCH__
+
+PETSC_VERSION=__PETSC_VERSION__
+PETSC_ARCH=${DEB_HOST_MULTIARCH}
+PETSC_COMPLEX_ARCH=${PETSC_ARCH}-complex
+SONAME=__PETSC_SONAME_VERSION__
+
+PETSC_DIR_COMPLEX=/usr/lib/petscdir/${PETSC_VERSION}/${PETSC_COMPLEX_ARCH}
+
+# Remove alternatives links
+if [ "$1" = "remove" ]; then
+  update-alternatives --remove petsc${SONAME} ${PETSC_DIR_COMPLEX}
+  update-alternatives --remove petsc${SONAME}-complex ${PETSC_DIR_COMPLEX}
+fi
+
+#DEBHELPER#
diff --git a/debian/libpetsc-complex-3.6.4.postinst b/debian/libpetsc-complex-3.6.4.postinst
index f1f3229..0a86038 100644
--- a/debian/libpetsc-complex-3.6.4.postinst
+++ b/debian/libpetsc-complex-3.6.4.postinst
@@ -4,9 +4,7 @@ DEB_HOST_MULTIARCH=__DEB_HOST_MULTIARCH__
 
 PETSC_VERSION=__PETSC_VERSION__
 PETSC_VERSION_NUMBER=$( echo ${PETSC_VERSION} | sed "s/\.//g" )
-
-# use only major.minor as general soname (rather than major.minor.patch.build)
-SONAME=$( echo ${PETSC_VERSION} | awk 'BEGIN { FS="."}; {print $1"."$2 }' )
+SONAME=__PETSC_SONAME_VERSION__
 
 # Make alternatives links
 if [ "$1" = "configure" ]; then
diff --git a/debian/libpetsc-complex-3.6.4.prerm b/debian/libpetsc-complex-3.6.4.prerm
index e8b9724..33b393d 100644
--- a/debian/libpetsc-complex-3.6.4.prerm
+++ b/debian/libpetsc-complex-3.6.4.prerm
@@ -2,8 +2,7 @@
 
 DEB_HOST_MULTIARCH=__DEB_HOST_MULTIARCH__
 PETSC_VERSION=__PETSC_VERSION__
-# use only major.minor as general soname (rather than major.minor.patch.build)
-SONAME=$( echo ${PETSC_VERSION} | awk 'BEGIN { FS="."}; {print $1"."$2 }' )
+SONAME=__PETSC_SONAME_VERSION__
 
 # Remove alternatives links
 if [ "$1" = "remove" ]; then
diff --git a/debian/libpetsc3.6-dev.postinst b/debian/libpetsc3.6-dev.postinst
new file mode 100644
index 0000000..b98eec0
--- /dev/null
+++ b/debian/libpetsc3.6-dev.postinst
@@ -0,0 +1,25 @@
+#!/bin/sh -e
+
+DEB_HOST_MULTIARCH=__DEB_HOST_MULTIARCH__
+
+PETSC_VERSION=__PETSC_VERSION__
+PETSC_ARCH=${DEB_HOST_MULTIARCH}
+PETSC_REAL_ARCH=${PETSC_ARCH}-real
+PETSC_VERSION_NUMBER=$( echo ${PETSC_VERSION} | sed "s/\.//g" )
+SONAME=__PETSC_SONAME_VERSION__
+
+PETSC_DIR_REAL=/usr/lib/petscdir/${PETSC_VERSION}/${PETSC_REAL_ARCH}
+
+# Make alternatives links
+if [ "$1" = "configure" ]; then
+
+# alternative petsc for this soname (e.g. real or complex)
+update-alternatives --install /usr/lib/petscdir/${SONAME} petsc${SONAME} ${PETSC_DIR_REAL} ${PETSC_VERSION_NUMBER}77
+
+# alternative real petsc for this soname
+update-alternatives --install /usr/lib/petscdir/${SONAME}-real petsc${SONAME}-real ${PETSC_DIR_REAL} ${PETSC_VERSION_NUMBER}77
+
+fi
+
+
+#DEBHELPER#
diff --git a/debian/libpetsc3.6-dev.prerm b/debian/libpetsc3.6-dev.prerm
new file mode 100644
index 0000000..3995223
--- /dev/null
+++ b/debian/libpetsc3.6-dev.prerm
@@ -0,0 +1,18 @@
+#!/bin/sh -e
+
+DEB_HOST_MULTIARCH=__DEB_HOST_MULTIARCH__
+
+PETSC_VERSION=__PETSC_VERSION__
+PETSC_ARCH=${DEB_HOST_MULTIARCH}
+PETSC_REAL_ARCH=${PETSC_ARCH}-real
+SONAME=__PETSC_SONAME_VERSION__
+
+PETSC_DIR_REAL=/usr/lib/petscdir/${PETSC_VERSION}/${PETSC_REAL_ARCH}
+
+# Remove alternatives links
+if [ "$1" = "remove" ]; then
+  update-alternatives --remove petsc${SONAME} ${PETSC_DIR_REAL}
+  update-alternatives --remove petsc${SONAME}-real ${PETSC_DIR_REAL}
+fi
+
+#DEBHELPER#
diff --git a/debian/libpetsc3.6.4.postinst b/debian/libpetsc3.6.4.postinst
index 58f5135..1c6fc30 100644
--- a/debian/libpetsc3.6.4.postinst
+++ b/debian/libpetsc3.6.4.postinst
@@ -4,9 +4,7 @@ DEB_HOST_MULTIARCH=__DEB_HOST_MULTIARCH__
 
 PETSC_VERSION=__PETSC_VERSION__
 PETSC_VERSION_NUMBER=$( echo ${PETSC_VERSION} | sed "s/\.//g" )
-
-# use only major.minor as general soname (rather than major.minor.patch.build)
-SONAME=$( echo ${PETSC_VERSION} | awk 'BEGIN { FS="."}; {print $1"."$2 }' )
+SONAME=__PETSC_SONAME_VERSION__
 
 # Make alternatives links
 if [ "$1" = "configure" ]; then
diff --git a/debian/libpetsc3.6.4.prerm b/debian/libpetsc3.6.4.prerm
index f8f4f7d..c572a3b 100644
--- a/debian/libpetsc3.6.4.prerm
+++ b/debian/libpetsc3.6.4.prerm
@@ -2,8 +2,7 @@
 
 DEB_HOST_MULTIARCH=__DEB_HOST_MULTIARCH__
 PETSC_VERSION=__PETSC_VERSION__
-# use only major.minor as general soname (rather than major.minor.patch.build)
-SONAME=$( echo ${PETSC_VERSION} | awk 'BEGIN { FS="."}; {print $1"."$2 }' )
+SONAME=__PETSC_SONAME_VERSION__
 
 # Remove alternatives links
 if [ "$1" = "remove" ]; then
diff --git a/debian/rules b/debian/rules
index fbe585f..fabcc58 100755
--- a/debian/rules
+++ b/debian/rules
@@ -265,7 +265,7 @@ override_dh_python2:
 override_dh_installdeb:
 	dh_installdeb
 	for pkg in $$(dh_listpackages -a); do \
-	  sed -i -e 's/__PETSC_VERSION__/$(PETSC_VERSION)/; s/__DEB_HOST_MULTIARCH__/$(DEB_HOST_MULTIARCH)/' debian/$$pkg/DEBIAN/*; \
+	  sed -i -e 's/__PETSC_SONAME_VERSION__/$(PETSC_SONAME_VERSION)/; s/__PETSC_VERSION__/$(PETSC_VERSION)/; s/__DEB_HOST_MULTIARCH__/$(DEB_HOST_MULTIARCH)/' debian/$$pkg/DEBIAN/*; \
 	done
 
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/petsc.git



More information about the debian-science-commits mailing list