extpython/scripts/build.sh

37 lines
743 B
Bash
Raw Normal View History

2019-05-31 09:07:08 -07:00
#!/bin/bash -eux
2019-05-31 07:41:20 -07:00
2019-05-31 09:07:08 -07:00
. /tmp/vars.sh
function template {
perl -p -e 's/\$\{([^}]+)\}/defined $ENV{$1} ? $ENV{$1} : $&/eg' < $1
}
2019-05-31 07:41:20 -07:00
# 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
2019-05-31 09:07:08 -07:00
# 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 ./
2019-05-31 07:41:20 -07:00
# build the deb
time dpkg-buildpackage -us -uc -b
cd ..
mkdir out
mv *.buildinfo *.changes *.deb out/
cd out
sha256sum *