Skip to content

Commit

Permalink
rpms: add verapdf package
Browse files Browse the repository at this point in the history
  • Loading branch information
scollazo committed Dec 5, 2024
1 parent 4ed6793 commit 61e78e1
Show file tree
Hide file tree
Showing 4 changed files with 116 additions and 0 deletions.
10 changes: 10 additions & 0 deletions rpms/EL9/verapdf/Dockerfile
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

57 changes: 57 additions & 0 deletions rpms/EL9/verapdf/Makefile
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"
15 changes: 15 additions & 0 deletions rpms/EL9/verapdf/files/auto-install.xml
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>
34 changes: 34 additions & 0 deletions rpms/EL9/verapdf/package.spec
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

0 comments on commit 61e78e1

Please sign in to comment.