-
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.
Based on work from Jens Steidl at https://git.slub-dresden.de/digital-preservation/verapdf_package_build/
- Loading branch information
Showing
4 changed files
with
116 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
FROM rockylinux:9 | ||
MAINTAINER Jörg Sachse <[email protected]> | ||
|
||
### install build tools | ||
RUN yum update -y | ||
|
||
RUN yum install -y rpmdevtools gpg* rng-tools \ | ||
make wget java-1.8.0-openjdk.x86_64 | ||
RUN yum clean all && rm -rf /var/cache/yum | ||
|
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 |
---|---|---|
@@ -0,0 +1,57 @@ | ||
NAME = verapdf | ||
VERSION = 1.26.2 | ||
RPM_TOPDIR = "/rpmbuild" | ||
DOCKER_VOLUME = "/src" | ||
DOCKER_IMAGE = "rpmbuild-$(NAME)-$(VERSION)" | ||
|
||
RPMBUILD_ARGS := \ | ||
--define "_topdir $(RPM_TOPDIR)" \ | ||
--define "_etcdir $(DOCKER_VOLUME)/etc" \ | ||
--define "name $(NAME)" \ | ||
--define "version $(VERSION)" | ||
|
||
.PHONY: build-docker-image build rpm-build rpm-clean rpm-test | ||
|
||
all: build-docker-image build | ||
|
||
build-docker-image: | ||
@echo "==> Building Docker image with build environment." | ||
@docker build --tag "$(DOCKER_IMAGE)" . | ||
|
||
build: | ||
@echo "==> Building RPM." | ||
@docker run --rm --volume "$(shell pwd):$(DOCKER_VOLUME)" $(DOCKER_IMAGE) make -C $(DOCKER_VOLUME) rpm-build | ||
|
||
dev: | ||
@echo "==> Building RPM." | ||
@docker run -i -t --rm --volume "$(shell pwd):$(DOCKER_VOLUME)" $(DOCKER_IMAGE) /bin/bash | ||
|
||
|
||
rpm-build: rpm-clean | ||
@echo "==> Preparing environment for rpmbuild." | ||
mkdir -p $(RPM_TOPDIR) | ||
cp $(DOCKER_VOLUME)/package.spec $(RPM_TOPDIR)/package.spec | ||
mkdir -p $(RPM_TOPDIR)/BUILD/ | ||
cp files/* $(RPM_TOPDIR)/BUILD/ | ||
cd $(RPM_TOPDIR)/; rpmbuild $(RPMBUILD_ARGS) -ba --clean package.spec | ||
|
||
|
||
|
||
@echo "==> Copying RPM files." | ||
cp -p $(RPM_TOPDIR)/RPMS/x86_64/$(NAME)-$(VERSION)*.x86_64.rpm $(DOCKER_VOLUME) | ||
cp -p $(RPM_TOPDIR)/SRPMS/$(NAME)-$(VERSION)*.src.rpm $(DOCKER_VOLUME) | ||
|
||
rpm-clean: | ||
@echo "==> Cleaning up previous RPMs builds." | ||
@rm -rf $(RPM_TOPDIR) | ||
|
||
rpm-test: | ||
@docker run --rm --volume="$(shell pwd):$(DOCKER_VOLUME)" rockylinux:9 bash -c "yum install -y epel-release && yum localinstall -y --nogpgcheck $(DOCKER_VOLUME)/$(NAME)-$(VERSION)*.rpm" | ||
|
||
cleanup: | ||
@echo "==> Remove artifacts created as root." | ||
@docker run -i \ | ||
--rm \ | ||
--volume "$(shell pwd):$(DOCKER_VOLUME)" \ | ||
$(DOCKER_IMAGE) \ | ||
bash -c "rm -rf /src/*.rpm /src/verapdf" |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<AutomatedInstallation langpack="eng"> | ||
<com.izforge.izpack.panels.htmlhello.HTMLHelloPanel id="welcome"/> | ||
<com.izforge.izpack.panels.target.TargetPanel id="install_dir"> | ||
<installpath>INSTALL_PATH</installpath> | ||
</com.izforge.izpack.panels.target.TargetPanel> | ||
<com.izforge.izpack.panels.packs.PacksPanel id="sdk_pack_select"> | ||
<pack index="0" name="veraPDF GUI" selected="false"/> | ||
<pack index="1" name="veraPDF Mac and *nix Scripts" selected="true"/> | ||
<pack index="2" name="veraPDF Validation model" selected="false"/> | ||
<pack index="3" name="veraPDF Documentation" selected="false"/> | ||
<pack index="4" name="veraPDF Sample Plugins" selected="false"/> | ||
</com.izforge.izpack.panels.packs.PacksPanel> | ||
<com.izforge.izpack.panels.install.InstallPanel id="install"/> | ||
<com.izforge.izpack.panels.finish.FinishPanel id="finish"/> | ||
</AutomatedInstallation> |
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 |
---|---|---|
@@ -0,0 +1,34 @@ | ||
Name: verapdf | ||
Version: %{version} | ||
Release: 1%{?dist} | ||
Summary: VeraPDF validation tool | ||
License: GPLv3 | ||
|
||
BuildRequires: unzip, wget | ||
Requires: java-1.8.0-openjdk-headless | ||
|
||
%description | ||
VeraPDF validation tool | ||
|
||
%prep | ||
# download veraPDF installer | ||
wget -q http://downloads.verapdf.org/rel/verapdf-installer.zip | ||
# configure installation path for unattended installation | ||
sed -i 's#INSTALL_PATH#/rpmbuild/BUILD/%{name}#g' auto-install.xml | ||
# extract | ||
unzip verapdf-installer.zip | ||
# run the veraPDF installer using autoinstall configuration | ||
java -jar verapdf-greenfield-%{version}/verapdf-izpack-installer-%{version}.jar auto-install.xml | ||
|
||
%build | ||
# no need to build anything, veraPDF comes precompiled | ||
|
||
%install | ||
mkdir -p %{buildroot}/usr/local/verapdf/ | ||
cp -r /rpmbuild/BUILD/verapdf/* %{buildroot}/usr/local/verapdf | ||
|
||
%files | ||
# DOC: http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html | ||
/usr/local/verapdf/ | ||
|
||
%license |