Skip to content

Commit ae69fca

Browse files
authored
Merge pull request #876 from jgruber/issue.875.master
added build support for Ubuntu 16.04
2 parents d3d993f + b66ae47 commit ae69fca

2 files changed

Lines changed: 52 additions & 0 deletions

File tree

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Dockerfile
2+
FROM ubuntu:xenial
3+
4+
RUN apt-get update && apt-get install -y \
5+
python-stdeb \
6+
fakeroot \
7+
python-all \
8+
dh-python \
9+
git
10+
11+
COPY ./build-debs.sh /
12+
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
#!/bin/bash -ex
2+
3+
SRC_DIR=$1
4+
5+
PKG_NAME="f5-openstack-lbaasv2-driver"
6+
OS_VERSION="1604"
7+
DIST_DIR="${PKG_NAME}-dist/deb_dist"
8+
9+
# Change directory to the source to get package information.
10+
pushd ${SRC_DIR}
11+
12+
pip install -r ${SRC_DIR}/requirements.test.txt
13+
14+
# The version is embedded in the package.
15+
PKG_VERSION=$(python -c "import f5lbaasdriver; print(f5lbaasdriver.__version__)")
16+
PKG_RELEASE=$(python ./${PKG_NAME}-dist/scripts/get-version-release.py --release)
17+
18+
# Exit source directory
19+
popd
20+
21+
# Create a temporary work directory and copy the source to it.
22+
BUILDROOT=$(mktemp -d /tmp/${PKG_NAME}.XXXXX)
23+
cp -R ${SRC_DIR}/* ${BUILDROOT}
24+
pushd ${BUILDROOT}
25+
26+
echo "Building ${PKG_NAME} debian packages..."
27+
28+
# Copy the stdeb.cfg file to the current directory and add the pkg release to it.
29+
cp -R "${SRC_DIR}/${DIST_DIR}/stdeb.cfg" .
30+
echo "Debian-Version: ${PKG_RELEASE}" >> stdeb.cfg
31+
32+
# Build debian package.
33+
python setup.py --command-packages=stdeb.command sdist_dsc
34+
pushd "deb_dist/${PKG_NAME}-${PKG_VERSION}"
35+
export DEB_BUILD_OPTIONS=nocheck
36+
dpkg-buildpackage -rfakeroot -uc -us
37+
popd
38+
39+
pkg="python-${PKG_NAME}_${PKG_VERSION}-${PKG_RELEASE}_all.deb"
40+
cp "deb_dist/${pkg}" "${SRC_DIR}/${DIST_DIR}/${pkg%%_all.deb}_${OS_VERSION}_all.deb"

0 commit comments

Comments
 (0)