if test "${CENTOS_DIST}"; then
for dist in ${CENTOS_DIST}; do
- echo -n "$dist "
case $dist in
centos6)
D=6;;
exit 1
esac
cd build/centos/$dist
- docker run --rm -v "$PWD:/build" -w /build/rpmbuild centos:$D ../in-docker-rpm.sh centos $D >log 2>&1
+
+ echo "FROM centos:$D" >Dockerfile
+ echo "RUN yum install -y wget yum-utils rpm-build gcc gcc-c++ make" >>Dockerfile
+ echo "RUN rpm --import http://ftp.indexdata.com/pub/yum/centos/$D/RPM-GPG-KEY-indexdata" >>Dockerfile
+ echo "RUN wget http://ftp.indexdata.com/pub/yum/centos/$D/indexdata.repo -P /etc/yum.repos.d/" >>Dockerfile
+ echo 'ENTRYPOINT ["/bin/sh", "-c"]' >>Dockerfile
+ docker build -t indexdata-build-centos-$D .
+ echo -n "$dist "
+ docker run --rm -v "$PWD:/build" -w /build/rpmbuild indexdata-build-centos-$D ../in-docker-rpm.sh >log 2>&1
if test $? -eq 0; then
echo Done
else
fi
if test "${DEBIAN_DIST}"; then
for dist in ${DEBIAN_DIST}; do
- echo -n "Debian $dist "
cd build/debian/$dist
- docker run --rm -v "$PWD:/build" -w /build/$PRODUCT-$VERSION debian:$dist ../in-docker.sh debian $dist >log 2>&1
+ echo "FROM debian:$dist" >Dockerfile
+ echo 'RUN apt-get update && apt-get -q install -y wget devscripts equivs' >>Dockerfile
+ echo 'RUN wget -q -O - http://ftp.indexdata.dk/debian/indexdata.asc|apt-key add -' >>Dockerfile
+ echo "RUN echo \"deb http://ftp.indexdata.dk/debian $dist main\" >/etc/apt/sources.list.d/indexdata.list" >>Dockerfile
+ docker build -t indexdata-build-debian-$dist .
+ echo -n "Debian $dist "
+ docker run --rm -v "$PWD:/build" -w /build/$PRODUCT-$VERSION indexdata-build-debian-$dist ../in-docker.sh >log 2>&1
if test $? -eq 0; then
echo Done
else
fi
if test "${UBUNTU_DIST}"; then
for dist in ${UBUNTU_DIST}; do
- echo -n "Ubuntu $dist"
cd build/ubuntu/$dist
- docker run --rm -v "$PWD:/build" -w /build/$PRODUCT-$VERSION ubuntu:$dist ../in-docker.sh ubuntu $dist >log 2>&1
+ echo "FROM ubuntu:$dist" >Dockerfile
+ echo 'RUN apt-get update && apt-get -q install -y wget devscripts equivs' >>Dockerfile
+ echo 'RUN wget -q -O - http://ftp.indexdata.dk/debian/indexdata.asc|apt-key add -' >>Dockerfile
+ echo "RUN echo \"deb http://ftp.indexdata.dk/ubuntu $dist main\" >/etc/apt/sources.list.d/indexdata.list" >>Dockerfile
+ docker build -t indexdata-build-ubuntu-$dist .
+ echo -n "Ubuntu $dist "
+ docker run --rm -v "$PWD:/build" -w /build/$PRODUCT-$VERSION indexdata-build-ubuntu-$dist ../in-docker.sh >log 2>&1
if test $? -eq 0; then
echo Done
else
#!/bin/sh
# in-docker.sh
-# Build Debian package in Docker. Use steps like this:
-# make dist
-# ../git-tools/id-deb-build/id-mk-deb-src.sh
-
-# docker run -it --rm -v "$PWD:/build" -w /build/product-version debian:jessie ./in-docker.sh
-#
set -x
-OS=$1
-DIST=$2
DEBIAN_FRONTEND=noninteractive
export DEBIAN_FRONTEND
-apt-get -q update && apt-get -q install -y wget devscripts equivs
-wget -q -O - http://ftp.indexdata.dk/debian/indexdata.asc|apt-key add -
-echo "deb http://ftp.indexdata.dk/${OS} ${DIST} main" >/etc/apt/sources.list.d/indexdata.list
-apt-get -q update
-
+# we want the newest Index Data packages
+apt-get update
mk-build-deps
dpkg -i *-build-deps_*_all.deb || apt-get -q install -f -y
-rm *-build-deps_*_all.deb
+rm *-build-deps_*_all.deb
dpkg-buildpackage -rfakeroot
RET=$?