diff --git a/docker/build-pinentry-qt4-docker-image.sh b/docker/build-pinentry-qt4-docker-image.sh new file mode 100755 index 0000000..3fdcb5a --- /dev/null +++ b/docker/build-pinentry-qt4-docker-image.sh @@ -0,0 +1,5 @@ +#! /bin/bash + +cd $(dirname $0) + +docker build -t g10-build-pinentry-qt4:centos7 pinentry-qt4 diff --git a/docker/pinentry-qt4/Dockerfile b/docker/pinentry-qt4/Dockerfile new file mode 100644 index 0000000..dab9bcf --- /dev/null +++ b/docker/pinentry-qt4/Dockerfile @@ -0,0 +1,54 @@ +# Dockerfile - docker/pinentry-qt4 +# Copyright (C) 2022 g10 Code GmbH +# +# Software engineering by Ingo Klöcker +# +# This file is part of GnuPG. +# +# Gpg4win is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# Gpg4win is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, see . +# +# SPDX-License-Identifier: GPL-2.0+ + +FROM centos:7 + +# Import the CentOS 7 package signing key after verifying its fingerprint. +# Then add the software collections repository from the CentOS SCLo SIG and +# import its package signing key after verifying the fingerprint. +# Ditto for the EPEL 7 package signing key. +RUN test $(gpg --with-colons --with-fingerprint < /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 | grep ^pub: | wc -l) = 1 \ + && gpg --with-colons --with-fingerprint < /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 | grep -q ^fpr:::::::::6341AB2753D78A78A7C27BB124C6A8A7F4A80EB5 \ + && rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7 \ + && yum -y update \ + && rm -rf /root/.gnupg + +RUN yum -y install \ + automake \ + binutils \ + bzip2 \ + gcc \ + gcc-c++ \ + libassuan-devel \ + make \ + qt-devel + +# pinentry requires libgpg-error-1.16 (CentOS 7 includes 1.12) +RUN mkdir /tmp/libgpg-error \ + && cd /tmp/libgpg-error \ + && curl --remote-name https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-1.16.tar.gz \ + && tar -xzf libgpg-error-1.16.tar.gz \ + && cd libgpg-error-1.16 \ + && ./configure \ + && make install \ + && cd \ + && rm -rf /tmp/libgpg-error diff --git a/docker/run-pinentry-qt4-build.sh b/docker/run-pinentry-qt4-build.sh new file mode 100755 index 0000000..d1bff13 --- /dev/null +++ b/docker/run-pinentry-qt4-build.sh @@ -0,0 +1,30 @@ +#! /bin/bash + +set -e + +if [ "$1" = "--devel" ]; then + devmode= +else + devmode=1 +fi + +sourcedir=$(cd $(dirname $0)/..; pwd) + +if [ -z "$devmode" ]; then + buildroot="/tmp/build-pinentry-qt4.$(id -un).d" + [ -d "$buildroot" ] || mkdir "$buildroot" +else + buildroot=$(mktemp -d --tmpdir build-pinentry-qt4.XXXXXXXXXX) +fi +echo Using ${buildroot} + + +docker run -it --rm --user "$(id -u):$(id -g)" \ + --volume ${sourcedir}:/src \ + --volume ${buildroot}:/build \ + g10-build-pinentry-qt4:centos7 + +echo "You can find the build in ${buildroot} (if the build succeeded)." + +# Unpack the tarball of pinentry and then ./configure and make to test +# building pinentry for Qt4.