Skip to content

Commit

Permalink
Add python3 build script (#76)
Browse files Browse the repository at this point in the history
* build python 3.5

* update to 3.5.2-8

* add python3.5 and mpdecimal to Makefile
  • Loading branch information
lguohan authored and qiluo-msft committed Nov 23, 2016
1 parent 5621082 commit f25188e
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,18 @@ LIBTEAM-DEBS=libteam5_1.26-1_amd64.deb \
libteam-dev_1.26-1_amd64.deb \
libteam-utils_1.26-1_amd64.deb

MPDECIMAL_VER=2.4.2-1

MPDECIMAL-DEBS=libmpdec2_$(MPDECIMAL_VER)_amd64.deb \
libmpdec-dev_$(MPDECIMAL_VER)_amd64.deb

PYTHON3_5_VER=3.5.2-8

PYTHON3_5-DEBS=libpython3.5-minimal_$(PYTHON3_5_VER)_amd64.deb \
python3.5-minimal_$(PYTHON3_5_VER)_amd64.deb \
libpython3.5-stdlib_$(PYTHON3_5_VER)_amd64.deb \
python3.5_$(PYTHON3_5_VER)_amd64.deb

## Function: build_project, directory
## Build the project and save the .deb target in the same directory
## TRICK: clean dh state so it will force recreating .deb later
Expand All @@ -44,6 +56,13 @@ $(LIBTEAM-DEBS): $(LIBNL-DEBS)
$(foreach dep, $^, $(call install_deb, $(dep)))
pushd libteam; ./build.sh; popd

$(MPDECIMAL-DEBS):
pushd mpdecimal; ./build.sh; popd

$(PYTHON3_5-DEBS): $(MPDECIMAL-DEBS)
$(foreach dep, $^, $(call install_deb, $(dep)))
pushd python3.5; ./build.sh; popd

redis-sentinel_$(REDIS_VERSION).deb redis-server_$(REDIS_VERSION).deb redis-tools_$(REDIS_VERSION).deb:
pushd redis; ./build.sh; popd

Expand Down
20 changes: 20 additions & 0 deletions src/mpdecimal/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/bin/bash

MPDECIMAL_VER=2.4.2
MPDECIMAL_DEB_VER=1

wget -N http://http.debian.net/debian/pool/main/m/mpdecimal/mpdecimal_${MPDECIMAL_VER}.orig.tar.gz
wget -N http://http.debian.net/debian/pool/main/m/mpdecimal/mpdecimal_${MPDECIMAL_VER}-${MPDECIMAL_DEB_VER}.debian.tar.xz
wget -N http://http.debian.net/debian/pool/main/m/mpdecimal/mpdecimal_${MPDECIMAL_VER}-${MPDECIMAL_DEB_VER}.dsc

dpkg-source -x mpdecimal_${MPDECIMAL_VER}-${MPDECIMAL_DEB_VER}.dsc

pushd mpdecimal-${MPDECIMAL_VER}

sudo apt-get -y build-dep mpdecimal

dpkg-buildpackage -us -uc -b

popd

cp *.deb ../
18 changes: 18 additions & 0 deletions src/python3.5/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/bash

PYTHON_VER=3.5.2
PYTHON_DEB_VER=8

wget -N http://http.debian.net/debian/pool/main/p/python3.5/python3.5_${PYTHON_VER}.orig.tar.xz
wget -N http://http.debian.net/debian/pool/main/p/python3.5/python3.5_${PYTHON_VER}-${PYTHON_DEB_VER}.debian.tar.xz
wget -N http://http.debian.net/debian/pool/main/p/python3.5/python3.5_${PYTHON_VER}-${PYTHON_DEB_VER}.dsc

dpkg-source -x python3.5_${PYTHON_VER}-${PYTHON_DEB_VER}.dsc

pushd python3.5-${PYTHON_VER}

dpkg-buildpackage -us -uc -b

popd

cp *.deb ../

0 comments on commit f25188e

Please sign in to comment.