Skip to content

Commit

Permalink
deb: install build dependencies at build time
Browse files Browse the repository at this point in the history
Else they need to be declared twice, in the control and in the dockerfile

Closes #89
  • Loading branch information
scollazo committed Nov 17, 2017
1 parent 93ebf0b commit bb7a68a
Show file tree
Hide file tree
Showing 14 changed files with 115 additions and 21 deletions.
1 change: 0 additions & 1 deletion debs/trusty/archivematica-storage-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

1 change: 1 addition & 0 deletions debs/trusty/archivematica-storage-service/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,26 @@ Maintainer: Artefactual Systems Inc. <[email protected]>
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
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
21 changes: 17 additions & 4 deletions debs/trusty/archivematica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

2 changes: 1 addition & 1 deletion debs/trusty/archivematica/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion debs/trusty/archivematica/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 14 additions & 2 deletions debs/trusty/archivematica/debian-dashboard/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,22 @@ Source: archivematica-dashboard
Section: utils
Priority: extra
Maintainer: Santiago Collazo <[email protected]>
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:
Expand Down
7 changes: 5 additions & 2 deletions debs/xenial/archivematica-storage-service/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
@@ -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/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 13 additions & 4 deletions debs/xenial/archivematica/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
17 changes: 17 additions & 0 deletions debs/xenial/archivematica/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions debs/xenial/archivematica/debian-MCPServer/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
Source: archivematica-mcp-server
Section: utils
Priority: extra
Maintainer: Santiago Collazo <[email protected]>
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
17 changes: 16 additions & 1 deletion debs/xenial/archivematica/debian-dashboard/control
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,22 @@ Source: archivematica-dashboard
Section: utils
Priority: extra
Maintainer: Santiago Collazo <[email protected]>
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

Expand Down

0 comments on commit bb7a68a

Please sign in to comment.