diff --git a/.dockerignore b/.dockerignore index 74581d6..8f2aca6 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1 +1,3 @@ cpython +.git +temp \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ca59704 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +/temp +/src/out/ \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..85fb544 --- /dev/null +++ b/build.sh @@ -0,0 +1,7 @@ +#!/bin/bash -eux + +VARSFILE=$1 + +ls -la src/$VARSFILE + +time docker run -it --rm --name extbuild -e "VARSFILE=$VARSFILE" -v $PWD/src:/src extpythonbuilder diff --git a/scripts/bootstrap.sh b/scripts/bootstrap.sh index 306d107..78abfec 100755 --- a/scripts/bootstrap.sh +++ b/scripts/bootstrap.sh @@ -1,12 +1,12 @@ -#!/bin/bash +#!/bin/bash -eux # get metadata -cd /src -. vars.sh +ln -s /src/$VARSFILE /tmp/vars.sh +. /tmp/vars.sh # install deps apt-get update -DEBIAN_FRONTEND=noninteractive apt-get install -y $CPYTHON_DEPS +DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" $CPYTHON_DEPS # run the build sudo -Hu builder /build.sh diff --git a/scripts/build.sh b/scripts/build.sh index 7f284f0..7f6952a 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -1,6 +1,10 @@ -#!/bin/bash +#!/bin/bash -eux -. /src/vars.sh +. /tmp/vars.sh + +function template { + perl -p -e 's/\$\{([^}]+)\}/defined $ENV{$1} ? $ENV{$1} : $&/eg' < $1 +} # create build dir cd /build @@ -13,7 +17,14 @@ wget -qO- cpython.tar.gz $PYTHON_TARBALL | tar zxf - -C cpython/ --strip-compone # get debian metadata # todo generate the metadata here -cp -r /src/debian /src/Makefile ./ +# cp -r /src/debian /src/Makefile ./ +mkdir debian +export BUILD_DATE=$(date -R) +template /src/debian/changelog | tee debian/changelog +template /src/debian/control | tee debian/control +cp /src/debian/compat debian/ +cp /src/debian/rules debian/ +cp /src/Makefile ./ # build the deb time dpkg-buildpackage -us -uc -b diff --git a/src/bionic-2.7.16.sh b/src/bionic-2.7.16.sh new file mode 100644 index 0000000..10c707f --- /dev/null +++ b/src/bionic-2.7.16.sh @@ -0,0 +1,8 @@ +#!/bin/bash -eux + +export PYTHON_RELEASE=2.7.16 +export PYTHON_MAJOR=2.7.16 +# export PYTHON_TARBALL="https://github.com/python/cpython/archive/v${PYTHON_RELEASE}.tar.gz" +export PYTHON_TARBALL="http://artifact.scc.net.davepedu.com/repo/tar/cpython/cpython/cpython-${PYTHON_RELEASE}.tar.gz" +export CPYTHON_DEPS="libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev \ + libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev libffi-dev" diff --git a/src/vars.sh b/src/bionic-3.7.3.sh similarity index 91% rename from src/vars.sh rename to src/bionic-3.7.3.sh index 7fe0696..ad12fe1 100644 --- a/src/vars.sh +++ b/src/bionic-3.7.3.sh @@ -1,6 +1,7 @@ -#!/bin/bash +#!/bin/bash -eux export PYTHON_RELEASE=3.7.3 +export PYTHON_MAJOR=3.7 # export PYTHON_TARBALL="https://github.com/python/cpython/archive/v${PYTHON_RELEASE}.tar.gz" export PYTHON_TARBALL="http://artifact.scc.net.davepedu.com/repo/tar/cpython/cpython/cpython-${PYTHON_RELEASE}.tar.gz" export CPYTHON_DEPS="libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev \ diff --git a/src/bionic-3.8.0a4.sh b/src/bionic-3.8.0a4.sh new file mode 100644 index 0000000..aa4532f --- /dev/null +++ b/src/bionic-3.8.0a4.sh @@ -0,0 +1,8 @@ +#!/bin/bash -eux + +export PYTHON_RELEASE=3.8.0a4 +export PYTHON_MAJOR=3.8.0a4 +# export PYTHON_TARBALL="https://github.com/python/cpython/archive/v${PYTHON_RELEASE}.tar.gz" +export PYTHON_TARBALL="http://artifact.scc.net.davepedu.com/repo/tar/cpython/cpython/cpython-${PYTHON_RELEASE}.tar.gz" +export CPYTHON_DEPS="libssl-dev zlib1g-dev libncurses5-dev libncursesw5-dev \ + libreadline-dev libsqlite3-dev libgdbm-dev libdb5.3-dev libbz2-dev libexpat1-dev liblzma-dev tk-dev libffi-dev" diff --git a/src/debian/changelog b/src/debian/changelog index 5465bf4..d6255d9 100644 --- a/src/debian/changelog +++ b/src/debian/changelog @@ -1,5 +1,5 @@ -extpython-python3.7 (3.7.3) unstable; urgency=low +extpython-python${PYTHON_MAJOR} (${PYTHON_RELEASE}) unstable; urgency=low * Initial release - -- Dave Pedu Thu, 30 May 2019 08:47:19 -0800 + -- Dave Pedu ${BUILD_DATE} diff --git a/src/debian/control b/src/debian/control index 648d86b..33911df 100644 --- a/src/debian/control +++ b/src/debian/control @@ -1,4 +1,4 @@ -Source: extpython-python3.7 +Source: extpython-python${PYTHON_MAJOR} Section: unknown Priority: optional Maintainer: ubuntu @@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 8.0.0) Standards-Version: 3.9.4 Homepage: -Package: extpython-python3.7 +Package: extpython-python${PYTHON_MAJOR} Architecture: amd64 Depends: ${shlibs:Depends}, ${misc:Depends} Description: