@@ -10,6 +10,8 @@ if [ ! -f debian/changelog.in ]; then
10
10
echo " Debian changelog file not found"
11
11
exit 1
12
12
fi
13
+
14
+ # Build python2 package
13
15
BUILD_DIR=${BUILD_DIR:- `pwd`/ debbuild}
14
16
mkdir -p $BUILD_DIR
15
17
rm -rf $BUILD_DIR /*
@@ -28,3 +30,43 @@ mv $BUILD_DIR/$SOURCE_FILE $BUILD_DIR/${NAME}_${VERSION}.orig.tar.gz
28
30
pushd ${SOURCE_DIR}
29
31
debuild -d -us -uc
30
32
popd
33
+
34
+ # Save the python2 package
35
+ cp debbuild/* .deb .
36
+ rm -rf debbuild
37
+
38
+ # Prepare build scripts for python3
39
+ cp debian/control .
40
+ cp debian/rules .
41
+ sed -i " s/python/python3/g" debian/control
42
+ sed -i " s/Package: aci-integration-module/Package: python3-aci-integration-module/g" debian/control
43
+ sed -i " s/Python2.7/Python3/g" debian/control
44
+ sed -i " s/2.7/3.3/g" debian/control
45
+ sed -i " s/acitoolkit/python3-acitoolkit/g" debian/control
46
+ sed -i " s/apicapi/python3-apicapi/g" debian/control
47
+ sed -i " s/python2/python3/g" debian/rules
48
+
49
+ # Build the python3 package
50
+ BUILD_DIR=${BUILD_DIR:- `pwd`/ debbuild}
51
+ mkdir -p $BUILD_DIR
52
+ rm -rf $BUILD_DIR /*
53
+ NAME=` python3 setup.py --name`
54
+ VERSION_PY=` python3 setup.py --version`
55
+ VERSION=` echo $VERSION_PY | sed -nre ' s,([^\.]+.[^\.]+.[^\.]+)((\.)(0[^\.]+))?((\.)(dev.*))?,\1 \4 \7,p' | sed -re ' s/ *$//g' | sed -re ' s/ +/~/g' `
56
+ REVISION=${REVISION:- 1}
57
+ python3 setup.py sdist --dist-dir $BUILD_DIR
58
+ SOURCE_FILE=${NAME} -${VERSION_PY} .tar.gz
59
+ tar -C $BUILD_DIR -xf $BUILD_DIR /$SOURCE_FILE
60
+ SOURCE_DIR=$BUILD_DIR /${NAME} -${VERSION_PY}
61
+ cp -H -r debian $SOURCE_DIR /
62
+ sed -e " s/@VERSION@/$VERSION /" -e " s/@REVISION@/$REVISION /" ${SOURCE_DIR} /debian/changelog.in > ${SOURCE_DIR} /debian/changelog
63
+
64
+ mv $BUILD_DIR /$SOURCE_FILE $BUILD_DIR /${NAME} _${VERSION} .orig.tar.gz
65
+ pushd ${SOURCE_DIR}
66
+ debuild -d -us -uc
67
+ popd
68
+
69
+ # restore the original files and debian packages
70
+ mv control debian/control
71
+ mv rules debian/rules
72
+ mv * .deb debbuild/
0 commit comments