Skip to content
Snippets Groups Projects
Commit e8e36330 authored by Andreas Romeyke's avatar Andreas Romeyke
Browse files

- added workaround / patches to include version and revision info in binary

- changed naming of tar-files
- added build-hint
parent 53031c1f
No related branches found
No related tags found
No related merge requests found
...@@ -4,13 +4,26 @@ ENV checkit_tiff_current_version=v0.2.4 ...@@ -4,13 +4,26 @@ ENV checkit_tiff_current_version=v0.2.4
ENV checkit_tiff_upcoming_version=v0.3.0 ENV checkit_tiff_upcoming_version=v0.3.0
ENV checkit_tiff_gitrepository=https://github.com/SLUB-digitalpreservation/checkit_tiff.git ENV checkit_tiff_gitrepository=https://github.com/SLUB-digitalpreservation/checkit_tiff.git
ENV pcre_version=8.41 ENV pcre_version=8.41
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"
# based on https://hub.docker.com/r/rpmbuild/centos6/ # based on https://hub.docker.com/r/rpmbuild/centos6/
## install base environment ## install base environment
RUN yum install -y \ RUN yum install -y \
libtool libtool-ltdl \ libtool libtool-ltdl \
make cmake \ make cmake \
git \
pkgconfig \ pkgconfig \
sudo \ sudo \
automake autoconf \ automake autoconf \
...@@ -18,6 +31,9 @@ RUN yum install -y \ ...@@ -18,6 +31,9 @@ RUN yum install -y \
yum-utils rpm-build && \ yum-utils rpm-build && \
yum clean all yum clean all
RUN wget http://people.centos.org/tru/devtools-2/devtools-2.repo -O /etc/yum.repos.d/devtools-2.repo 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 install -y devtoolset-2-gcc devtoolset-2-binutils RUN yum install -y devtoolset-2-gcc devtoolset-2-binutils
RUN yum install -y devtoolset-2-gcc-c++ devtoolset-2-libstdc++-devel devtoolset-2-toolchain RUN yum install -y devtoolset-2-gcc-c++ devtoolset-2-libstdc++-devel devtoolset-2-toolchain
#RUN yum install -y devtoolset-2 #RUN yum install -y devtoolset-2
...@@ -58,25 +74,46 @@ RUN rm -Rf /home/builder/checkit_tiff/build_* ...@@ -58,25 +74,46 @@ RUN rm -Rf /home/builder/checkit_tiff/build_*
# compile checkit_tiff stable # compile checkit_tiff stable
WORKDIR /home/builder/checkit_tiff WORKDIR /home/builder/checkit_tiff
RUN git checkout ${checkit_tiff_current_version} 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 RUN mkdir build_stable
WORKDIR /home/builder/checkit_tiff/build_stable WORKDIR /home/builder/checkit_tiff/build_stable
RUN cmake -DCMAKE_INSTALL_PREFIX=/tmp/checkit_tiff_stable/ \ RUN cmake -DCMAKE_INSTALL_PREFIX=/tmp/checkit_tiff_stable/ \
-DBUILD_BRANCH=${checkit_tiff_current_version} \
-DPCRE_LIBRARY=../../pcre-${pcre_version}/.libs/libpcre.a \ -DPCRE_LIBRARY=../../pcre-${pcre_version}/.libs/libpcre.a \
-DPCRE_INCLUDE_DIR=../../pcre-${pcre_version}/ ../src -DPCRE_INCLUDE_DIR=../../pcre-${pcre_version}/ ../src
RUN make && make install RUN make && make install
# compile checkit_tiff development # compile checkit_tiff development
WORKDIR /home/builder/checkit_tiff WORKDIR /home/builder/checkit_tiff
RUN git checkout -- src/CMakeLists.txt
RUN git checkout ${checkit_tiff_upcoming_version} 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 RUN mkdir build_development
WORKDIR /home/builder/checkit_tiff/build_development WORKDIR /home/builder/checkit_tiff/build_development
RUN cmake -DCMAKE_INSTALL_PREFIX=/tmp/checkit_tiff_development/ \ RUN cmake -DCMAKE_INSTALL_PREFIX=/tmp/checkit_tiff_development/ \
-DBUILD_BRANCH=${checkit_tiff_upcoming_version} \
-DPCRE_LIBRARY=../../pcre-${pcre_version}/.libs/libpcre.a \ -DPCRE_LIBRARY=../../pcre-${pcre_version}/.libs/libpcre.a \
-DPCRE_INCLUDE_DIR=../../pcre-${pcre_version}/ ../src -DPCRE_INCLUDE_DIR=../../pcre-${pcre_version}/ ../src
RUN make && make install RUN make && make install
# create tar-balls # create tar-balls
WORKDIR /tmp/ WORKDIR /tmp/
RUN tar cfz checkit_tiff_stable.tgz checkit_tiff_stable/ RUN tar cfz checkit_tiff_current.tgz checkit_tiff_stable/
RUN tar cfz checkit_tiff_development.tgz checkit_tiff_development/ RUN tar cfz checkit_tiff_upcoming.tgz checkit_tiff_development/
...@@ -11,6 +11,10 @@ How to build checkit-tiff variants for Redhat system used by Rosetta ...@@ -11,6 +11,10 @@ How to build checkit-tiff variants for Redhat system used by Rosetta
== How to build == 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 ./ docker build -t checkit-tiff --rm=true ./
== find out which image == find out which image
...@@ -28,8 +32,8 @@ centos 6.8 0cd976dc0a98 10 months ago ...@@ -28,8 +32,8 @@ centos 6.8 0cd976dc0a98 10 months ago
id=$(docker create checkit-tiff) id=$(docker create checkit-tiff)
docker cp $id:/tmp/checkit_tiff_stable.tgz ./ docker cp $id:/tmp/checkit_tiff_current.tgz ./
docker cp $id:/tmp/checkit_tiff_development.tgz ./ docker cp $id:/tmp/checkit_tiff_upcoming.tgz ./
docker rm -v $id docker rm -v $id
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment