comparison contrib/packaging/buildrpm @ 45836:de1f4c431619

packaging: switch centos 7 packaging to python 3 Differential Revision: https://phab.mercurial-scm.org/D9293
author Mathias De Mare <mathias.de_mare@nokia.com>
date Fri, 06 Nov 2020 17:32:23 +0100
parents 518655314fc5
children 97205cf0ee4d
comparison
equal deleted inserted replaced
45835:f38d592f871a 45836:de1f4c431619
5 . $(dirname $0)/packagelib.sh 5 . $(dirname $0)/packagelib.sh
6 6
7 BUILD=1 7 BUILD=1
8 RPMBUILDDIR="$PWD/rpmbuild" 8 RPMBUILDDIR="$PWD/rpmbuild"
9 PYTHONEXE=python3 9 PYTHONEXE=python3
10 DOCUTILSPACKAGE=python3-docutils
10 11
11 while [ "$1" ]; do 12 while [ "$1" ]; do
12 case "$1" in 13 case "$1" in
13 --prepare ) 14 --prepare )
14 shift 15 shift
22 --withpython | --with-python) 23 --withpython | --with-python)
23 shift 24 shift
24 PYTHONVER=2.7.16 25 PYTHONVER=2.7.16
25 PYTHONMD5=f1a2ace631068444831d01485466ece0 26 PYTHONMD5=f1a2ace631068444831d01485466ece0
26 PYTHONEXE=python 27 PYTHONEXE=python
28 ;;
29 --docutilspackage)
30 shift
31 DOCUTILSPACKAGE="$1"
32 shift
27 ;; 33 ;;
28 --rpmbuilddir ) 34 --rpmbuilddir )
29 shift 35 shift
30 RPMBUILDDIR="$1" 36 RPMBUILDDIR="$1"
31 shift 37 shift
147 fi 153 fi
148 154
149 sed -i \ 155 sed -i \
150 -e "s/^%define withpython.*$/%define withpython $RPMPYTHONVER/" \ 156 -e "s/^%define withpython.*$/%define withpython $RPMPYTHONVER/" \
151 $rpmspec 157 $rpmspec
158 sed -i \
159 -e "s/^%global pythondocutils.*$/%global pythondocutils $DOCUTILSPACKAGE/" \
160 $rpmspec
152 161
153 if [ "$BUILD" ]; then 162 if [ "$BUILD" ]; then
154 rpmbuild --define "_topdir $RPMBUILDDIR" -ba $rpmspec --clean 163 rpmbuild --define "_topdir $RPMBUILDDIR" -ba $rpmspec --clean
155 if [ $? = 0 ]; then 164 if [ $? = 0 ]; then
156 echo 165 echo