From bb7a68af93609a9b4957192a6a1a05a0cf0b3cb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Santiago=20Rodr=C3=ADguez?= Date: Wed, 15 Nov 2017 17:19:08 +0100 Subject: [PATCH] deb: install build dependencies at build time Else they need to be declared twice, in the control and in the dockerfile Closes #89 --- .../archivematica-storage-service/Dockerfile | 1 - .../archivematica-storage-service/build.sh | 1 + .../debian-storage-service/control | 11 +++++++--- debs/trusty/archivematica/Dockerfile | 21 +++++++++++++++---- debs/trusty/archivematica/Makefile | 2 +- debs/trusty/archivematica/build.sh | 2 +- .../archivematica/debian-dashboard/control | 16 ++++++++++++-- .../archivematica-storage-service/Dockerfile | 7 +++++-- .../archivematica-storage-service.install | 2 +- .../debian-storage-service/rules | 2 +- debs/xenial/archivematica/Dockerfile | 17 +++++++++++---- debs/xenial/archivematica/Makefile | 17 +++++++++++++++ .../archivematica/debian-MCPServer/control | 20 ++++++++++++++++++ .../archivematica/debian-dashboard/control | 17 ++++++++++++++- 14 files changed, 115 insertions(+), 21 deletions(-) create mode 100644 debs/xenial/archivematica/debian-MCPServer/control diff --git a/debs/trusty/archivematica-storage-service/Dockerfile b/debs/trusty/archivematica-storage-service/Dockerfile index c314dc33..ebd3329f 100644 --- a/debs/trusty/archivematica-storage-service/Dockerfile +++ b/debs/trusty/archivematica-storage-service/Dockerfile @@ -7,5 +7,4 @@ RUN apt-get update && \ RUN wget -O /tmp/pip.py https://bootstrap.pypa.io/get-pip.py && python /tmp/pip.py # Dependencies are also obtained in the debian build script, this speeds up the process of building packages -RUN apt-get update && apt-get install -y libffi-dev libssl-dev libxslt-dev dh-virtualenv python-dev dh-systemd libmysqlclient-dev postgresql-server-dev-9.5 diff --git a/debs/trusty/archivematica-storage-service/build.sh b/debs/trusty/archivematica-storage-service/build.sh index 18b63e65..b4898af1 100755 --- a/debs/trusty/archivematica-storage-service/build.sh +++ b/debs/trusty/archivematica-storage-service/build.sh @@ -9,6 +9,7 @@ cd $SOURCE BRANCH="$(git branch | cut -d\ -f2-)" COMMIT=$(git rev-parse HEAD) cp -rf ${BASE}/debian-storage-service/* debian/ +yes | mk-build-deps -i debian/control pip download -d lib --no-binary :all: -r requirements.txt dch -v 1:${VERSION}${RELEASE} commit: $(echo $COMMIT) dch -v 1:${VERSION}${RELEASE} checkout: $(echo $BRANCH) diff --git a/debs/trusty/archivematica-storage-service/debian-storage-service/control b/debs/trusty/archivematica-storage-service/debian-storage-service/control index b32ead8b..337c3621 100644 --- a/debs/trusty/archivematica-storage-service/debian-storage-service/control +++ b/debs/trusty/archivematica-storage-service/debian-storage-service/control @@ -5,13 +5,11 @@ Maintainer: Artefactual Systems Inc. Build-Depends: python (>= 2.7.3), debhelper (>= 9), - gnupg, libffi-dev, libssl-dev, libxml2-dev, libxslt-dev, python-dev, - rng-tools, dh-virtualenv (>= 0.8), zlib1g-dev Standards-Version: 3.9.3 @@ -19,7 +17,14 @@ X-Python-Version: 2.7 Package: archivematica-storage-service Architecture: i386 amd64 -Depends: ${python:Depends}, ${misc:Depends}, nginx, unar (>= 1.8.1-4~), python (>= 2.7.3) +Depends: + ${python:Depends}, + ${misc:Depends}, + gnupg, + nginx, + unar (>= 1.8.1-4~), + python (>= 2.7.3), + rng-tools Description: Django webapp for managing storage in an Archivematica installation. Homepage: http://archivematica.org diff --git a/debs/trusty/archivematica/Dockerfile b/debs/trusty/archivematica/Dockerfile index 95fa5c0c..6289a75f 100644 --- a/debs/trusty/archivematica/Dockerfile +++ b/debs/trusty/archivematica/Dockerfile @@ -3,15 +3,28 @@ FROM ubuntu:trusty RUN apt-get update && \ apt-get install -y dpkg-dev git build-essential wget debhelper \ - devscripts equivs quilt + devscripts equivs RUN wget -O /tmp/pip.py https://bootstrap.pypa.io/get-pip.py && python /tmp/pip.py RUN wget -O - "http://keyserver.ubuntu.com:11371/pks/lookup?op=get&search=0x36A76C6C49C29687" | apt-key add - RUN echo deb http://ppa.launchpad.net/spotify-jyrki/dh-virtualenv/ubuntu trusty main >> /etc/apt/sources.list -RUN apt-get update && apt-get install -y dh-virtualenv -RUN apt-get update && apt-get install -y libffi-dev libssl-dev libxslt-dev python-dev libmysqlclient-dev libldap2-dev libsasl2-dev curl +RUN wget -O - https://deb.nodesource.com/setup_8.x | bash - + +ADD debian-dashboard/control /tmp/dashboard +ADD debian-MCPClient/control /tmp/mcpclient +ADD debian-MCPServer/control /tmp/mcpserver + +RUN apt-get update && \ + mkdir debian && \ + mv /tmp/dashboard debian/control && \ + yes | mk-build-deps -i debian/control && \ + mv /tmp/mcpclient debian/control && \ + yes | mk-build-deps -i debian/control && \ + mv /tmp/mcpserver debian/control && \ + yes | mk-build-deps -i debian/control && \ + rm -rf debian + -RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && apt-get install -y nodejs diff --git a/debs/trusty/archivematica/Makefile b/debs/trusty/archivematica/Makefile index 7e2cc6cc..e221ce31 100644 --- a/debs/trusty/archivematica/Makefile +++ b/debs/trusty/archivematica/Makefile @@ -17,7 +17,7 @@ all: build-docker-image build build-docker-image: update-changelog @echo "==> Building Docker image with build environment." - @docker build --rm --tag "$(DOCKER_IMAGE)" . + @docker build --no-cache --rm --tag "$(DOCKER_IMAGE)" . build: @echo "==> Building deb." diff --git a/debs/trusty/archivematica/build.sh b/debs/trusty/archivematica/build.sh index a70d4b31..808a2789 100755 --- a/debs/trusty/archivematica/build.sh +++ b/debs/trusty/archivematica/build.sh @@ -27,7 +27,7 @@ for i in dashboard MCPClient MCPServer archivematicaCommon cp -rf $BASE/debian-$i/* debian/ dch -v 1:${VERSION}${RELEASE} commit: $(echo $COMMIT) dch -v 1:${VERSION}${RELEASE} checkout: $(echo $BRANCH) - dch -r --distribution trusty --urgency high ignored + dch -r --distribution trusty --urgency high ignored QUILT_PATCHES="debian/patches" quilt push -a || true dpkg-buildpackage -us -uc cd $SOURCE diff --git a/debs/trusty/archivematica/debian-dashboard/control b/debs/trusty/archivematica/debian-dashboard/control index 36b88a2a..9445f228 100644 --- a/debs/trusty/archivematica/debian-dashboard/control +++ b/debs/trusty/archivematica/debian-dashboard/control @@ -2,10 +2,22 @@ Source: archivematica-dashboard Section: utils Priority: extra Maintainer: Santiago Collazo -Build-Depends: debhelper (>= 9), libffi-dev, libssl-dev +Build-Depends: + debhelper (>= 9), + libffi-dev, + libldap2-dev, + libsasl2-dev, + libssl-dev, + python-virtualenv, + python-dev, + libxml2-dev, + libxslt1-dev, + libmysqlcilent-dev, + dh-virtualenv (>= 0.11), + quilt, + nodejs (>= 8) Standards-Version: 3.9.8 Homepage: http://archivematica.org - Package: archivematica-dashboard Architecture: any Depends: diff --git a/debs/xenial/archivematica-storage-service/Dockerfile b/debs/xenial/archivematica-storage-service/Dockerfile index eafeaa2b..26dc631f 100644 --- a/debs/xenial/archivematica-storage-service/Dockerfile +++ b/debs/xenial/archivematica-storage-service/Dockerfile @@ -2,10 +2,13 @@ FROM ubuntu:xenial RUN apt-get update && \ apt-get install -y dpkg-dev git build-essential wget debhelper \ - devscripts equivs + devscripts equivs quilt RUN wget -O /tmp/pip.py https://bootstrap.pypa.io/get-pip.py && python /tmp/pip.py # Dependencies are also obtained in the debian build script, this speeds up the process of building packages RUN apt-get update && apt-get install -y libffi-dev libssl-dev libxslt-dev dh-virtualenv python-dev dh-systemd libmysqlclient-dev postgresql-server-dev-9.5 - +ADD debian-storage-service/control /tmp/ +RUN apt-get update && \ + yes | mk-build-deps -i /tmp/control && \ + rm -f /tmp/control diff --git a/debs/xenial/archivematica-storage-service/debian-storage-service/archivematica-storage-service.install b/debs/xenial/archivematica-storage-service/debian-storage-service/archivematica-storage-service.install index 5a16e3af..66e0f773 100644 --- a/debs/xenial/archivematica-storage-service/debian-storage-service/archivematica-storage-service.install +++ b/debs/xenial/archivematica-storage-service/debian-storage-service/archivematica-storage-service.install @@ -1,7 +1,7 @@ #archivematica-storage-service.install install/storage-service.gunicorn-config.py /etc/archivematica/ -install/storageService.logging.conf /etc/archivematica/ +install/storageService.logging.json /etc/archivematica/ install/storage etc/nginx/sites-available/ install/.storage-service var/archivematica/ install/make_key.py var/archivematica/storage-service/ diff --git a/debs/xenial/archivematica-storage-service/debian-storage-service/rules b/debs/xenial/archivematica-storage-service/debian-storage-service/rules index 5d296c7e..b8f9d987 100755 --- a/debs/xenial/archivematica-storage-service/debian-storage-service/rules +++ b/debs/xenial/archivematica-storage-service/debian-storage-service/rules @@ -4,4 +4,4 @@ dh $@ --with python-virtualenv --with systemd override_dh_virtualenv: - dh_virtualenv --extra-pip-arg --no-index --extra-pip-arg --find-links=lib + dh_virtualenv --extra-pip-arg --find-links=lib diff --git a/debs/xenial/archivematica/Dockerfile b/debs/xenial/archivematica/Dockerfile index b05707cb..7845d19e 100644 --- a/debs/xenial/archivematica/Dockerfile +++ b/debs/xenial/archivematica/Dockerfile @@ -2,12 +2,21 @@ FROM ubuntu:xenial RUN apt-get update && \ apt-get install -y dpkg-dev git build-essential wget debhelper \ - devscripts equivs quilt + devscripts equivs RUN wget -O /tmp/pip.py https://bootstrap.pypa.io/get-pip.py && python /tmp/pip.py -RUN apt-get update && apt-get install -y libffi-dev libssl-dev libxslt-dev dh-virtualenv python-dev dh-systemd libmysqlclient-dev libldap2-dev libsasl2-dev curl - -RUN curl -sL https://deb.nodesource.com/setup_8.x | bash - && apt-get install -y nodejs +RUN wget -O - https://deb.nodesource.com/setup_8.x | bash - +ADD debian-dashboard/control /tmp/dashboard +ADD debian-MCPClient/control /tmp/mcpclient +ADD debian-MCPServer/control /tmp/mcpserver +RUN apt-get update && \ + mkdir debian && \ + cp /tmp/dashboard debian/control && \ + yes | mk-build-deps -i debian/control && \ + cp /tmp/mcpclient debian/control && \ + yes | mk-build-deps -i debian/control && \ + cp /tmp/mcpserver debian/control && \ + yes | mk-build-deps -i debian/control diff --git a/debs/xenial/archivematica/Makefile b/debs/xenial/archivematica/Makefile index d9cf5c75..94b6daa4 100644 --- a/debs/xenial/archivematica/Makefile +++ b/debs/xenial/archivematica/Makefile @@ -35,6 +35,23 @@ build: $(DOCKER_IMAGE) \ make -C $(DOCKER_VOLUME) deb-build +dev: + @echo "==> Building deb." + @docker run -i -t \ + -e BRANCH=$(BRANCH) \ + -e VERSION=$(VERSION) \ + -e RELEASE=$(RELEASE) \ + -e BUILD_TYPE=$(BUILD_TYPE) \ + -e GPG_ID=$(GPG_ID) \ + -e GPG_KEY \ + -e PACKBUILD_EXTRA_ARGS="$(PACKBUILD_EXTRA_ARGS)" \ + --rm \ + --volume "$(shell cd ../../ && pwd):$(DEB_TOPDIR)/$(NAME)" \ + --volume "$(shell pwd):$(DOCKER_VOLUME)" \ + $(DOCKER_IMAGE) \ + /bin/bash + + deb-build: deb-clean @echo "==> Install dependencies." # Add GPG if available diff --git a/debs/xenial/archivematica/debian-MCPServer/control b/debs/xenial/archivematica/debian-MCPServer/control new file mode 100644 index 00000000..140ab1bf --- /dev/null +++ b/debs/xenial/archivematica/debian-MCPServer/control @@ -0,0 +1,20 @@ +Source: archivematica-mcp-server +Section: utils +Priority: extra +Maintainer: Santiago Collazo +Build-Depends: debhelper (>= 9) +Standards-Version: 3.9.8 +Homepage: http://archivematica.org + +Package: archivematica-mcp-server +Architecture: i386 amd64 +Depends: + ${shlibs:Depends}, + ${misc:Depends}, + archivematica-common(>=1.6.0), + libmysqlclient20|libmysqlclient18, + dbconfig-common, + mysql-server, + gearman +Description: MCP Server for Archivematica + Workflow manager for Archivematica k diff --git a/debs/xenial/archivematica/debian-dashboard/control b/debs/xenial/archivematica/debian-dashboard/control index 6d162585..daac2a82 100644 --- a/debs/xenial/archivematica/debian-dashboard/control +++ b/debs/xenial/archivematica/debian-dashboard/control @@ -2,7 +2,22 @@ Source: archivematica-dashboard Section: utils Priority: extra Maintainer: Santiago Collazo -Build-Depends: debhelper (>= 9), libffi-dev, libssl-dev +Build-Depends: + debhelper (>= 9), + quilt, + libffi-dev, + libssl-dev, + dh-virtualenv, + dh-systemd, + libffi-dev, + libldap2-dev, + libsasl2-dev, + libssl-dev, + nodejs ( >= 8), + python-dev, + libxml2-dev, + libxslt1-dev, + libmysqlclient-dev Standards-Version: 3.9.8 Homepage: http://archivematica.org