Browse Source

multi version support

master
dave 1 year ago
parent
commit
85e92b99c2
10 changed files with 51 additions and 12 deletions
  1. +2
    -0
      .dockerignore
  2. +2
    -0
      .gitignore
  3. +7
    -0
      build.sh
  4. +4
    -4
      scripts/bootstrap.sh
  5. +14
    -3
      scripts/build.sh
  6. +8
    -0
      src/bionic-2.7.16.sh
  7. +2
    -1
      src/bionic-3.7.3.sh
  8. +8
    -0
      src/bionic-3.8.0a4.sh
  9. +2
    -2
      src/debian/changelog
  10. +2
    -2
      src/debian/control

+ 2
- 0
.dockerignore View File

@@ -1 +1,3 @@
cpython
.git
temp

+ 2
- 0
.gitignore View File

@@ -0,0 +1,2 @@
/temp
/src/out/

+ 7
- 0
build.sh View File

@@ -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

+ 4
- 4
scripts/bootstrap.sh View File

@@ -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


+ 14
- 3
scripts/build.sh View File

@@ -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


+ 8
- 0
src/bionic-2.7.16.sh View File

@@ -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"

src/vars.sh → src/bionic-3.7.3.sh View File

@@ -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 \

+ 8
- 0
src/bionic-3.8.0a4.sh View File

@@ -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"

+ 2
- 2
src/debian/changelog View File

@@ -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 <dave@davepedu.com> Thu, 30 May 2019 08:47:19 -0800
-- Dave Pedu <dave@davepedu.com> ${BUILD_DATE}

+ 2
- 2
src/debian/control View File

@@ -1,4 +1,4 @@
Source: extpython-python3.7
Source: extpython-python${PYTHON_MAJOR}
Section: unknown
Priority: optional
Maintainer: ubuntu <ubuntu@unknown>
@@ -6,7 +6,7 @@ Build-Depends: debhelper (>= 8.0.0)
Standards-Version: 3.9.4
Homepage: <insert the upstream URL, if relevant>

Package: extpython-python3.7
Package: extpython-python${PYTHON_MAJOR}
Architecture: amd64
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: <insert up to 60 chars description>


Loading…
Cancel
Save