-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Use Python 3.6 and new requirements file * Install dh-virtualenv 1.2 from author's PPA * Remove workarounds for Python 2.x * Remove workarounds for old SS releases (0.8.x or older) * Remove quilt * Remove unused build variables * Stop configuring packages.archivematica.org
- Loading branch information
Showing
10 changed files
with
91 additions
and
117 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,72 @@ | ||
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 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 pwd):$(DOCKER_VOLUME)" \ | ||
$(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) | ||
|
||
.PHONY: deb-clean | ||
deb-clean: | ||
@echo "==> Cleaning up previous builds." | ||
@rm -rf $(DOCKER_VOLUME)/repo/ | ||
@rm -rf $(DOCKER_VOLUME)/src/ | ||
|
||
cleanup: | ||
.PHONY: cleanup | ||
cleanup: build-docker-image | ||
@echo "==> Remove artifacts created as root." | ||
@docker run -i \ | ||
--rm \ | ||
--volume "$(shell cd ../../ && pwd):$(DEB_TOPDIR)/$(NAME)" \ | ||
--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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/bin/bash -x | ||
#!/usr/bin/env bash | ||
|
||
set -x | ||
|
||
BASE="$(pwd)" | ||
SOURCE=${BASE}/src/archivematica-storage-service/ | ||
|
@@ -8,8 +10,6 @@ export DEBEMAIL="[email protected]" | |
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) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,10 @@ | ||
#!/bin/bash | ||
#!/usr/bin/env bash | ||
|
||
export DEBFULLNAME="Artefactual Systems" | ||
export DEBEMAIL="[email protected]" | ||
BRANCH="$(git branch | cut -d\ -f2-)" | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
25 changes: 16 additions & 9 deletions
25
debs/bionic/archivematica-storage-service/debian-storage-service/control
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,35 @@ | ||
Source: archivematica-storage-service | ||
Section: utils | ||
Priority: extra | ||
Maintainer: Artefactual Systems Inc. <ops@artefactual.com> | ||
Maintainer: Artefactual Systems Inc. <sysadmin@artefactual.com> | ||
Build-Depends: | ||
python (>= 2.7.3), | ||
debhelper (>= 9), | ||
python3.6-dev, | ||
debhelper, | ||
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 1 addition & 4 deletions
5
debs/bionic/archivematica-storage-service/debian-storage-service/postrm
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 2 additions & 11 deletions
13
debs/bionic/archivematica-storage-service/debian-storage-service/preinst
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters