From a78c02b2c05bdfe88447594bcdff1311227d88e3 Mon Sep 17 00:00:00 2001
From: Andreas Romeyke <art1@andreas-romeyke.de>
Date: Fri, 22 Jul 2022 13:11:17 +0200
Subject: [PATCH] - removed outdated docker files, closes
 https://git.slub-dresden.de/digital-preservation/checkit_tiff_plugin4rosetta/-/issues/3

---
 deploy_checkit_tiff/centos7/Dockerfile | 143 -------------------------
 deploy_checkit_tiff/centos7/README.txt |  39 -------
 2 files changed, 182 deletions(-)
 delete mode 100644 deploy_checkit_tiff/centos7/Dockerfile
 delete mode 100644 deploy_checkit_tiff/centos7/README.txt

diff --git a/deploy_checkit_tiff/centos7/Dockerfile b/deploy_checkit_tiff/centos7/Dockerfile
deleted file mode 100644
index cb7d101..0000000
--- a/deploy_checkit_tiff/centos7/Dockerfile
+++ /dev/null
@@ -1,143 +0,0 @@
-# ensure to choose right CENTOS version, because some images are outdated
-# and replaced by newer one, for example centos 7.8.2003 was superceeded by 7.9.2009
-# also ensure, you have run "docker pull --platform linux/amd64 centos:centos7" first!
-FROM --platform=linux/amd64 centos:centos7
-MAINTAINER Andreas Romeyke <romeyke@slub-dresden.de>
-# current could be 0.3.1 or 0.4.0, because 0.4.0 is bugfixed version of
-# checkit_tiff with rules compatible to 0.3.1 based on Handreichung TIFF v1.2
-# in checkit_tiff 0.4.1 the rules are adapted to Handreichung TIFF v1.3
-ENV checkit_tiff_current_version=v1.0.3
-ENV checkit_tiff_upcoming_version=v1.0.3
-# ENV checkit_tiff_gitrepository=https://github.com/SLUB-digitalpreservation/checkit_tiff.git
-ENV checkit_tiff_gitrepository=https://git.fsfe.org/art1pirat/checkit_tiff.git
-ENV pcre_version=8.45
-ENV PATCH="\
---- a/src/CMakeLists.txt\n\
-+++ b/src/CMakeLists.txt\n\
-@@ -28,9 +28,6 @@\n\
- # Make a version file containing the current version from git.\n\
- #\n\
- execute_process( COMMAND git rev-list HEAD --count OUTPUT_VARIABLE REPO_REVISION OUTPUT_STRIP_TRAILING_WHITESPACE )\n\
--execute_process( COMMAND git rev-parse --abbrev-ref HEAD OUTPUT_VARIABLE BUILD_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE)\n\
--execute_process( COMMAND git rev-parse HEAD OUTPUT_VARIABLE BUILD_REV_ID OUTPUT_STRIP_TRAILING_WHITESPACE)\n\
--execute_process( COMMAND git describe --long --tags --dirty --always OUTPUT_VARIABLE BUILD_REV_ID_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE)\n\
- add_definitions(-DVERSION=\"\${BUILD_BRANCH}\")\n\
- add_definitions(-DREPO_REVISION=\"\${REPO_REVISION}\")\n"
-
-# THIS IS A BAD IDEA!!! ONLY SKIP CERTIFICATE VALIDATION IF THERE'S NO OTHER
-# ALTERNATIVE!!!
-#ENV GIT_SSL_NO_VERIFY=true
-RUN yum install -y deltarpm
-RUN yum install -y ca-certificates wget git
-RUN mkdir -p /usr/local/share/ca-certificates/cacert.org
-RUN wget -P /usr/local/share/ca-certificates/cacert.org http://www.cacert.org/certs/root.crt http://www.cacert.org/certs/class3.crt && update-ca-trust
-RUN git config --global http.sslCAinfo /etc/ssl/certs/ca-certificates.crt
-
-# based on https://hub.docker.com/r/rpmbuild/centos6/
-## install base environment
-#RUN yum install -y wget
-#RUN cd /tmp && wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
-#RUN cd /tmp && ls /tmp/ && yum install -y epel-release-latest-7.noarch.rpm
-#RUN yum install -y epel-release
-RUN yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm && yum install -y \
-                   git \
-                   libtool libtool-ltdl \
-                   make cmake3 \
-                   pkgconfig \
-                   sudo \
-                   automake autoconf \
-                   wget \
-                   yum-utils rpm-build && \
-    yum clean all
-#RUN wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo
-# git [devtools-2] (1.8.4) for "rev-list --count" feature, git [centos6] (1.7.1) too old
-#RUN yum install -y devtoolset-2-git
-#RUN ln -s /opt/rh/devtoolset-2/root/usr/bin/git /usr/bin/git
-#RUN yum --enablerepo=extras
-# Hint: only work in architecure linux/amd64
-# Doku: https://wiki.centos.org/AdditionalResources/Repositories/SCL#head-9c6aea9c13b921d5258446c4c5e5886571bdb741
-RUN yum --enablerepo=extras install -y centos-release-scl && yum --enablerepo=extras install -y \
-                   devtoolset-8-gcc \
-                   devtoolset-8-binutils \
-                   devtoolset-8-gcc-c++ \
-                   devtoolset-8-libstdc++-devel \
-                   devtoolset-8-toolchain && scl enable devtoolset-8 bash
-
-
-## add user environment
-RUN useradd builder -u 1000 -m -G users,wheel && \
-    echo "builder ALL=(ALL:ALL) NOPASSWD:ALL" >> /etc/sudoers && \
-    echo "# macros"                      >  /home/builder/.rpmmacros && \
-    echo "%_topdir    /home/builder/rpm" >> /home/builder/.rpmmacros && \
-    echo "%_sourcedir %{_topdir}"        >> /home/builder/.rpmmacros && \
-    echo "%_builddir  %{_topdir}"        >> /home/builder/.rpmmacros && \
-    echo "%_specdir   %{_topdir}"        >> /home/builder/.rpmmacros && \
-    echo "%_rpmdir    %{_topdir}"        >> /home/builder/.rpmmacros && \
-    echo "%_srcrpmdir %{_topdir}"        >> /home/builder/.rpmmacros && \
-    mkdir /home/builder/rpm && \
-    chown -R builder /home/builder
-USER builder
-RUN scl enable devtoolset-8 bash
-ENV FLAVOR=rpmbuild OS=centos DIST=el7 CC=/opt/rh/devtoolset-8/root/usr/bin/gcc CXX=/opt/rh/devtoolset-8/root/usr/bin/g++
-CMD /srv/pkg
-
-WORKDIR /home/builder/
-
-# get and compile libpcre (v8)
-RUN wget -np https://ftp.pcre.org/pub/pcre/pcre-${pcre_version}.tar.gz
-RUN tar xfz pcre-${pcre_version}.tar.gz
-WORKDIR /home/builder/pcre-${pcre_version}/
-RUN ./configure --disable-shared -enable-static && /usr/bin/make -j
-USER root
-RUN /usr/bin/make install
-USER builder
-WORKDIR /home/builder/
-
-# get checkit_tiff
-RUN git clone ${checkit_tiff_gitrepository}
-RUN rm -Rf /home/builder/checkit_tiff/build_*
-# compile checkit_tiff stable
-WORKDIR /home/builder/checkit_tiff
-RUN git checkout ${checkit_tiff_current_version}
-RUN git checkout -- src/CMakeLists.txt
-# add patches to workaround outdated git
-RUN cat src/CMakeLists.txt | \
-sed -e "s/execute_process( COMMAND git rev-parse --abbrev-ref HEADOUTPUT_VARIABLE BUILD_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE)//g" \
- -e "s/execute_process( COMMAND git rev-parse HEAD OUTPUT_VARIABLE BUILD_REV_ID OUTPUT_STRIP_TRAILING_WHITESPACE)//g" \
- -e "s/\(add_definitions(-DVERSION=\"\)\([^\"]*\)/\1${checkit_tiff_current_version}/"  \
- -e "s/execute_process( COMMAND git describe --long --tags --dirty --always OUTPUT_VARIABLE BUILD_REV_ID_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE)//g" > src/CMakeLists.txt.patched
-RUN mv src/CMakeLists.txt.patched src/CMakeLists.txt
-RUN cat -n src/CMakeLists.txt
-RUN mkdir build_stable
-WORKDIR /home/builder/checkit_tiff/build_stable
-RUN cmake3 -DCMAKE_INSTALL_PREFIX=/tmp/checkit_tiff_stable/ \
-  -DCMAKE_C_FLAGS="-W -Wall -Wextra -ansi -pedantic -O3 -flto -Wno-unused-function -fstack-check -fstack-protector-strong -Wformat -Werror=format-security" \
-  -DBUILD_BRANCH=${checkit_tiff_current_version} \
-  -DPCRE_LIBRARY=../../pcre-${pcre_version}/.libs/libpcre.a \
-  -DPCRE_INCLUDE_DIR=../../pcre-${pcre_version}/ ../src && make && make install
-
-# compile checkit_tiff development
-WORKDIR /home/builder/checkit_tiff
-RUN git checkout -- src/CMakeLists.txt
-RUN git checkout ${checkit_tiff_upcoming_version}
-RUN git checkout -- src/CMakeLists.txt
-# add patch to workaround outdated git
-RUN cat src/CMakeLists.txt | \
-sed -e "s/execute_process( COMMAND git rev-parse --abbrev-ref HEADOUTPUT_VARIABLE BUILD_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE)//g" \
- -e "s/execute_process( COMMAND git rev-parse HEAD OUTPUT_VARIABLE BUILD_REV_ID OUTPUT_STRIP_TRAILING_WHITESPACE)//g" \
- -e "s/\(add_definitions(-DVERSION=\"\)\([^\"]*\)/\1${checkit_tiff_upcoming_version}/"  \
- -e "s/execute_process( COMMAND git describe --long --tags --dirty --always OUTPUT_VARIABLE BUILD_REV_ID_SHORT OUTPUT_STRIP_TRAILING_WHITESPACE)//g" > src/CMakeLists.txt.patched
-RUN mv src/CMakeLists.txt.patched src/CMakeLists.txt
-RUN cat -n src/CMakeLists.txt
-RUN mkdir build_development
-WORKDIR /home/builder/checkit_tiff/build_development
-RUN cmake3 -DCMAKE_INSTALL_PREFIX=/tmp/checkit_tiff_development/ \
-  -DCMAKE_C_FLAGS="-W -Wall -Wextra -ansi -pedantic -O3 -flto -Wno-unused-function -fstack-check -fstack-protector-strong -Wformat -Werror=format-security" \
-  -DBUILD_BRANCH=${checkit_tiff_upcoming_version} \
-  -DPCRE_LIBRARY=../../pcre-${pcre_version}/.libs/libpcre.a \
-  -DPCRE_INCLUDE_DIR=../../pcre-${pcre_version}/ ../src && make && make install
-
-# create tar-balls
-WORKDIR /tmp/
-RUN tar cfz checkit_tiff_current.tgz checkit_tiff_stable/
-RUN tar cfz checkit_tiff_upcoming.tgz checkit_tiff_development/
diff --git a/deploy_checkit_tiff/centos7/README.txt b/deploy_checkit_tiff/centos7/README.txt
deleted file mode 100644
index 47eb597..0000000
--- a/deploy_checkit_tiff/centos7/README.txt
+++ /dev/null
@@ -1,39 +0,0 @@
-How to build checkit-tiff variants for Redhat 7 system used by Rosetta
-======================================================================
-
-:lang: en
-:encoding: utf-8
-:author: Andreas Romeyke
-
-== Prerequisites
-
-* you need 'docker'
-
-== How to build
-
-# If something was built, delete all containers for specific image:
-docker ps -a | awk '{ print $1,$2 }' | grep checkit-tiff | awk '{print $1 }' | xargs -I {} docker rm {}
-
-# build stuff
-docker build -t checkit-tiff --rm=true ./
-
-== find out which image
-
-docker images
-
-lists:
-REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
-checkit-tiff        latest              acc13d4a83d9        3 minutes ago       827 MB     # <==== that's it!
-<none>              <none>              e3be26e603f0        5 minutes ago       824 MB
-centos              7.4                 0cd976dc0a98        10 months ago       195 MB
-
-
-== How to copy already built binaries
-
-id=$(docker create checkit-tiff)
-
-docker cp $id:/tmp/checkit_tiff_current.tgz ./
-docker cp $id:/tmp/checkit_tiff_upcoming.tgz ./
-
-docker rm -v $id
-
-- 
GitLab