[python-escript] 01/01: dh friendly-ness improvements.
Joel Fenwick
jfenwick-guest at moszumanska.debian.org
Fri Dec 11 05:36:20 UTC 2015
This is an automated email from the git hooks/post-receive script.
jfenwick-guest pushed a commit to branch debian
in repository python-escript.
commit 32a651c10abf4e700c5870a1093621905e0d90ff
Author: Joel Fenwick <joelfenwick at uq.edu.au>
Date: Fri Dec 11 15:32:52 2015 +1000
dh friendly-ness improvements.
Everything fits into override_dh now.
sed transformations moved out of rules and into tweak.sh script.
Corrected python3:depends items
---
.gitignore | 1 +
debian/control | 4 ++--
debian/rules | 37 ++++++++++++++++++++++++-------------
debian/utils/tweak.sh | 36 ++++++++++++++++++++++++++++++++++++
4 files changed, 63 insertions(+), 15 deletions(-)
diff --git a/.gitignore b/.gitignore
index 0d20b64..e804234 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
*.pyc
+.pc
diff --git a/debian/control b/debian/control
index 1ce6a61..bb1b638 100644
--- a/debian/control
+++ b/debian/control
@@ -87,7 +87,7 @@ Description: Escript/Finley finite elements Python3 system (with OpenMP)
OpenMP threading and MPI multiprocess support.
Architecture: any
Pre-Depends: dpkg (>= 1.15.6~)
-Depends: ${python:Depends}, python3-numpy,
+Depends: ${python3:Depends}, python3-numpy,
${shlibs:Depends},
${misc:Depends}
Recommends: python3-sympy, python3-matplotlib, python3-scipy
@@ -113,7 +113,7 @@ Description: Escript/Finley finite elements Python3 system (OpenMP + MPI)
both OpenMP threading and MPI multiprocess support.
Architecture: any
Pre-Depends: dpkg (>= 1.15.6~)
-Depends: ${python:Depends}, python3-numpy, openmpi-bin,
+Depends: ${python3:Depends}, python3-numpy, openmpi-bin,
${shlibs:Depends},
${misc:Depends}
Recommends: python3-sympy, python3-matplotlib, python3-scipy
diff --git a/debian/rules b/debian/rules
index 33481b7..e0d21f2 100755
--- a/debian/rules
+++ b/debian/rules
@@ -19,11 +19,12 @@ WORK3M=$(CURDIR)/debian/stage3M
#thanks to the debian manual
+# export DEB_BUILD_OPTIONS="parallel=10"
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
parbuild=$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
sflags=-j$(parbuild)
else
- sflags=-j10
+ sflags=-j1
endif
%:
@@ -57,7 +58,6 @@ override_dh_auto_build:
mkdir -p $(WORK)
if [ ! -f svn_version ];then echo "No svn_version file found"; exit 3;fi
scons $(sflags) SVN_VERSION=`cat svn_version` build_dir=$(BUILD) verbose=on prefix=$(WORK) options_file=`debian/utils/getsubst`_options.py
- sed -i -e "s%STDLOCATION=0%STDLOCATION=1%" $(WORK)/bin/run-escript
# extract the relevant .py files
cd $(WORK); $(PROJROOT)/debian/utils/cppy.py $(PROJROOT); cd $(PROJROOT)
cp $(PROJROOT)/doc/manpage/man1/run-escript.1 $(WORK)/run-escript2.man
@@ -66,19 +66,15 @@ override_dh_auto_build:
# build_steps for documentation
# depends on the py2 build so don't do anything here
- # which will overwrite changes made in the py2 build
+ # which will overwrite changes made in the py2 build
mkdir -p $(BUILD)
scons $(sflags) SVN_VERSION=`cat svn_version` build_dir=$(BUILD) verbose=on prefix=$(WORK) options_file=`debian/utils/getsubst`_options.py docs
find $(WORK) -name '*.pyc' -print0 | xargs -0 rm -f
- # remove MathJax includes
- sed -i -e 's%<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>%%' $(WORK)/release/doc/sphinx_api/*.html
# Build steps for py2 with MPI
mkdir -p $(WORKM)
if [ ! -f svn_version ];then echo "No svn_version file found"; exit 3;fi
scons $(sflags) SVN_VERSION=`cat svn_version` build_dir=$(BUILDM) cpp_extra='-DOVERLORDPATH=\"/usr/lib/python-escript-mpi/\"' verbose=on prefix=$(WORKM) options_file=`debian/utils/getsubst`_mpi_options.py
- sed -i -e "s%ESCRIPT_ROOT=/usr/lib/python-escript%ESCRIPT_ROOT=/usr/lib/python-escript-mpi%" $(WORKM)/bin/run-escript
- sed -i -e "s%STDLOCATION=0%STDLOCATION=1%" $(WORKM)/bin/run-escript
# extract the relevant .py files
cd $(WORKM); $(PROJROOT)/debian/utils/cppy.py $(PROJROOT); cd $(PROJROOT)
cp $(PROJROOT)/doc/manpage/man1/run-escript.1 $(WORKM)/run-escript2-mpi.man
@@ -90,9 +86,6 @@ override_dh_auto_build:
mkdir -p $(WORK3)
if [ ! -f svn_version ];then echo "No svn_version file found"; exit 3;fi
scons $(sflags) SVN_VERSION=`cat svn_version` build_dir=$(BUILD3) verbose=on prefix=$(WORK3) options_file=`debian/utils/getsubst`_py3_options.py
- sed -i -e "s%STDLOCATION=0%STDLOCATION=1%" $(WORK3)/bin/run-escript
- sed -i -e "s%ESCRIPT_ROOT=/usr/lib/python-escript%ESCRIPT_ROOT=/usr/lib/python3-escript%" $(WORK3)/bin/run-escript
- sed -i -e "s%PYTHON_CMD=python%PYTHON_CMD=python3%" $(WORK3)/bin/run-escript
# extract the relevant .py files
cd $(WORK3); $(PROJROOT)/debian/utils/cppy.py $(PROJROOT); cd $(PROJROOT)
cp $(PROJROOT)/doc/manpage/man1/run-escript.1 $(WORK3)/run-escript3.man
@@ -104,17 +97,35 @@ override_dh_auto_build:
mkdir -p $(WORK3M)
if [ ! -f svn_version ];then echo "No svn_version file found"; exit 3;fi
scons $(sflags) SVN_VERSION=`cat svn_version` build_dir=$(BUILD3M) cpp_extra='-DOVERLORDPATH=\"/usr/lib/python-escript3-mpi/\"' verbose=on prefix=$(WORK3M) options_file=`debian/utils/getsubst`_py3_mpi_options.py
- sed -i -e "s%ESCRIPT_ROOT=/usr/lib/python-escript%ESCRIPT_ROOT=/usr/lib/python3-escript-mpi%" $(WORK3M)/bin/run-escript
- sed -i -e "s%STDLOCATION=0%STDLOCATION=1%" $(WORK3M)/bin/run-escript
- sed -i -e "s%PYTHON_CMD=python%PYTHON_CMD=python3%" $(WORK3M)/bin/run-escript
# extract the relevant .py files
cd $(WORK3M); $(PROJROOT)/debian/utils/cppy.py $(PROJROOT); cd $(PROJROOT)
cp $(PROJROOT)/doc/manpage/man1/run-escript.1 $(WORK3M)/run-escript3-mpi.man
ln $(WORK3M)/bin/run-escript $(WORK3M)/bin/run-escript3-mpi
find $(WORK3M) -name '*.pyc' -print0| xargs -0 rm -f
rm -rf $(BUILD3M)
+
+ # fix paths in each package and
+ # fix some external links in the doc package
+ debian/utils/tweak.sh "$(WORK)" "$(WORKM)" "$(WORK3)" "$(WORK3M)"
+
+
+override_dh_shlibdeps:
+ # so libraries we just built are checked as well
+ dh_shlibdeps -ppython-escript -Npython3-escript -Npython-escript-mpi -Npython3-escript-mpi -Npython-escript-doc -P$(BDEST) -l$(BDEST)/usr/lib/python-escript/lib
+ dh_shlibdeps -ppython-escript-mpi -Npython3-escript -Npython-escript -Npython3-escript-mpi -Npython-escript-doc -P$(BMDEST) -l$(BMDEST)/usr/lib/python-escript-mpi/lib
+ dh_shlibdeps -ppython3-escript -Npython-escript -Npython-escript-mpi -Npython3-escript-mpi -Npython-escript-doc -P$(B3DEST) -l$(B3DEST)/usr/lib/python3-escript/lib
+ dh_shlibdeps -ppython3-escript-mpi -Npython3-escript -Npython-escript -Npython-escript-mpi -Npython-escript-doc -P$(B3MDEST) -l$(B3MDEST)/usr/lib/python3-escript-mpi/lib
+
+override_dh_python2:
+ dh_python2 --compile-all -ppython-escript -Npython3-escript -Npython-escript-mpi -Npython3-escript-mpi -Npython-escript-doc --no-ext-rename usr/lib/python-escript/esys
+ dh_python2 --compile-all -ppython-escript-mpi -Npython3-escript -Npython-escript -Npython3-escript-mpi -Npython-escript-doc --no-ext-rename usr/lib/python-escript-mpi/esys
+
+override_dh_python3:
+ dh_python3 --compile-all -ppython3-escript -Npython-escript -Npython-escript-mpi -Npython3-escript-mpi -Npython-escript-doc --no-ext-rename usr/lib/python3-escript/esys
+ dh_python3 --compile-all -ppython3-escript-mpi -Npython3-escript -Npython-escript -Npython-escript-mpi -Npython-escript-doc --no-ext-rename usr/lib/python3-escript-mpi/esys
+
override_dh_gencontrol:
dh_gencontrol
# This is not strictly part of gencontrol
diff --git a/debian/utils/tweak.sh b/debian/utils/tweak.sh
new file mode 100755
index 0000000..d90bdf4
--- /dev/null
+++ b/debian/utils/tweak.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+# set paths for each package and inform launcher it is operating with
+# tools in known locations
+
+if [ $# -ne 4 ]
+then
+ echo "Incorrect parameter count" >&2
+ exit 1
+fi
+
+
+WORK=$1
+WORKM=$2
+WORK3=$3
+WORK3M=$4
+
+# python-escript
+sed -i -e "s%STDLOCATION=0%STDLOCATION=1%" $WORK/bin/run-escript2
+
+# python-escript-mpi
+sed -i -e "s%ESCRIPT_ROOT=/usr/lib/python-escript%ESCRIPT_ROOT=/usr/lib/python-escript-mpi%" $WORKM/bin/run-escript2-mpi
+sed -i -e "s%STDLOCATION=0%STDLOCATION=1%" $WORKM/bin/run-escript2-mpi
+
+# python-escript3
+sed -i -e "s%STDLOCATION=0%STDLOCATION=1%" $WORK3/bin/run-escript3
+sed -i -e "s%ESCRIPT_ROOT=/usr/lib/python-escript%ESCRIPT_ROOT=/usr/lib/python3-escript%" $WORK3/bin/run-escript3
+sed -i -e "s%PYTHON_CMD=python%PYTHON_CMD=python3%" $WORK3/bin/run-escript3
+
+# python-escript3-mpi
+sed -i -e "s%ESCRIPT_ROOT=/usr/lib/python-escript%ESCRIPT_ROOT=/usr/lib/python3-escript-mpi%" $WORK3M/bin/run-escript3-mpi
+sed -i -e "s%STDLOCATION=0%STDLOCATION=1%" $WORK3M/bin/run-escript3-mpi
+sed -i -e "s%PYTHON_CMD=python%PYTHON_CMD=python3%" $WORK3M/bin/run-escript3-mpi
+
+# documentation
+sed -i -e 's%<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>%%' $WORK/release/doc/sphinx_api/*.html
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/python-escript.git
More information about the debian-science-commits
mailing list