From e3c398998c32d65b2ec386f8128113748d6968ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jes=C3=BAs=20Garc=C3=ADa=20Crespo?= Date: Sun, 30 May 2021 14:46:10 +0200 Subject: [PATCH] Use Python 3.6 in AM/SS RPM packages * Install dh-virtualenv 1.2 from author's PPA * Use Python 3.6 and new requirements file * Update PYTHONPATH of MCPClient * Remove workarounds for Python 2.x * Remove workarounds for old releases * Remove quilt (no patches needed) * Remove unused build variables * Introduce archivematica placeholder package (deb) with virtualenv * Stop configuring packages.archivematica.org --- .../archivematica-storage-service/Dockerfile | 39 +++++++--- .../archivematica-storage-service/Makefile | 77 +++++++++---------- .../archivematica-storage-service/build.sh | 7 +- .../changelog.sh | 5 +- .../archivematica-storage-service.install | 2 +- .../debian-storage-service/control | 28 ++++--- .../debian-storage-service/postinst | 38 +-------- .../debian-storage-service/postrm | 5 +- .../debian-storage-service/preinst | 13 +--- .../debian-storage-service/rules | 6 +- debs/bionic/archivematica/Dockerfile | 46 +++++++---- debs/bionic/archivematica/Makefile | 75 +++++++++--------- debs/bionic/archivematica/build.sh | 42 ++++++---- .../archivematica-mcp-client.default | 4 +- .../archivematica-mcp-client.service | 6 +- .../archivematica/debian-MCPClient/control | 19 +++-- .../archivematica/debian-MCPClient/copyright | 43 ----------- .../archivematica/debian-MCPClient/postinst | 11 --- .../archivematica/debian-MCPClient/rules | 11 +-- .../archivematica-mcp-server.service | 6 +- .../archivematica/debian-MCPServer/control | 18 ++--- .../archivematica/debian-MCPServer/copyright | 43 ----------- .../archivematica/debian-MCPServer/postinst | 11 --- .../archivematica/debian-MCPServer/prerm | 2 +- .../archivematica/debian-MCPServer/rules | 11 +-- .../archivematica.install} | 0 .../debian-archivematica/changelog | 7 ++ .../archivematica/debian-archivematica/compat | 1 + .../debian-archivematica/control | 22 ++++++ .../archivematica/debian-archivematica/rules | 18 +++++ .../debian-archivematica/source/format | 1 + .../debian-archivematicaCommon/control | 21 +++-- .../debian-archivematicaCommon/copyright | 43 ----------- .../debian-archivematicaCommon/rules | 11 +-- .../archivematica-dashboard.service | 2 +- .../archivematica/debian-dashboard/control | 27 +++---- .../archivematica/debian-dashboard/copyright | 43 ----------- .../archivematica/debian-dashboard/postinst | 22 +----- .../archivematica/debian-dashboard/rules | 11 +-- 39 files changed, 292 insertions(+), 505 deletions(-) delete mode 100644 debs/bionic/archivematica/debian-MCPClient/copyright delete mode 100644 debs/bionic/archivematica/debian-MCPServer/copyright rename debs/bionic/archivematica/{debian-archivematicaCommon/.placeholder => debian-archivematica/archivematica.install} (100%) create mode 100644 debs/bionic/archivematica/debian-archivematica/changelog create mode 100644 debs/bionic/archivematica/debian-archivematica/compat create mode 100644 debs/bionic/archivematica/debian-archivematica/control create mode 100755 debs/bionic/archivematica/debian-archivematica/rules create mode 100644 debs/bionic/archivematica/debian-archivematica/source/format delete mode 100644 debs/bionic/archivematica/debian-archivematicaCommon/copyright delete mode 100644 debs/bionic/archivematica/debian-dashboard/copyright diff --git a/debs/bionic/archivematica-storage-service/Dockerfile b/debs/bionic/archivematica-storage-service/Dockerfile index 9fd8830c..c65ede9f 100644 --- a/debs/bionic/archivematica-storage-service/Dockerfile +++ b/debs/bionic/archivematica-storage-service/Dockerfile @@ -1,15 +1,30 @@ FROM ubuntu:bionic -RUN apt-get update && \ - apt-get install -y dpkg-dev git build-essential wget debhelper \ - devscripts equivs quilt apt-transport-https python-minimal - -RUN wget -O /tmp/pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && python /tmp/pip.py - -RUN wget -O - https://packages.archivematica.org/1.7.x/key.asc |\ - apt-key add - && \ - echo "deb [arch=amd64] http://packages.archivematica.org/1.7.x/ubuntu-externals xenial main" >> /etc/apt/sources.list - -# 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-10 libldap2-dev libsasl2-dev +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update \ + && apt-get install -y \ + dpkg-dev \ + git \ + build-essential \ + debhelper \ + devscripts \ + equivs \ + apt-transport-https \ + python3.6-dev \ + python3.6-distutils \ + libffi-dev \ + libssl-dev \ + libxslt-dev \ + dh-systemd \ + libmysqlclient-dev \ + postgresql-server-dev-10 \ + libldap2-dev \ + libsasl2-dev \ + software-properties-common \ + && add-apt-repository ppa:jyrki-pulliainen/dh-virtualenv \ + && apt-get install -y dh-virtualenv \ + && rm -rf /var/lib/apt/lists/* \ + && update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1 \ + && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 \ + && curl -s https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py && python /tmp/get-pip.py diff --git a/debs/bionic/archivematica-storage-service/Makefile b/debs/bionic/archivematica-storage-service/Makefile index 4b20ea62..2269dd8b 100644 --- a/debs/bionic/archivematica-storage-service/Makefile +++ b/debs/bionic/archivematica-storage-service/Makefile @@ -1,68 +1,68 @@ NAME = am-packbuild -PACKAGE ?= archivematica +PACKAGE = archivematica-storage-service DEB_TOPDIR = "/debbuild" DOCKER_VOLUME = "/src" -DOCKER_IMAGE = "debbuild-$(NAME)-$(VERSION)" -GPG_ID ?= 0F4A4D31 -PACKBUILD_EXTRA_ARGS ?= -#PACKBUILD_EXTRA_ARGS ?= "-b 1" -PACKAGE = archivematica-storage-service -BRANCH ?= qa/0.x -VERSION ?= 0.13.0 -RELEASE ?= -3 -BUILD_TYPE ?= ss +DOCKER_IMAGE = "debbuild-$(NAME)-$(PACKAGE)-$(VERSION)" +GPG_ID ?= 0F4A4D31 +BRANCH ?= qa/0.x +VERSION ?= 0.18.0 +RELEASE ?= -1 +GIT_REPO = "https://github.com/artefactual/archivematica-storage-service" -.PHONY: build-docker-image build deb-build deb-clean deb-test update-changelog +.DEFAULT_GOAL := build -all: build-docker-image deb-clean build - -build-docker-image: update-changelog +.PHONY: build-docker-image +build-docker-image: @echo "==> Building Docker image with build environment." @docker build --rm --tag "$(DOCKER_IMAGE)" . -build: +.PHONY: build +build: build-docker-image @echo "==> Building deb." @docker run \ - -e BRANCH=$(BRANCH) \ + -e BRANCH=$(BRANCH) \ -e VERSION=$(VERSION) \ -e RELEASE=$(RELEASE) \ -e PACKAGE=$(PACKAGE) \ - -e BUILD_TYPE=$(BUILD_TYPE) \ - -e GPG_ID=$(GPG_ID) \ + -e GPG_ID=$(GPG_ID) \ -e GPG_KEY \ - -e PACKBUILD_EXTRA_ARGS="$(PACKBUILD_EXTRA_ARGS)" \ + -e GIT_REPO="$(GIT_REPO)" \ --rm \ - --volume "$(shell cd ../../ && pwd):$(DEB_TOPDIR)/$(NAME)" \ + --volume "$(shell cd ../../ && pwd):$(DEB_TOPDIR)/$(NAME)" \ --volume "$(shell pwd):$(DOCKER_VOLUME)" \ - $(DOCKER_IMAGE) \ - make -C $(DOCKER_VOLUME) deb-build + $(DOCKER_IMAGE) \ + make -C $(DOCKER_VOLUME) deb-build -deb-build: - @echo "==> Install dependencies." - # Add GPG if available - @if [ -f "$(DOCKER_VOLUME)/GPG-KEY" ]; then gpg --import $(DOCKER_VOLUME)/GPG-KEY; fi - @if [ x"$$GPG_KEY" != x ]; then echo "$$GPG_KEY" | gpg --import - ; fi +.PHONY: deb-build +deb-build: deb-clean git-clone import-gpg-key @cd /debbuild/$(NAME) - @echo "==> Clone code." ./build.sh mkdir -p repo/ cp -rf src/archivematica-*.* repo - cd repo && dpkg-scanpackages . | gzip > Packages.gz + cd repo && dpkg-scanpackages . | gzip > Packages.gz -deb-clean: - @echo "==> Cleaning up previous builds." - @rm -rf $(DOCKER_VOLUME)/repo/ - @rm -rf $(DOCKER_VOLUME)/src/ - mkdir -p src/$(PACKAGE) - rm -rf src/ +.PHONY: import-gpg-key +import-gpg-key: + @if [ -f "$(DOCKER_VOLUME)/GPG-KEY" ]; then gpg --import $(DOCKER_VOLUME)/GPG-KEY; fi + @if [ x"$$GPG_KEY" != x ]; then echo "$$GPG_KEY" | gpg --import - ; fi + +.PHONY: git-clone +git-clone: @git clone \ --quiet \ --branch $(BRANCH) \ --depth 1 \ --single-branch \ - https://github.com/artefactual/$(PACKAGE) src/$(PACKAGE) + $(GIT_REPO) src/$(PACKAGE) -cleanup: +.PHONY: deb-clean +deb-clean: + @echo "==> Cleaning up previous builds." + @rm -rf $(DOCKER_VOLUME)/repo/ + @rm -rf $(DOCKER_VOLUME)/src/ + +.PHONY: cleanup +cleanup: build-docker-image @echo "==> Remove artifacts created as root." @docker run -i \ --rm \ @@ -70,6 +70,3 @@ cleanup: --volume "$(shell pwd):$(DOCKER_VOLUME)" \ $(DOCKER_IMAGE) \ rm -rf /src/repo/ /src/src/ - -deb-test: - @docker run --rm --volume="$(shell pwd):$(DOCKER_VOLUME)" ubuntu:trusty echo "Create repo and install package" diff --git a/debs/bionic/archivematica-storage-service/build.sh b/debs/bionic/archivematica-storage-service/build.sh index 10747a8c..02a15fe5 100755 --- a/debs/bionic/archivematica-storage-service/build.sh +++ b/debs/bionic/archivematica-storage-service/build.sh @@ -1,15 +1,16 @@ -#!/bin/bash -x +#!/usr/bin/env bash + +set -euxo BASE="$(pwd)" SOURCE=${BASE}/src/archivematica-storage-service/ export DEBFULLNAME="Artefactual Systems" export DEBEMAIL="sysadmin@artefactual.com" +export DEB_BUILD_OPTIONS="noddebs" cd $SOURCE COMMIT=$(git rev-parse HEAD) cp -rf ${BASE}/debian-storage-service debian -QUILT_PATCHES="debian/patches" quilt push -a || true -pip download -d lib --no-binary :all: -r requirements.txt yes | mk-build-deps -i debian/control dch -v 1:${VERSION}${RELEASE}~18.04 commit: $(echo $COMMIT) dch -v 1:${VERSION}${RELEASE}~18.04 checkout: $(echo $BRANCH) diff --git a/debs/bionic/archivematica-storage-service/changelog.sh b/debs/bionic/archivematica-storage-service/changelog.sh index 46958458..36977640 100755 --- a/debs/bionic/archivematica-storage-service/changelog.sh +++ b/debs/bionic/archivematica-storage-service/changelog.sh @@ -1,4 +1,5 @@ -#!/bin/bash +#!/usr/bin/env bash + export DEBFULLNAME="Artefactual Systems" export DEBEMAIL="sysadmin@artefactual.com" BRANCH="$(git branch | cut -d\ -f2-)" @@ -6,4 +7,4 @@ COMMIT=$(git rev-parse HEAD) dch -v 1:${VERSION}${RELEASE} commit: $(echo $COMMIT) dch -v 1:${VERSION}${RELEASE} checkout: $(echo $BRANCH) -dch -r --distribution xenial --urgency high ignored +dch -r --distribution bionic --urgency high ignored diff --git a/debs/bionic/archivematica-storage-service/debian-storage-service/archivematica-storage-service.install b/debs/bionic/archivematica-storage-service/debian-storage-service/archivematica-storage-service.install index a00d2f00..b6e03081 100644 --- a/debs/bionic/archivematica-storage-service/debian-storage-service/archivematica-storage-service.install +++ b/debs/bionic/archivematica-storage-service/debian-storage-service/archivematica-storage-service.install @@ -5,4 +5,4 @@ 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/ -storage_service/* /usr/share/archivematica/virtualenvs/archivematica-storage-service/lib/python2.7/site-packages/storage_service/ +storage_service/* /usr/share/archivematica/virtualenvs/archivematica-storage-service/lib/python3.6/site-packages/storage_service/ diff --git a/debs/bionic/archivematica-storage-service/debian-storage-service/control b/debs/bionic/archivematica-storage-service/debian-storage-service/control index 2a3fc0e2..ca83f9cb 100644 --- a/debs/bionic/archivematica-storage-service/debian-storage-service/control +++ b/debs/bionic/archivematica-storage-service/debian-storage-service/control @@ -1,28 +1,36 @@ Source: archivematica-storage-service Section: utils Priority: extra -Maintainer: Artefactual Systems Inc. -Build-Depends: - python (>= 2.7.3), - debhelper (>= 9), +Maintainer: Artefactual Systems Inc. +Build-Depends: + python3.6-dev, + debhelper, + dh-virtualenv (>= 1.2.2), gnupg, libmysqlclient-dev, libffi-dev, libssl-dev, libxml2-dev, libxslt-dev, - python-dev, - dh-virtualenv (>= 0.8), dh-systemd, + dh-virtualenv, libldap2-dev, libsasl2-dev, zlib1g-dev -Standards-Version: 3.9.3 -X-Python-Version: 2.7 +Standards-Version: 3.9.8 +X-Python-Version: 3.6 Package: archivematica-storage-service -Architecture: i386 amd64 -Depends: ${python:Depends}, ${misc:Depends}, nginx, unar (>= 1.8.1-4~), python (>= 2.7.3), rng-tools, gnupg1, gettext +Architecture: amd64 +Depends: + ${misc:Depends}, + nginx, + unar (>= 1.8.1-4~), + python3, + python3-distutils, + rng-tools, + gnupg1, + gettext Description: Django webapp for managing storage in an Archivematica installation. Homepage: http://archivematica.org diff --git a/debs/bionic/archivematica-storage-service/debian-storage-service/postinst b/debs/bionic/archivematica-storage-service/debian-storage-service/postinst index cf33953e..c94b1030 100644 --- a/debs/bionic/archivematica-storage-service/debian-storage-service/postinst +++ b/debs/bionic/archivematica-storage-service/debian-storage-service/postinst @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash SS_ENV_DIR="/usr/share/archivematica/virtualenvs/archivematica-storage-service" @@ -13,19 +13,8 @@ else adduser --uid 333 --group --system --home /var/lib/archivematica/ archivematica fi -# Remove dh-virtualenv build path in editable pip requirements and other local/bin files -# https://github.com/spotify/dh-virtualenv/issues/134 -# https://github.com/archivematica/Issues/issues/903 -for filename in /usr/share/archivematica/virtualenvs/archivematica-storage-service/local/bin/* \ - /usr/share/archivematica/virtualenvs/archivematica-storage-service/lib/python2.7/site-packages/*.pth \ - /usr/share/archivematica/virtualenvs/archivematica-storage-service/lib/python2.7/site-packages/*.egg-link ; do - if [ -f "$filename" ]; then - sed -i "s/\/src\/src\/archivematica-storage-service\/debian\/archivematica-storage-service//g" $filename - fi -done - echo "creating django secret key" -KEYCMD=$(python /var/archivematica/storage-service/make_key.py 2>&1) +KEYCMD=$(python3 /var/archivematica/storage-service/make_key.py 2>&1) echo $KEYCMD sed -i "s/CHANGE_ME_WITH_A_SECRET_KEY/\"$KEYCMD\"/g" /etc/default/archivematica-storage-service @@ -40,31 +29,12 @@ source /etc/default/archivematica-storage-service set +a echo "creating symlink in /usr/lib/archivematica" rm -f /usr/lib/archivematica/storage-service -ln -s -f ${SS_ENV_DIR}/lib/python2.7/site-packages/storage_service/ /usr/lib/archivematica/storage-service +ln -s -f ${SS_ENV_DIR}/lib/python3.6/site-packages/storage_service/ /usr/lib/archivematica/storage-service cd /usr/lib/archivematica/storage-service echo "configuring django database and static files" -find /usr/lib/archivematica/storage-service/ -name '*.pyc' -delete -# 0.3.0 will automatically fake the first migration -if [[ $2 == '0.7.'* || $2 == '0.6.'* || $2 == '0.5.'* || $2 == '0.4.'* ]]; then - echo 'Faking the 0.4 migration' - ${SS_ENV_DIR}/bin/python manage.py migrate locations 0002_v0_4 --fake -fi -if [[ $2 == '0.7.'* || $2 == '0.6.'* || $2 == '0.5.'* ]]; then - echo 'Faking 0.5 migration' - ${SS_ENV_DIR}/bin/python manage.py migrate locations 0003_v0_5 --fake -fi - -if [[ $2 == '0.7.'* || $2 == '0.6.'* ]]; then - echo 'No migrations in 0.6' -fi - -if [[ $2 == '1:0.7.'* ]]; then - echo 'Faking 0.7 migration' - ${SS_ENV_DIR}/bin/python manage.py migrate locations 0004_v0_7 --fake - ${SS_ENV_DIR}/bin/python manage.py migrate --fake-initial -fi +find /usr/lib/archivematica/storage-service/ -name '*.pyc' -delete ${SS_ENV_DIR}/bin/python manage.py migrate mkdir -p /usr/lib/archivematica/storage-service/assets diff --git a/debs/bionic/archivematica-storage-service/debian-storage-service/postrm b/debs/bionic/archivematica-storage-service/debian-storage-service/postrm index fe4e5dbf..65142222 100644 --- a/debs/bionic/archivematica-storage-service/debian-storage-service/postrm +++ b/debs/bionic/archivematica-storage-service/debian-storage-service/postrm @@ -1,11 +1,8 @@ #!/bin/bash -#postrm -#run after the package is uninstalled - echo "postrm" $1 + if [ $1 = "remove" ]; then - #clean up storage service directories rm -rf /usr/share/python/archivematica-storage-service rm -rf /usr/share/archivematica/virtualenvs/archivematica-storage-service rm -rf /var/archivematica/storage* diff --git a/debs/bionic/archivematica-storage-service/debian-storage-service/preinst b/debs/bionic/archivematica-storage-service/debian-storage-service/preinst index 427b325d..a6fe9cc5 100644 --- a/debs/bionic/archivematica-storage-service/debian-storage-service/preinst +++ b/debs/bionic/archivematica-storage-service/debian-storage-service/preinst @@ -1,12 +1,3 @@ -#!/bin/bash +#!/usr/bin/env bash -echo "preinst called with:" $1 $2 - -# version 0.3.0.release postrm had a bug that prevents upgrades from working -if [ x$2 == x"0.3.0.release" ]; then - echo "saving original files" - rm -f /var/lib/dpkg/info/archivematica-storage-service.postrm - # backup important user files - mkdir -p /etc/archivematica/storage-service - cp /var/archivematica/.storage-service /etc/archivematica/storage-service/.storage-service -fi +echo "preinst" $1 $2 diff --git a/debs/bionic/archivematica-storage-service/debian-storage-service/rules b/debs/bionic/archivematica-storage-service/debian-storage-service/rules index fc9a08c6..7b413f1d 100755 --- a/debs/bionic/archivematica-storage-service/debian-storage-service/rules +++ b/debs/bionic/archivematica-storage-service/debian-storage-service/rules @@ -7,11 +7,7 @@ export DH_VIRTUALENV_INSTALL_ROOT=/usr/share/archivematica/virtualenvs dh $@ --with python-virtualenv --with systemd override_dh_virtualenv: - # Preinstalling pip 9.0.3 solves a problem with the shebangs inside the - # virtual environment. See: - # - https://github.com/artefactual/archivematica/issues/1042 - # - https://github.com/artefactual-labs/am-packbuild/pull/159 - dh_virtualenv --preinstall "pip==9.0.3" --extra-pip-arg --find-links=lib + dh_virtualenv --python=python3 --requirements=requirements/production-py3.txt --skip-install # See https://readthedocs.org/projects/dh-virtualenv/downloads/pdf/latest/ (2.3.3 section) override_dh_shlibdeps: diff --git a/debs/bionic/archivematica/Dockerfile b/debs/bionic/archivematica/Dockerfile index 98fb1566..b59837f5 100644 --- a/debs/bionic/archivematica/Dockerfile +++ b/debs/bionic/archivematica/Dockerfile @@ -1,18 +1,32 @@ FROM ubuntu:bionic -RUN apt-get update && \ - apt-get install -y dpkg-dev git build-essential wget debhelper \ - devscripts equivs quilt apt-transport-https python-minimal - -RUN wget -O /tmp/pip.py https://bootstrap.pypa.io/pip/2.7/get-pip.py && python /tmp/pip.py - -RUN wget -O - https://packages.archivematica.org/1.7.x/key.asc |\ - apt-key add - && \ - echo "deb [arch=amd64] http://packages.archivematica.org/1.7.x/ubuntu-externals xenial main" >> /etc/apt/sources.list - - -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 - - +ENV DEBIAN_FRONTEND noninteractive + +RUN apt-get update \ + && apt-get install -y \ + dpkg-dev \ + git \ + build-essential \ + debhelper \ + devscripts \ + equivs \ + apt-transport-https \ + python3.6-dev \ + python3.6-distutils \ + libffi-dev \ + libssl-dev \ + libxslt-dev \ + dh-systemd \ + libmysqlclient-dev \ + libldap2-dev \ + libsasl2-dev \ + && update-alternatives --install /usr/bin/python python /usr/bin/python3.6 1 \ + && update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.6 1 \ + && curl -s https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py && python /tmp/get-pip.py \ + && curl -sL https://deb.nodesource.com/setup_8.x | bash - && apt-get install -y nodejs + +# Install recent version of dh-virtualenv. +RUN apt-get install -y software-properties-common \ + && add-apt-repository ppa:jyrki-pulliainen/dh-virtualenv \ + && apt-get update \ + && apt-get install -y dh-virtualenv diff --git a/debs/bionic/archivematica/Makefile b/debs/bionic/archivematica/Makefile index bd01f6d8..cd88a040 100644 --- a/debs/bionic/archivematica/Makefile +++ b/debs/bionic/archivematica/Makefile @@ -3,73 +3,71 @@ PACKAGE ?= archivematica DEB_TOPDIR = "/debbuild" DOCKER_VOLUME = "/src" DOCKER_IMAGE = "debbuild-$(NAME)-$(VERSION)" -GPG_ID ?= 0F4A4D31 -PACKBUILD_EXTRA_ARGS ?= -#PACKBUILD_EXTRA_ARGS ?= "-b 1" -BRANCH ?= qa/1.x -VERSION ?= 1.8.1 +GPG_ID ?= 0F4A4D31 +BRANCH ?= qa/1.x +VERSION ?= 1.13.0 RELEASE ?= -1 -BUILD_TYPE ?= am -GIT_REPO ?= "https://github.com/artefactual" -GIT_HOSTNAME :=$(shell echo $(GIT_REPO) | sed -e 's/https:\/\///g' -e 's/git@//g' -e 's/\:/\//g' | cut -d\/ -f1) -SSH_SOCKET ?= $(SSH_AUTH_SOCK) +GIT_REPO ?= "https://github.com/artefactual" +GIT_HOSTNAME := $(shell echo $(GIT_REPO) | sed -e 's/https:\/\///g' -e 's/git@//g' -e 's/\:/\//g' | cut -d\/ -f1) +SSH_SOCKET ?= $(SSH_AUTH_SOCK) +.DEFAULT_GOAL := build -.PHONY: build-docker-image build deb-build deb-clean deb-test update-changelog - -all: build-docker-image build - -build-docker-image: update-changelog +.PHONY: build-docker-image +build-docker-image: @echo "==> Building Docker image with build environment." @docker build --rm --tag "$(DOCKER_IMAGE)" . -build: +.PHONY: build +build: build-docker-image @echo "==> Building deb." @docker run \ - -v $(SSH_SOCKET):"/ssh-agent" \ - -e SSH_AUTH_SOCK="/ssh-agent" \ - -e BRANCH=$(BRANCH) \ + -v $(SSH_SOCKET):"/ssh-agent" \ + -e SSH_AUTH_SOCK="/ssh-agent" \ + -e BRANCH=$(BRANCH) \ -e VERSION=$(VERSION) \ -e RELEASE=$(RELEASE) \ - -e BUILD_TYPE=$(BUILD_TYPE) \ - -e GPG_ID=$(GPG_ID) \ + -e GPG_ID=$(GPG_ID) \ -e GPG_KEY \ -e GIT_REPO="$(GIT_REPO)" \ - -e PACKBUILD_EXTRA_ARGS="$(PACKBUILD_EXTRA_ARGS)" \ - --rm \ - --volume "$(shell cd ../../ && pwd):$(DEB_TOPDIR)/$(NAME)" \ + --rm \ + --volume "$(shell cd ../../ && pwd):$(DEB_TOPDIR)/$(NAME)" \ --volume "$(shell pwd):$(DOCKER_VOLUME)" \ $(DOCKER_IMAGE) \ - make -C $(DOCKER_VOLUME) deb-build + make -C $(DOCKER_VOLUME) deb-build -deb-build: deb-clean - @echo "==> Install dependencies." - # Add GPG if available - @if [ -f "$(DOCKER_VOLUME)/GPG-KEY" ]; then gpg --import $(DOCKER_VOLUME)/GPG-KEY; fi - @if [ x"$$GPG_KEY" != x ]; then echo "$$GPG_KEY" | gpg --import - ; fi - #@cd /debbuild/$(NAME) && ./packbuild.py -r $(BUILD_TYPE) -v $(VERSION) -c $(BRANCH) -k$(GPG_ID) $(PACKBUILD_EXTRA_ARGS) +.PHONY: deb-build +deb-build: deb-clean git-clone import-gpg-key @cd /debbuild/$(NAME) - @echo "==> Clone code." + ./build.sh + mkdir -p repo/ + cp -rf src/archivematica_* repo + cp -rf src/archivematica/src/archivematica-* repo + cd repo && dpkg-scanpackages . | gzip > Packages.gz + +.PHONY: git-clone +git-clone: mkdir -p ~/.ssh/ ssh-keyscan -t rsa $(GIT_HOSTNAME) >> ~/.ssh/known_hosts || true - mkdir -p src/$(PACKAGE) - rm -rf src/ @git clone \ --quiet \ --branch $(BRANCH) \ --depth 1 \ --single-branch \ $(GIT_REPO)/$(PACKAGE) src/$(PACKAGE) - ./build.sh - mkdir -p repo/ - cp -rf src/archivematica/src/archivematica-* repo - cd repo && dpkg-scanpackages . | gzip > Packages.gz +.PHONY: import-gpg-key +import-gpg-key: + @if [ -f "$(DOCKER_VOLUME)/GPG-KEY" ]; then gpg --import $(DOCKER_VOLUME)/GPG-KEY; fi + @if [ x"$$GPG_KEY" != x ]; then echo "$$GPG_KEY" | gpg --import - ; fi + +.PHONY: deb-clean deb-clean: @echo "==> Cleaning up previous builds." @rm -rf $(DOCKER_VOLUME)/repo/ @rm -rf $(DOCKER_VOLUME)/src/ +.PHONY: cleanup cleanup: @echo "==> Remove artifacts created as root. " @docker run -i \ @@ -78,6 +76,3 @@ cleanup: --volume "$(shell pwd):$(DOCKER_VOLUME)" \ $(DOCKER_IMAGE) \ rm -rf /src/repo/ /src/src/ - -deb-test: - @docker run --rm --volume="$(shell pwd):$(DOCKER_VOLUME)" ubuntu:trusty echo "Create repo and install package" diff --git a/debs/bionic/archivematica/build.sh b/debs/bionic/archivematica/build.sh index 93609c23..93b20c01 100755 --- a/debs/bionic/archivematica/build.sh +++ b/debs/bionic/archivematica/build.sh @@ -1,27 +1,37 @@ -#!/bin/bash -x +#!/usr/bin/env bash + +set -euxo BASE="$(pwd)" -SOURCE=${BASE}/src/archivematica/src/ +SOURCE=${BASE}/src/archivematica export DEBFULLNAME="Artefactual Systems" export DEBEMAIL="sysadmin@artefactual.com" +export DEB_BUILD_OPTIONS="noddebs" -cd $SOURCE/dashboard/frontend/ -npm install --unsafe-perm - -cd $SOURCE +# Create archivematica package. +pushd ${SOURCE} COMMIT=$(git rev-parse HEAD) +cp -rf ${BASE}/debian-archivematica debian +yes | mk-build-deps -i debian/control +dch -v 1:${VERSION}${RELEASE}~18.04 commit: $(echo $COMMIT) +dch -v 1:${VERSION}${RELEASE}~18.04 checkout: $(echo $BRANCH) +dch -r --distribution bionic --urgency high ignored +dpkg-buildpackage -us -uc +popd -# Update changelog for bionic -for i in dashboard MCPClient MCPServer archivematicaCommon - do - cd "${SOURCE}/$i/" +# Install front-end node modules. +pushd $SOURCE/src/dashboard/frontend/ +npm install --unsafe-perm +popd + +# Create child packages. +for i in dashboard MCPClient MCPServer archivematicaCommon; do + pushd "${SOURCE}/src/$i" cp -rf $BASE/debian-$i debian yes | mk-build-deps -i debian/control dch -v 1:${VERSION}${RELEASE}~18.04 commit: $(echo $COMMIT) - dch -v 1:${VERSION}${RELEASE}~18.04 checkout: $(echo $BRANCH) - dch -r --distribution bionic --urgency high ignored - QUILT_PATCHES="debian/patches" quilt push -a || true + dch -v 1:${VERSION}${RELEASE}~18.04 checkout: $(echo $BRANCH) + dch -r --distribution bionic --urgency high ignored dpkg-buildpackage -us -uc - cd $SOURCE - done - + popd +done diff --git a/debs/bionic/archivematica/debian-MCPClient/archivematica-mcp-client.default b/debs/bionic/archivematica/debian-MCPClient/archivematica-mcp-client.default index 041ffc4c..b3c31bad 100644 --- a/debs/bionic/archivematica/debian-MCPClient/archivematica-mcp-client.default +++ b/debs/bionic/archivematica/debian-MCPClient/archivematica-mcp-client.default @@ -1,5 +1,5 @@ -PATH=/usr/share/archivematica/virtualenvs/archivematica-mcp-client/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin -PYTHONPATH=/usr/lib/archivematica/MCPClient:/usr/lib/archivematica/archivematicaCommon/:/usr/share/archivematica/dashboard/ +PATH=/usr/share/archivematica/virtualenvs/archivematica/bin:/usr/local/sbin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin +PYTHONPATH=/usr/lib/archivematica/MCPClient:/usr/lib/archivematica/MCPClient/clientScripts:/usr/lib/archivematica/archivematicaCommon/:/usr/share/archivematica/dashboard/ LANG="en_US.UTF-8" LC_ALL="en_US.UTF-8" LC_LANG="en_US.UTF-8" diff --git a/debs/bionic/archivematica/debian-MCPClient/archivematica-mcp-client.service b/debs/bionic/archivematica/debian-MCPClient/archivematica-mcp-client.service index 4fdce8f7..e8003191 100644 --- a/debs/bionic/archivematica/debian-MCPClient/archivematica-mcp-client.service +++ b/debs/bionic/archivematica/debian-MCPClient/archivematica-mcp-client.service @@ -1,13 +1,13 @@ [Unit] -Description=Archivematica MCP Client Service +Description=Archivematica MCPClient After=syslog.target network.target [Service] Type=simple User=archivematica EnvironmentFile=/etc/default/archivematica-mcp-client -Environment=PATH=/usr/share/archivematica/virtualenvs/archivematica-mcp-client/bin/ -ExecStart=/usr/share/archivematica/virtualenvs/archivematica-mcp-client/bin/python /usr/lib/archivematica/MCPClient/archivematicaClient.py +Environment=PATH=/usr/share/archivematica/virtualenvs/archivematica/bin/ +ExecStart=/usr/share/archivematica/virtualenvs/archivematica/bin/python /usr/lib/archivematica/MCPClient/archivematicaClient.py [Install] WantedBy=multi-user.target diff --git a/debs/bionic/archivematica/debian-MCPClient/control b/debs/bionic/archivematica/debian-MCPClient/control index 769eb248..f181aca3 100644 --- a/debs/bionic/archivematica/debian-MCPClient/control +++ b/debs/bionic/archivematica/debian-MCPClient/control @@ -1,17 +1,18 @@ Source: archivematica-mcp-client Section: utils Priority: extra -Maintainer: Santiago Collazo -Build-Depends: debhelper (>= 9) +Maintainer: Artefactual Systems Inc. +Build-Depends: + debhelper, + dh-systemd Standards-Version: 3.9.8 -Homepage: http://archivematica.org +X-Python-Version: 3.6 Package: archivematica-mcp-client -Architecture: i386 amd64 +Architecture: amd64 Depends: - ${shlibs:Depends}, ${misc:Depends}, - archivematica-common (>=1.8.0), + archivematica-common (>= 1.13.0), atool, bulk-extractor, clamav, @@ -25,6 +26,7 @@ Depends: jhove, libimage-exiftool-perl, libxml2-utils, + libmysqlclient-dev, logapp, md5deep, mediaconch (>= 18.03), @@ -37,11 +39,12 @@ Depends: postfix, pst-utils, rsync, - siegfried (>=1.7), + siegfried (>= 1.7), sleuthkit, tesseract-ocr, tree, ufraw, unrar-free, uuid -Description: MCP Client for Archivematica +Description: Archivematica MCPClient (distributed worker) +Homepage: https://www.archivematica.org diff --git a/debs/bionic/archivematica/debian-MCPClient/copyright b/debs/bionic/archivematica/debian-MCPClient/copyright deleted file mode 100644 index 68c2466a..00000000 --- a/debs/bionic/archivematica/debian-MCPClient/copyright +++ /dev/null @@ -1,43 +0,0 @@ -This work was packaged for Ubuntu by: - - Santiago Rodríguez Collazo - -It was downloaded from http://archivematica.org - -Upstream Author(s): - - Joseph Perry - Jesus Garcia Crespo - Austin Trask - Peter Van Garderen - Evelyn McLellan - Mike Cantelon - Justin Simpson - Holly Becker - Misty De Meo - Hector Akamine - Santiago Collazo - -Copyright: - - Copyright (C) 2010-2017 Artefactual Systems Inc. - -License: - - This is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . - - -The Debian packaging is: - - Copyright (C) 2010-2017 Artefactual Systems Inc. diff --git a/debs/bionic/archivematica/debian-MCPClient/postinst b/debs/bionic/archivematica/debian-MCPClient/postinst index 30812613..31c99642 100755 --- a/debs/bionic/archivematica/debian-MCPClient/postinst +++ b/debs/bionic/archivematica/debian-MCPClient/postinst @@ -5,17 +5,6 @@ mkdir -p $logdir chown -R archivematica:archivematica $logdir chmod -R g+s $logdir -# Remove dh-virtualenv build path in editable pip requirements and other local/bin files -# https://github.com/spotify/dh-virtualenv/issues/134 -# https://github.com/archivematica/Issues/issues/903 -for filename in /usr/share/archivematica/virtualenvs/archivematica-mcp-client/local/bin/* \ - /usr/share/archivematica/virtualenvs/archivematica-mcp-client/lib/python2.7/site-packages/*.pth \ - /usr/share/archivematica/virtualenvs/archivematica-mcp-client/lib/python2.7/site-packages/*.egg-link ; do - if [ -f "$filename" ]; then - sed -i "s/\/src\/src\/archivematica\/src\/MCPClient\/debian\/archivematica-mcp-client//g" $filename - fi -done - # Populate default mysql config DBPASS=$(grep "dbc_dbpass=" /etc/dbconfig-common/archivematica-mcp-server.conf| cut -d\= -f2- | tr -d \') sed -i "s/^\(ARCHIVEMATICA_MCPCLIENT_CLIENT_PASSWORD=\).*/\1$DBPASS/g" /etc/default/archivematica-mcp-client diff --git a/debs/bionic/archivematica/debian-MCPClient/rules b/debs/bionic/archivematica/debian-MCPClient/rules index 5ed99f91..5a17f5f0 100755 --- a/debs/bionic/archivematica/debian-MCPClient/rules +++ b/debs/bionic/archivematica/debian-MCPClient/rules @@ -1,15 +1,6 @@ #!/usr/bin/make -f export LC_ALL=C.UTF-8 -export DH_VIRTUALENV_INSTALL_ROOT=/usr/share/archivematica/virtualenvs %: - dh $@ --with python-virtualenv --with systemd - -override_dh_virtualenv: - dh_virtualenv --requirements ../../requirements.txt --skip-install - dh_virtualenv --preinstall "pip==9.0.3" --skip-install - -# See https://readthedocs.org/projects/dh-virtualenv/downloads/pdf/latest/ (2.3.3 section) -override_dh_shlibdeps: - dh_shlibdeps -X/numpy/.libs + dh $@ --with systemd diff --git a/debs/bionic/archivematica/debian-MCPServer/archivematica-mcp-server.service b/debs/bionic/archivematica/debian-MCPServer/archivematica-mcp-server.service index b5edb823..41bc4759 100644 --- a/debs/bionic/archivematica/debian-MCPServer/archivematica-mcp-server.service +++ b/debs/bionic/archivematica/debian-MCPServer/archivematica-mcp-server.service @@ -1,12 +1,12 @@ [Unit] -Description=Archivematica MCP Server Service +Description=Archivematica MCPServer After=syslog.target network.target mysql.service [Service] Type=simple User=archivematica -EnvironmentFile=/etc/default//archivematica-mcp-server -ExecStart=/usr/share/archivematica/virtualenvs/archivematica-mcp-server/bin/python /usr/lib/archivematica/MCPServer/archivematicaMCP.py +EnvironmentFile=/etc/default/archivematica-mcp-server +ExecStart=/usr/share/archivematica/virtualenvs/archivematica/bin/python /usr/lib/archivematica/MCPServer/archivematicaMCP.py [Install] WantedBy=multi-user.target diff --git a/debs/bionic/archivematica/debian-MCPServer/control b/debs/bionic/archivematica/debian-MCPServer/control index b5e517d7..c6cdd336 100644 --- a/debs/bionic/archivematica/debian-MCPServer/control +++ b/debs/bionic/archivematica/debian-MCPServer/control @@ -1,21 +1,21 @@ Source: archivematica-mcp-server Section: utils Priority: extra -Maintainer: Santiago Collazo -Build-Depends: debhelper (>= 9) +Maintainer: Artefactual Systems Inc. +Build-Depends: + debhelper, + dh-systemd Standards-Version: 3.9.8 -Homepage: http://archivematica.org +X-Python-Version: 3.6 Package: archivematica-mcp-server -Architecture: i386 amd64 +Architecture: amd64 Depends: - ${shlibs:Depends}, ${misc:Depends}, - archivematica-common(>=1.6.0), - libmysqlclient20|libmysqlclient18, + archivematica-common (>= 1.13.0), dbconfig-common, dbconfig-mysql, mysql-server, gearman -Description: MCP Server for Archivematica - Workflow manager for Archivematica k +Description: Archivematica MCPServer (workflow engine) +Homepage: https://www.archivematica.org diff --git a/debs/bionic/archivematica/debian-MCPServer/copyright b/debs/bionic/archivematica/debian-MCPServer/copyright deleted file mode 100644 index 68c2466a..00000000 --- a/debs/bionic/archivematica/debian-MCPServer/copyright +++ /dev/null @@ -1,43 +0,0 @@ -This work was packaged for Ubuntu by: - - Santiago Rodríguez Collazo - -It was downloaded from http://archivematica.org - -Upstream Author(s): - - Joseph Perry - Jesus Garcia Crespo - Austin Trask - Peter Van Garderen - Evelyn McLellan - Mike Cantelon - Justin Simpson - Holly Becker - Misty De Meo - Hector Akamine - Santiago Collazo - -Copyright: - - Copyright (C) 2010-2017 Artefactual Systems Inc. - -License: - - This is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . - - -The Debian packaging is: - - Copyright (C) 2010-2017 Artefactual Systems Inc. diff --git a/debs/bionic/archivematica/debian-MCPServer/postinst b/debs/bionic/archivematica/debian-MCPServer/postinst index 4660a0a6..20f4ffbf 100755 --- a/debs/bionic/archivematica/debian-MCPServer/postinst +++ b/debs/bionic/archivematica/debian-MCPServer/postinst @@ -18,17 +18,6 @@ mkdir -p $logdir chown -R archivematica:archivematica $logdir chmod -R g+s $logdir -# Remove dh-virtualenv build path in editable pip requirements and other local/bin files -# https://github.com/spotify/dh-virtualenv/issues/134 -# https://github.com/archivematica/Issues/issues/903 -for filename in /usr/share/archivematica/virtualenvs/archivematica-mcp-server/local/bin/* \ - /usr/share/archivematica/virtualenvs/archivematica-mcp-server/lib/python2.7/site-packages/*.pth \ - /usr/share/archivematica/virtualenvs/archivematica-mcp-server/lib/python2.7/site-packages/*.egg-link ; do - if [ -f "$filename" ]; then - sed -i "s/\/src\/src\/archivematica\/src\/MCPServer\/debian\/archivematica-mcp-server//g" $filename - fi -done - # Populate default mysql config DBPASS=$(grep "dbc_dbpass=" /etc/dbconfig-common/archivematica-mcp-server.conf| cut -d\= -f2- | tr -d \') sed -i "s/^\(ARCHIVEMATICA_MCPSERVER_CLIENT_PASSWORD=\).*/\1$DBPASS/g" /etc/default/archivematica-mcp-server diff --git a/debs/bionic/archivematica/debian-MCPServer/prerm b/debs/bionic/archivematica/debian-MCPServer/prerm index 71217c49..ad17834f 100755 --- a/debs/bionic/archivematica/debian-MCPServer/prerm +++ b/debs/bionic/archivematica/debian-MCPServer/prerm @@ -1,7 +1,7 @@ #!/bin/sh . /usr/share/debconf/confmodule -. /usr/share/dbconfig-common/dpkg/prerm.mysql +. /usr/share/dbconfig-common/dpkg/prerm.mysql dbc_go archivematica-mcp-server $@ #DEBHELPER# diff --git a/debs/bionic/archivematica/debian-MCPServer/rules b/debs/bionic/archivematica/debian-MCPServer/rules index 5ed99f91..5a17f5f0 100755 --- a/debs/bionic/archivematica/debian-MCPServer/rules +++ b/debs/bionic/archivematica/debian-MCPServer/rules @@ -1,15 +1,6 @@ #!/usr/bin/make -f export LC_ALL=C.UTF-8 -export DH_VIRTUALENV_INSTALL_ROOT=/usr/share/archivematica/virtualenvs %: - dh $@ --with python-virtualenv --with systemd - -override_dh_virtualenv: - dh_virtualenv --requirements ../../requirements.txt --skip-install - dh_virtualenv --preinstall "pip==9.0.3" --skip-install - -# See https://readthedocs.org/projects/dh-virtualenv/downloads/pdf/latest/ (2.3.3 section) -override_dh_shlibdeps: - dh_shlibdeps -X/numpy/.libs + dh $@ --with systemd diff --git a/debs/bionic/archivematica/debian-archivematicaCommon/.placeholder b/debs/bionic/archivematica/debian-archivematica/archivematica.install similarity index 100% rename from debs/bionic/archivematica/debian-archivematicaCommon/.placeholder rename to debs/bionic/archivematica/debian-archivematica/archivematica.install diff --git a/debs/bionic/archivematica/debian-archivematica/changelog b/debs/bionic/archivematica/debian-archivematica/changelog new file mode 100644 index 00000000..36523a63 --- /dev/null +++ b/debs/bionic/archivematica/debian-archivematica/changelog @@ -0,0 +1,7 @@ +archivematica (1:1.13.0-1~18.04) bionic; urgency=high + + * commit: 66ce19defafa1539fe3163df1cf41e36838d2e3d + * checkout: v1.13.0 + + -- Artefactual Systems Mon, 31 Jul 2017 19:20:04 +0000 + diff --git a/debs/bionic/archivematica/debian-archivematica/compat b/debs/bionic/archivematica/debian-archivematica/compat new file mode 100644 index 00000000..ec635144 --- /dev/null +++ b/debs/bionic/archivematica/debian-archivematica/compat @@ -0,0 +1 @@ +9 diff --git a/debs/bionic/archivematica/debian-archivematica/control b/debs/bionic/archivematica/debian-archivematica/control new file mode 100644 index 00000000..d45398eb --- /dev/null +++ b/debs/bionic/archivematica/debian-archivematica/control @@ -0,0 +1,22 @@ +Source: archivematica +Section: utils +Priority: extra +Maintainer: Artefactual Systems Inc. +Build-Depends: + debhelper, + dh-virtualenv, + python3.6-dev, + libmysqlclient-dev, + libffi-dev, + libldap2-dev, + libsasl2-dev, + libssl-dev, + libxml2-dev, + libxslt1-dev, +Standards-Version: 3.9.8 +X-Python-Version: 3.6 + +Package: archivematica +Architecture: amd64 +Description: Archivematica shared libraries. +Homepage: https://www.archivematica.org diff --git a/debs/bionic/archivematica/debian-archivematica/rules b/debs/bionic/archivematica/debian-archivematica/rules new file mode 100755 index 00000000..60a70d03 --- /dev/null +++ b/debs/bionic/archivematica/debian-archivematica/rules @@ -0,0 +1,18 @@ +#!/usr/bin/make -f + +export LC_ALL=C.UTF-8 +export DH_VIRTUALENV_INSTALL_ROOT=/usr/share/archivematica/virtualenvs + +%: + dh $@ --with python-virtualenv + +override_dh_virtualenv: + dh_virtualenv --python=python3 --requirements=requirements-py3.txt --skip-install + +# See https://readthedocs.org/projects/dh-virtualenv/downloads/pdf/latest/ (2.3.3 section) +override_dh_shlibdeps: + dh_shlibdeps --exclude=psycopg2 + +# See https://readthedocs.org/projects/dh-virtualenv/downloads/pdf/latest/ (2.3.3 section) +override_dh_strip: + dh_strip --exclude=psycopg2 diff --git a/debs/bionic/archivematica/debian-archivematica/source/format b/debs/bionic/archivematica/debian-archivematica/source/format new file mode 100644 index 00000000..89ae9db8 --- /dev/null +++ b/debs/bionic/archivematica/debian-archivematica/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/debs/bionic/archivematica/debian-archivematicaCommon/control b/debs/bionic/archivematica/debian-archivematicaCommon/control index c101dba8..4bbd50ec 100644 --- a/debs/bionic/archivematica/debian-archivematicaCommon/control +++ b/debs/bionic/archivematica/debian-archivematicaCommon/control @@ -1,19 +1,18 @@ Source: archivematica-common Section: utils Priority: extra -Maintainer: Artefactual Systems Inc. -Build-Depends: debhelper (>= 9) +Maintainer: Artefactual Systems Inc. +Build-Depends: + debhelper Standards-Version: 3.9.8 -Homepage: http://archivematica.org +X-Python-Version: 3.6 Package: archivematica-common -Architecture: i386 amd64 +Architecture: amd64 Depends: - ${shlibs:Depends}, ${misc:Depends}, - python, - python-pip, - python-dev, - libmysqlclient-dev -Description: Common libraries for archivematica - This package is a support package for archivematica. It contains a library of functions used in the archivematica system. + python3, + python3-distutils, + archivematica (>= 1.13.0) +Description: Archivematica shared libraries. +Homepage: https://www.archivematica.org diff --git a/debs/bionic/archivematica/debian-archivematicaCommon/copyright b/debs/bionic/archivematica/debian-archivematicaCommon/copyright deleted file mode 100644 index 68c2466a..00000000 --- a/debs/bionic/archivematica/debian-archivematicaCommon/copyright +++ /dev/null @@ -1,43 +0,0 @@ -This work was packaged for Ubuntu by: - - Santiago Rodríguez Collazo - -It was downloaded from http://archivematica.org - -Upstream Author(s): - - Joseph Perry - Jesus Garcia Crespo - Austin Trask - Peter Van Garderen - Evelyn McLellan - Mike Cantelon - Justin Simpson - Holly Becker - Misty De Meo - Hector Akamine - Santiago Collazo - -Copyright: - - Copyright (C) 2010-2017 Artefactual Systems Inc. - -License: - - This is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . - - -The Debian packaging is: - - Copyright (C) 2010-2017 Artefactual Systems Inc. diff --git a/debs/bionic/archivematica/debian-archivematicaCommon/rules b/debs/bionic/archivematica/debian-archivematicaCommon/rules index c8b41108..cb003aa5 100755 --- a/debs/bionic/archivematica/debian-archivematicaCommon/rules +++ b/debs/bionic/archivematica/debian-archivematicaCommon/rules @@ -1,16 +1,7 @@ #!/usr/bin/make -f -# -*- makefile -*- -# Sample debian/rules that uses debhelper. -# This file was originally written by Joey Hess and Craig Small. -# As a special exception, when this file is copied by dh-make into a -# dh-make output file, you may use that output file without restriction. -# This special exception was added by Craig Small in version 0.37 of dh-make. - -# Uncomment this to turn on verbose mode. -#export DH_VERBOSE=1 export LC_ALL=C.UTF-8 export DH_VIRTUALENV_INSTALL_ROOT=/usr/share/archivematica/virtualenvs %: - dh $@ + dh $@ diff --git a/debs/bionic/archivematica/debian-dashboard/archivematica-dashboard.service b/debs/bionic/archivematica/debian-dashboard/archivematica-dashboard.service index 9c044340..a4ccfb23 100644 --- a/debs/bionic/archivematica/debian-dashboard/archivematica-dashboard.service +++ b/debs/bionic/archivematica/debian-dashboard/archivematica-dashboard.service @@ -10,7 +10,7 @@ User=archivematica Group=archivematica EnvironmentFile=/etc/default/archivematica-dashboard WorkingDirectory=/usr/share/archivematica/dashboard/ -ExecStart=/usr/share/archivematica/virtualenvs/archivematica-dashboard/bin/gunicorn --config /etc/archivematica/dashboard.gunicorn-config.py wsgi:application +ExecStart=/usr/share/archivematica/virtualenvs/archivematica/bin/gunicorn --config /etc/archivematica/dashboard.gunicorn-config.py wsgi:application ExecReload=/bin/kill -s HUP $MAINPID ExecStop=/bin/kill -s TERM $MAINPID PrivateTmp=true diff --git a/debs/bionic/archivematica/debian-dashboard/control b/debs/bionic/archivematica/debian-dashboard/control index f6b87617..35a8e738 100644 --- a/debs/bionic/archivematica/debian-dashboard/control +++ b/debs/bionic/archivematica/debian-dashboard/control @@ -1,30 +1,21 @@ Source: archivematica-dashboard Section: utils Priority: extra -Maintainer: Santiago Collazo -Build-Depends: debhelper (>= 9), libffi-dev, libssl-dev +Maintainer: Artefactual Systems Inc. +Build-Depends: + debhelper, + dh-systemd Standards-Version: 3.9.8 -Homepage: http://archivematica.org +X-Python-Version: 3.6 Package: archivematica-dashboard Architecture: any -Depends: +Depends: ${shlibs:Depends}, ${misc:Depends}, + archivematica-common (>= 1.13.0), git, nginx, - python (>= 2.7.3), - python-pip, - python-dateutil, - python-simplejson, - libffi-dev, - libldap2-dev, - libsasl2-dev, - libssl-dev, - python-dev, - libxml2-dev, - libxslt1-dev, gettext -Description: Web Dashboard for Archivematica - Web based dashboard interface used to control an Archivematica pipeline. - +Description: Archivematida Dashboard (web-based interface). +Homepage: https://www.archivematica.org diff --git a/debs/bionic/archivematica/debian-dashboard/copyright b/debs/bionic/archivematica/debian-dashboard/copyright deleted file mode 100644 index 68c2466a..00000000 --- a/debs/bionic/archivematica/debian-dashboard/copyright +++ /dev/null @@ -1,43 +0,0 @@ -This work was packaged for Ubuntu by: - - Santiago Rodríguez Collazo - -It was downloaded from http://archivematica.org - -Upstream Author(s): - - Joseph Perry - Jesus Garcia Crespo - Austin Trask - Peter Van Garderen - Evelyn McLellan - Mike Cantelon - Justin Simpson - Holly Becker - Misty De Meo - Hector Akamine - Santiago Collazo - -Copyright: - - Copyright (C) 2010-2017 Artefactual Systems Inc. - -License: - - This is free software: you can redistribute it and/or modify - it under the terms of the GNU Affero General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - This software is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this software. If not, see . - - -The Debian packaging is: - - Copyright (C) 2010-2017 Artefactual Systems Inc. diff --git a/debs/bionic/archivematica/debian-dashboard/postinst b/debs/bionic/archivematica/debian-dashboard/postinst index d46a72e5..64d883fb 100755 --- a/debs/bionic/archivematica/debian-dashboard/postinst +++ b/debs/bionic/archivematica/debian-dashboard/postinst @@ -5,7 +5,7 @@ function dashboard::manage { # Certain tasks like compilemessages rely on the current directory. pushd /usr/share/archivematica/dashboard - /usr/share/archivematica/virtualenvs/archivematica-dashboard/bin/python manage.py "$@" + /usr/share/archivematica/virtualenvs/archivematica/python manage.py "$@" popd } @@ -29,17 +29,6 @@ sed -i "s/^\(ARCHIVEMATICA_DASHBOARD_CLIENT_USER=\).*/\1$DBUSER/g" /etc/default/ DBNAME=$(grep "dbc_dbname=" /etc/dbconfig-common/archivematica-mcp-server.conf| cut -d\= -f2- | tr -d \') sed -i "s/^\(ARCHIVEMATICA_DASHBOARD_CLIENT_DATABASE=\).*/\1$DBNAME/g" /etc/default/archivematica-dashboard -# Remove dh-virtualenv build path in editable pip requirements and other local/bin files -# https://github.com/spotify/dh-virtualenv/issues/134 -# https://github.com/archivematica/Issues/issues/903 -for filename in /usr/share/archivematica/virtualenvs/archivematica-dashboard/local/bin/* \ - /usr/share/archivematica/virtualenvs/archivematica-dashboard/lib/python2.7/site-packages/*.pth \ - /usr/share/archivematica/virtualenvs/archivematica-dashboard/lib/python2.7/site-packages/*.egg-link ; do - if [ -f "$filename" ]; then - sed -i "s/\/src\/src\/archivematica\/src\/dashboard\/debian\/archivematica-dashboard//g" $filename - fi -done - # Use ucf to preserve user changes in the default file ucfr archivematica-dashboard /etc/default/archivematica-dashboard ucf --debconf-ok /etc/default/archivematica-dashboard /etc/default/archivematica-dashboard @@ -49,15 +38,6 @@ set -a source /etc/default/archivematica-dashboard set +a -# Fake migrations if necessary. $2 is old version -if [[ $2 == '1:1.4.1'* ]]; then - echo 'Faking 1.4.1 database setup' - dashboard::manage migrate --fake --settings='settings.production' - dashboard::manage migrate administration 0001_initial --fake --settings='settings.production' - dashboard::manage migrate main 0002_initial_data --fake --settings='settings.production' - dashboard::manage migrate fpr 0002_initial_data --fake --settings='settings.production' -fi - # Run migrations dashboard::manage migrate --settings='settings.production' --noinput diff --git a/debs/bionic/archivematica/debian-dashboard/rules b/debs/bionic/archivematica/debian-dashboard/rules index 998f9dc8..5a17f5f0 100755 --- a/debs/bionic/archivematica/debian-dashboard/rules +++ b/debs/bionic/archivematica/debian-dashboard/rules @@ -1,15 +1,6 @@ #!/usr/bin/make -f export LC_ALL=C.UTF-8 -export DH_VIRTUALENV_INSTALL_ROOT=/usr/share/archivematica/virtualenvs %: - dh $@ --with python-virtualenv --with systemd - -override_dh_virtualenv: - dh_virtualenv --requirements ../../requirements.txt --skip-install - dh_virtualenv -v --preinstall "pip==9.0.3" --skip-install -D src/ - -# See https://readthedocs.org/projects/dh-virtualenv/downloads/pdf/latest/ (2.3.3 section) -override_dh_shlibdeps: - dh_shlibdeps -X/numpy/.libs + dh $@ --with systemd