Skip to content
Snippets Groups Projects
Commit e323b721 authored by Jörg Sachse's avatar Jörg Sachse
Browse files

initial commit

parents
No related branches found
No related tags found
No related merge requests found
# Compiled source #
###################
*.bin
*.com
*.class
*.dll
*.exe
*.o
*.so
*.pyc
__pycache__
# Packages #
############
# it's better to unpack these files and commit the raw source
# git has its own built in compression methods
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.tar.gz
*.tgz
# Logs and databases #
######################
*.log
*.sql
*.sqlite
# OS generated files #
######################
.DS_Store
.DS_Store?
._*
.Spotlight-V100
.Trashes
ehthumbs.db
Thumbs.db
# Linux packages #
##################
*.deb
*.rpm
# Ansible specific files #
##########################
*.retry
*.vault
# Vim #
#######
# swap
[._]*.s[a-v][a-z]
[._]*.sw[a-p]
[._]s[a-v][a-z]
[._]sw[a-p]
# session
Session.vim
# temporary
.netrwhist
# auto-generated tag files
tags
# Vagrant #
###########
.vagrant/
*.box
# Build #
#########
build/
iso/
# temporary files #
###################
FROM centos:7
MAINTAINER Jörg Sachse <Joerg.Sachse@slub-dresden.de>
### install build tools
RUN yum update -y
RUN yum install -y rpmdevtools gpg* rng-tools
RUN yum install -y tree mc vim man-db
RUN yum install -y wget java-1.8.0-openjdk.x86_64
RUN yum clean all && \
rm -rf /var/cache/yum
### add user environment
RUN useradd builder -u 1000 -m -G users,wheel && \
echo "builder ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers && \
chown -R builder /home/builder
USER builder
WORKDIR /home/builder/
### create RPM package
RUN rpmdev-setuptree
COPY verapdf.spec ./rpmbuild/SPECS/verapdf.spec
COPY --chown=builder auto-install.xml ./rpmbuild/BUILD/
RUN rpmbuild --noclean -bb ./rpmbuild/SPECS/verapdf.spec
# VeraPDF RPM package
This is a platform-independent way to build an RPM package for installing veraPDF on RHEL 7.
## Handling the Container
### Build
This will create a container to download the veraPDF installer, extract it, install veraPDF in the container, take all necessary files from there and pack them up in an RPM package.
```
sudo docker-compose up --build
```
### Inspect
If you want to take a look into the container, use:
```
docker run -it verapdf_package_build_verapdf bash
```
### Get Package
To copy the package out of the container and onto your local machine, use:
```
sudo docker cp <CONTAINER-ID>:/home/builder/rpmbuild/RPMS/x86_64/verapdf-1.16.1-1.el7.x86_64.rpm ./build
```
## Files
### verapdf.spec
The verapdf.spec file controls all steps of the actual RPM package creation.
### auto-install.xml
The auto-install.xml file is created by the veraPDF installer to capture the decisions you make in the interactive installer. It can then be used for unattended installations. In this particular case, it contains a dummy installation path that is patched in the verapdf.spec file to match the actual desired install path.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<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="true"/>
<pack index="1" name="veraPDF Mac and *nix Scripts" selected="true"/>
<pack index="2" name="veraPDF Corpus and 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>
---
# https://docs.docker.com/compose/compose-file/
version: "3.6"
services:
verapdf:
container_name: verapdf_builder
build:
context: ./
labels:
de.slub-dresden.description: "VeraPDF rpm package builder"
de.slub-dresden.department: "SLUBArchiv, Referat 2.3"
volumes:
- "./build/:/home/builder/rpmbuild/RPMS/"
Name: verapdf
Version: 1.16.1
Release: 1%{?dist}
Summary: VeraPDF validation tool
License: GPLv3
BuildRequires: unzip, wget
Requires: java-1.8.0-openjdk
%description
VeraPDF validation tool
%prep
# download veraPDF installer
wget http://downloads.verapdf.org/rel/verapdf-installer.zip
# configure installation path for unattended installation
sed -i 's#INSTALL_PATH#/home/builder/rpmbuild/BUILD/%{name}#g' auto-install.xml
# extract
unzip verapdf-installer.zip
# run the veraPDF installer using autoinstall configuration
java -jar verapdf-greenfield-1.16.1/verapdf-izpack-installer-1.16.1.jar auto-install.xml
# remove logfiles to clean up RPM package
find /home/builder/rpmbuild/BUILD/%{name} -type f -name "*.log" -delete
%build
# no need to build anything, veraPDF comes precompiled
%install
mkdir -p %{buildroot}/operational_shared/software/
cp -r %{name}/ %{buildroot}/operational_shared/software/
%files
# DOC: http://ftp.rpm.org/max-rpm/s1-rpm-inside-files-list-directives.html
/operational_shared/software/verapdf/
%license
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment