summaryrefslogtreecommitdiff
path: root/build-deb.sh
diff options
context:
space:
mode:
authorAlexandre Marie <alexandre.marie@synchrotron-soleil.fr>2020-07-21 14:45:14 +0200
committerAlexandre Marie <alexandre.marie@synchrotron-soleil.fr>2020-07-21 14:45:14 +0200
commit328032e2317e3ac4859196bbf12bdb71795302fe (patch)
tree8cd13462beab109e3cb53410c42335b6d1e00ee6 /build-deb.sh
parent33ed2a64c92b0311ae35456c016eb284e426afc2 (diff)
New upstream version 0.13.0+dfsg
Diffstat (limited to 'build-deb.sh')
-rwxr-xr-xbuild-deb.sh91
1 files changed, 81 insertions, 10 deletions
diff --git a/build-deb.sh b/build-deb.sh
index 7ca6d7e..25718f3 100755
--- a/build-deb.sh
+++ b/build-deb.sh
@@ -3,7 +3,7 @@
# Project: Silx
# https://github.com/silx-kit/silx
#
-# Copyright (C) 2015-2019 European Synchrotron Radiation Facility, Grenoble, France
+# Copyright (C) 2015-2020 European Synchrotron Radiation Facility, Grenoble, France
#
# Principal author: Jérôme Kieffer (Jerome.Kieffer@ESRF.eu)
#
@@ -50,6 +50,9 @@ then
buster)
debian_version=10
;;
+ bullseye)
+ debian_version=11
+ ;;
esac
fi
@@ -76,14 +79,19 @@ If the build succeed the directory dist/debian${debian_version} will
contains the packages.
optional arguments:
- --help show this help text
- --install install the packages generated at the end of
- the process using 'sudo dpkg'
- --debian9 Simulate a debian 9 Stretch system
- --debian10 Simulate a debian 10 Buster system
+ --help Show this help text
+ --install Install the packages generated at the end of
+ the process using 'sudo dpkg'
+ --stdeb-py3 Build using stdeb for python3
+ --stdeb-py2.py3 Build using stdeb for python2 and python3
+ --debian9 Simulate a debian 9 Stretch system
+ --debian10 Simulate a debian 10 Buster system
+ --debian11 Simulate a debian 11 Bullseye system
"
install=0
+use_stdeb=0
+stdeb_all_python=0
while :
do
@@ -96,6 +104,16 @@ do
install=1
shift
;;
+ --stdeb-py2)
+ use_stdeb=1
+ stdeb_all_python=0
+ shift
+ ;;
+ --stdeb-py2.py3)
+ use_stdeb=1
+ stdeb_all_python=1
+ shift
+ ;;
--debian9)
debian_version=9
target_system=debian${debian_version}
@@ -103,6 +121,20 @@ do
build_directory=${project_directory}/build/${target_system}
shift
;;
+ --debian10)
+ debian_version=10
+ target_system=debian${debian_version}
+ dist_directory=${project_directory}/dist/${target_system}
+ build_directory=${project_directory}/build/${target_system}
+ shift
+ ;;
+ --debian11)
+ debian_version=11
+ target_system=debian${debian_version}
+ dist_directory=${project_directory}/dist/${target_system}
+ build_directory=${project_directory}/build/${target_system}
+ shift
+ ;;
-*)
echo "Error: Unknown option: $1" >&2
echo "$usage"
@@ -123,8 +155,7 @@ clean_up()
mkdir -p ${build_directory}
}
-build_deb () {
- echo "Build for debian 8 or newer using actual packaging"
+build_deb() {
tarname=${project}_${debianversion}.orig.tar.gz
clean_up
python3 setup.py debian_src
@@ -187,6 +218,9 @@ build_deb () {
10)
debian_name=buster
;;
+ 11)
+ debian_name=bullseye
+ ;;
esac
dch -v ${debianversion}-1 "upstream development build of ${project} ${version}"
@@ -212,10 +246,47 @@ build_deb () {
}
-build_deb
+build_stdeb () {
+ echo "Build for debian using stdeb"
+ tarname=${project}-${strictversion}.tar.gz
+ clean_up
+
+ python setup.py sdist
+ cp -f dist/${tarname} ${build_directory}
+ cd ${build_directory}
+ tar -xzf ${tarname}
+ cd ${project}-${strictversion}
+
+ if [ $stdeb_all_python -eq 1 ]; then
+ echo Using Python 2+3
+ python3 setup.py --command-packages=stdeb.command sdist_dsc --with-python2=True --with-python3=True --no-python3-scripts=True build --no-cython bdist_deb
+ rc=$?
+ else
+ echo Using Python 3
+ # bdist_deb feed /usr/bin using setup.py entry-points
+ python3 setup.py --command-packages=stdeb.command build --no-cython bdist_deb
+ rc=$?
+ fi
+
+ # move packages to dist directory
+ rm -rf ${dist_directory}
+ mkdir -p ${dist_directory}
+ mv -f deb_dist/*.deb ${dist_directory}
+
+ # back to the root
+ cd ../../..
+}
+
+
+if [ $use_stdeb -eq 1 ]; then
+ build_stdeb
+else
+ build_deb
+fi
+
if [ $install -eq 1 ]; then
- sudo su -c "dpkg -i ${dist_directory}/*.deb"
+ sudo -v su -c "dpkg -i ${dist_directory}/*.deb"
fi
exit "$rc"