abandon submodule technique

This commit is contained in:
dave 2019-05-31 07:41:20 -07:00
parent 4cf8c4b911
commit b4bbd7ab89
15 changed files with 87 additions and 32 deletions

3
.gitmodules vendored
View File

@ -1,3 +0,0 @@
[submodule "cpython"]
path = cpython
url = https://github.com/python/cpython.git

View File

@ -1,12 +1,14 @@
FROM ubuntu:bionic
RUN sed -i -E 's/(archive|security).ubuntu.com/192.168.1.142/' /etc/apt/sources.list && \
sed -i -E 's/^deb-src/# deb-src/' /etc/apt/sources.list
sed -i -E 's/^deb-src/# deb-src/' /etc/apt/sources.list && \
apt-get update && \
apt-get install -y dpkg-dev debhelper build-essential sudo wget curl
RUN apt-get update && \
apt-get install -y dpkg-dev debhelper && \
useradd builder && \
install -d /target -o builder -g builder
RUN useradd builder && \
install -d /build -o builder -g builder
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y 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
ADD scripts/bootstrap.sh /bootstrap.sh
ADD scripts/build.sh /build.sh
ENTRYPOINT ["/bootstrap.sh"]

22
README.md Normal file
View File

@ -0,0 +1,22 @@
Deb builder for extpython
Build process:
- ./build.sh to kick off the process, runs a docker image - docker run -it --rm -v $PWD:/src ubuntu:bionic bash
- ./build-inner.sh called in the container, prepares the environment
- ./build-inner.sh switches to an underpriv'd user and calls...
- ./build-deb.sh - does the actual build
TODO:
- parameterize the build:
- vars.sh needs to pass PYTHON_RELEASE down into the makefile
- debian metadata files need to obey this too:
- changelog: package name and version
- control: package name
- Makefile: a component of the --prefix path
TODO later:
- upload resulting deb to artifact
- support other than Bionic
- separate process into creating the builder image & building the deb itself
- parameter for pre-loaded pip modules

View File

@ -1,11 +0,0 @@
#!/bin/bash
# export PATH=$PATH:/usr/bin
time dpkg-buildpackage -us -uc -b
ls -la ../
mkdir -p ./out
mv ../*.buildinfo ../*.changes ../*.deb

View File

@ -1,3 +0,0 @@
#!/bin/sh
sudo docker run -it --rm --workdir=/target/src -v $PWD:/target/src extbuilder ./build-inner.sh

@ -1 +0,0 @@
Subproject commit 1bf9cc509326bc42cd8cb1650eb9bf64550d817e

5
debian/changelog vendored
View File

@ -1,5 +0,0 @@
extpython-python3.7 (3.7.0) unstable; urgency=low
* Initial release
-- Dave Pedu <dave@davepedu.com> Wed, 17 OPct 2018 22:08:15 -0800

17
scripts/bootstrap.sh Executable file
View File

@ -0,0 +1,17 @@
#!/bin/bash
# get metadata
cd /src
. vars.sh
# install deps
apt-get update
DEBIAN_FRONTEND=noninteractive apt-get install -y $CPYTHON_DEPS
# run the build
sudo -Hu builder /build.sh
# export the debs
OUTDIR="/src/out/$PYTHON_RELEASE/"
mkdir -p $OUTDIR
cp /build/out/* $OUTDIR

25
scripts/build.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
. /src/vars.sh
# create build dir
cd /build
mkdir work
cd work
# get cpython source
mkdir cpython
wget -qO- cpython.tar.gz $PYTHON_TARBALL | tar zxf - -C cpython/ --strip-components=1
# get debian metadata
# todo generate the metadata here
cp -r /src/debian /src/Makefile ./
# build the deb
time dpkg-buildpackage -us -uc -b
cd ..
mkdir out
mv *.buildinfo *.changes *.deb out/
cd out
sha256sum *

View File

@ -1,7 +1,7 @@
#!/usr/bin/make -f
PY3_SRC=./cpython/
PY3_CONFFLAGS=--prefix=$(DESTDIR)/opt/extpython/3.7.0 --with-ensurepip=install
PY3_CONFFLAGS=--prefix=$(DESTDIR)/opt/extpython/3.7 --with-ensurepip=install
all:
cd $(PY3_SRC) && \
@ -11,7 +11,7 @@ all:
install:
cd $(PY3_SRC) && \
make install
# $(DESTDIR)/opt/extpython/3.7.0/bin/python3 $(DESTDIR)/opt/extpython/3.7.0/bin/pip3 install -r requirements.txt
# $(DESTDIR)/opt/extpython/3.7.0/bin/python3 $(DESTDIR)/opt/extpython/3.7/bin/pip3 install -r requirements.txt
clean:
cd $(PY3_SRC) && \

5
src/debian/changelog Normal file
View File

@ -0,0 +1,5 @@
extpython-python3.7 (3.7.3) unstable; urgency=low
* Initial release
-- Dave Pedu <dave@davepedu.com> Thu, 30 May 2019 08:47:19 -0800

7
src/vars.sh Normal file
View File

@ -0,0 +1,7 @@
#!/bin/bash
export PYTHON_RELEASE=3.7.3
# 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"