diff --git a/Makefile.am b/Makefile.am index e69a61d3..d95efb4f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,120 +1,125 @@ # Makefile.am - Installer for GnuPG 4 Windows Makefile. # Copyright (C) 2005, 2008, 2012 g10 Code GmbH # # This file is part of GPG4Win. # # 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 . ACLOCAL_AMFLAGS = -I m4 AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip DISTCHECK_CONFIGURE_FLAGS = --host=i686-w64-mingw32 if BUILD_GPG4WIN po = po else po = endif if BUILD_GPG4WIN doc = doc else doc = endif SUBDIRS = ${po} packages ${doc} src # find patches -type f | sort | sed 's/$/ \\/' | sed 's/^/ /' # find patches-appimage -type f | sort | sed 's/$/ \\/' | sed 's/^/ /' EXTRA_DIST = autogen.sh README.GIT ONEWS \ doc/license-page doc/GPLv3 \ build-aux/git-log-footer build-aux/git-log-fix \ + docker/appimage/AppRun \ + docker/appimage/build-appimage.sh \ + docker/appimage/Dockerfile \ + docker/build-appimage-docker-image.sh \ + docker/run-appimage-build.sh \ patches/boost/boost-1-fixes.patch \ patches/breeze-icons/0001-Make-binary-icons-cross-compilable.patch \ patches/extra-cmake-modules/0001-Use-BIN_INSTALL_DIR-data-for-DATAROOTDIR-on-Windows.patch \ patches/glib-2.41.5/01-socket.patch \ patches/glib-2.41.5/02-formatsec.patch \ patches/gpgol/0001-Handle-protected-headers-also-on-multipart-parts.patch \ patches/kconfigwidgets/0001-Make-QDbus-optional.patch \ patches/kiconthemes/0001-Make-DBus-optional.patch \ patches/kleopatra/lower-cmake-requirement.patch \ patches/kxmlgui/0001-make-qdbus-optional.patch \ patches/kxmlgui/0004-Cruedly-disable-KSendbugmail.patch \ patches/libkleo/lower-cmake-requirement.patch \ patches/libkleo/z-01-use-pre-5.80-ecm_qt_declare_logging_category.patch \ patches/qtbase/0001-Fix-build-without-std-thread.patch \ patches/qtbase/0001-Gpg4win-qstandardpaths-patch.patch \ patches/qtbase/0002-Gpg4win-theme-names-and-relpaths.patch \ patches/qtbase/0003-Fix-build-with-GCC-11-include-limits.patch \ patches/qttools/disable-most-tools.patch \ patches/w32pth-2.0.5/workaround-broken-libtool.patch \ patches-appimage/gnupg-2.3.2/0001-agent-Fix-segv-in-GET_PASSPHRASE-regression.patch \ patches-appimage/gnupg-2.3.2/0002-build-Fix-ksba.h-not-found-problem.patch \ patches-appimage/gnupg-2.3.2/0003-common-New-function-substitute_envvars.patch \ patches-appimage/gnupg-2.3.2/0004-common-Support-a-gpgconf.ctl-file-under-Unix.patch \ patches-appimage/gnupg-2.3.2/0005-build-Fix-several-include-file-not-found-problems.patch \ patches-appimage/kconfigwidgets/0001-build-without-KF5Auth.patch \ patches-appimage/libkleo-21.08.1/0001-Add-support-for-non-standard-boost-include-directori.patch \ patches-appimage/libkleo-21.08.1/z-01-use-pre-5.80-ecm_qt_declare_logging_category.patch \ patches-appimage/qtwayland-5.15.0/00-disable-wayland-server.patch copy-news: cp NEWS doc/website/NEWS.last copy-release: gpg4win-$(VERSION).tar.bz2 installers/gpg4win-$(VERSION).exe \ installers/gpg4win-light-$(VERSION).exe \ installers/gpg4win-vanilla-$(VERSION).exe @echo Copying $(VERSION) to $(RELEASEHOST) >&2 @set -e;\ if ssh "$$(echo $(RELEASEHOST)|cut -d: -f -1)" \ test -f "$$(echo $(RELEASEHOST)/gpg4win-$(VERSION).exe|cut -d: -f2-)";\ then echo "This release has already been copied to the server" >&2 ;\ else scp gpg4win-$(VERSION).tar.bz2 \ installers/gpg4win-$(VERSION).exe \ installers/gpg4win-light-$(VERSION).exe \ installers/gpg4win-vanilla-$(VERSION).exe \ installers/gpg4win-src-$(VERSION).exe $(RELEASEHOST)/ ;\ for f in en de ; do \ scp src/README.$$f.txt \ $(RELEASEHOST)/README-$(VERSION).$$f.txt; \ done;\ fi dist-hook: gen-ChangeLog gen_start_date = 2012-03-26T00:00:00 .PHONY: gen-ChangeLog gen-ChangeLog: set -e; \ if test -d $(top_srcdir)/.git; then \ (cd $(top_srcdir) && \ $(GITLOG_TO_CHANGELOG) --append-dot --tear-off \ --amend=build-aux/git-log-fix \ --since=$(gen_start_date) ) > $(distdir)/cl-t; \ cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t;\ rm -f $(distdir)/ChangeLog; \ mv $(distdir)/cl-t $(distdir)/ChangeLog; \ fi download: packages/packages.current (cd packages; ./download.sh) msi: $(MAKE) $(AM_MAKEFLAGS) -C src msi msi-signed: $(MAKE) $(AM_MAKEFLAGS) -C src msi-signed msi-upload: $(MAKE) $(AM_MAKEFLAGS) -C src msi-upload diff --git a/README b/README index fee5f1b3..e88a35a1 100644 --- a/README +++ b/README @@ -1,181 +1,197 @@ This is gpg4win - the GUI Installer Builder for W32. See also the file doc/README.en.txt. For MSI Package instructions see src/README-msi.txt. Instructions: ============= 1. Download the source and binary packages that are required to build the installer: $ cd packages $ sh download.sh [...] $ cd .. 1.5 (Only necessary when building from Git) $ ./autogen.sh 2. Configure the source tree for cross compilation: $ ./autogen.sh --build-w32 3. Build the installer: $ make The installer will be made available under src/installers: src/installers/gpg4win-X.Y.Z.exe +Instructions for AppImage: +========================== + +1. (Only necessary when building from Git) + + $ ./autogen.sh + +2. Build the Docker image that will be used for creating the AppImage: + + $ docker/build-appimage-docker-image.sh + +3. Build the AppImage using the Docker image: + + $ docker/run-appimage-build.sh + + Basic requirements ================== A decent POSIX system is required for building this software as well as GNU make. We are using Debian GNU/Linux 10 (buster), any other POSIX system should work as well but you may run into problems due to different toolchain versions. For MSI Packages you will additionally need the dependencies mentioned in src/README-msi.txt To satisfy all needs of configure at least the following packages need to be installed: build-essential autoconf automake mingw-w64 mingw-w64-i686-dev \ mingw-w64-x86-64-dev nsis stow unzip icoutils texlive \ libglib2.0-dev gettext docbook-utils ghostscript \ texinfo libgdk-pixbuf2.0-dev texlive-latex-extra libqt4-dev-bin \ wget mingw-w64 texlive-lang-german cmake libgtk2.0-bin libxml2-utils \ gperf libgettextpo-dev automake-1.15 libkf5config-dev libkf5config-dev-bin \ libkf5coreaddons-dev gpgrt-tools imagemagick Building the Webpages ===================== The website is in the dedicated branch "website" in the git reposity. Checkout that branch and read the instructions: git checkout website Development Branches ==================== The old version of gpg4win (version < 1.2) is since 1.1.3 tracked by the GIT branch: gpg4win-1-branch. Only important fixes will go into this version. The current version in the GIT master starts as version 1.9. Adding new packages to the installer: ===================================== This requires editing a couple of files; we might eventually automate some of these tasks. Here is a short run up: 1. Add constants for the package FOO into src/config.nsi.in . 2. Create 2 new installer scripts, named src/inst-foo.nsi and uninst-foo.nsi and add them to EXTRA_DIST in src/Makefile.am. 3. Add foo to one the variables gpg4win_bpgks (if foo should not be build be the gpg4win) or gpg4win_spkgs (if foo should be build by gpg4win) in src/Makefile.am . Also add any required configure flags etc. 4. Add FOO to src/inst-sections.nsi. 5. Add detection of packages to configure.ac. Check out the available macros in m4/gpg4win.m4. Depending on the way an upstream package is packaged, you might need to write a new macro. 6. Add download information to packages/download.sh. 7. If the package ships pkg-config (*.pc) support files, you need add post install instructions to Makefile.am. Note that *.pc files may be in the "runtime" directory ${pkgidir} if the package is built within gpg4win (or peculiarly shipped), or in the development package ${pkgidir_dev}. 8. Add the installed files to the mkportable headers. Then run the usual "./autogen.sh" to create the actual configure file and run configure as described above. Kleopatra Locatization ====================== The kde-l10n package is generated with the script src/kde-l10n.sh execute it after a build to generate an updated l10n package which you can then upload and add to packages.current. The tarballs and the nsis scripts are located in the temp directory kde-l10n prints as output. Installer Slideshow =================== During installation we are showing a slide show. If you want to change the contents shown add / modify files in the src/slideshow subfolder. Install them in inst-gpg4win.nsi (Add them to the list of files before g4wihelp::slide_show) and modify src/slideshow/slides.dat accordingly. Version numbers =============== We use a specific order of version numbers. This is best shown by an example: 2.1.1 - The final 2.1.1 release. 2.1.1-beta88 - A snapshot before the 2.1.1 release. (The 88 in this example is the number of commits since the last release). The important point is that we bump up the version number before we do an release and append a suffix to mark it as a development version. This allows other software to use a configure check for the next to be released version of gpg4win. Copyright ========= The entire Gpg4win package is Copyright (C) 2005, 2006, 2007, 2008, 2009, 2012, 2013 g10 Code GmbH 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, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA This file ========= Copyright 2005, 2006, 2008 g10 Code GmbH This file is free software; as a special exception the author gives unlimited permission to copy and/or distribute it, with or without modifications, as long as this notice is preserved. This file is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY, to the extent permitted by law; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. diff --git a/docker/appimage/Dockerfile b/docker/appimage/Dockerfile new file mode 100644 index 00000000..29a040f6 --- /dev/null +++ b/docker/appimage/Dockerfile @@ -0,0 +1,105 @@ +# Dockerfile - docker/appimage +# Copyright (C) 2021 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 \ + && yum -y install \ + centos-release-scl \ + && test $(gpg --with-colons --with-fingerprint < /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo | grep ^pub: | wc -l) = 1 \ + && gpg --with-colons --with-fingerprint < /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo | grep -q ^fpr:::::::::C4DBD535B1FBBA14F8BA64A84EB84E71F2EE9D55 \ + && rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-SCLo \ + && yum -y update \ + && yum -y install \ + epel-release \ + && test $(gpg --with-colons --with-fingerprint < /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 | grep ^pub: | wc -l) = 1 \ + && gpg --with-colons --with-fingerprint < /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 | grep -q ^fpr:::::::::91E97D7C4A5E96F17F3E888F6A2FAEA2352C64E5 \ + && rpmkeys --import /etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 \ + && yum -y update \ + && rm -rf /root/.gnupg + +RUN yum -y install \ + at-spi2-core-devel \ + automake \ + boost169-devel \ + bzip2 \ + bzip2-devel \ + cmake3 \ + dbus-devel \ + devtoolset-7-binutils \ + devtoolset-7-gcc \ + devtoolset-7-gcc-c++ \ + devtoolset-7-make \ + egl-wayland-devel \ + file \ + fontconfig-devel \ + freetype-devel \ + gettext \ + git \ + gnutls-devel \ + gperf \ + libXrender-devel \ + libicu-devel \ + libjpeg-devel \ + libpng-devel \ + libxkbcommon-x11-devel \ + mesa-libEGL-devel \ + mesa-libGL-devel \ + openldap-devel \ + openssl11-devel \ + patch \ + pcre2-devel \ + readline-devel \ + stow \ + wayland-devel \ + wget \ + which \ + xcb-util-image-devel \ + xcb-util-keysyms-devel \ + xcb-util-renderutil-devel \ + xcb-util-wm-devel \ + xz-devel \ + zlib-devel + +# download the necessary linuxdeploy AppImages and extract them because we have no fuse in the container +RUN mkdir -p /tmp/download \ + && cd /tmp/download \ + && wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage \ + && wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage \ + && chmod +x linuxdeploy-* \ + && cd /tmp \ + && download/linuxdeploy-plugin-qt-x86_64.AppImage --appimage-extract \ + && download/linuxdeploy-x86_64.AppImage --appimage-extract \ + && rm -rf /tmp/download \ + && mkdir -p /opt \ + && mv /tmp/squashfs-root /opt/linuxdeploy + +COPY build-appimage.sh / + +RUN chmod +x build-appimage.sh diff --git a/docker/appimage/build-appimage.sh b/docker/appimage/build-appimage.sh new file mode 100644 index 00000000..40b7d6b5 --- /dev/null +++ b/docker/appimage/build-appimage.sh @@ -0,0 +1,58 @@ +#!/bin/sh +# Build an AppImage of Kleopatra +# Copyright (C) 2021 g10 Code GmbH +# +# Software engineering by Ingo Klöcker +# +# This file is part of GnuPG. +# +# GnuPG 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 3 of the License, or +# (at your option) any later version. +# +# GnuPG 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-3.0+ + +set -e + +source /opt/rh/devtoolset-7/enable + +cd /src/packages +./download.sh + +cd /src +./configure --enable-appimage --enable-maintainer-mode --disable-manuals + +cd /src +make + +echo 'rootdir = $APPDIR/usr' >/build/AppDir/usr/bin/gpgconf.ctl + +export PATH=/opt/linuxdeploy/usr/bin:$PATH +export LD_LIBRARY_PATH=/build/AppDir/usr/lib + +# tell the linuxdeploy qt-plugin where to find qmake +export QMAKE=/build/AppDir/usr/bin/qmake + +# create plugin directories expected by linuxdeploy qt-plugin +# workaround for +# [qt/stdout] Deploy[qt/stderr] terminate called after throwing an instance of 'boost::filesystem::filesystem_error' +# [qt/stderr] what(): boost::filesystem::directory_iterator::construct: No such file or directory: "/build/AppDir/usr/plugins/printsupport" +# ERROR: Failed to run plugin: qt (exit code: 6) +mkdir -p /build/AppDir/usr/plugins/{printsupport,sqldrivers} + +cd /build +linuxdeploy --appdir /build/AppDir \ + --desktop-file /build/AppDir/usr/share/applications/org.kde.kleopatra.desktop \ + --icon-file /build/AppDir/usr/share/icons/hicolor/256x256/apps/kleopatra.png \ + --plugin qt \ + --output appimage \ + 2>&1 | tee /build/logs/linuxdeploy-kleopatra.log diff --git a/docker/build-appimage-docker-image.sh b/docker/build-appimage-docker-image.sh new file mode 100755 index 00000000..f33e6ff5 --- /dev/null +++ b/docker/build-appimage-docker-image.sh @@ -0,0 +1,5 @@ +#! /bin/bash + +cd $(dirname $0) + +docker build -t g10-build-appimage-kleopatra:centos7 appimage diff --git a/docker/run-appimage-build.sh b/docker/run-appimage-build.sh new file mode 100755 index 00000000..3473e24d --- /dev/null +++ b/docker/run-appimage-build.sh @@ -0,0 +1,14 @@ +#! /bin/bash + +set -e + +sourcedir=$(cd $(dirname $0)/..; pwd) + +buildroot=$(mktemp -d --tmpdir appimage-kleopatra.XXXXXXXXXX) +echo Using ${buildroot} + +docker run -it --rm --user "$(id -u):$(id -g)" \ + --volume ${sourcedir}:/src \ + --volume ${buildroot}:/build \ + g10-build-appimage-kleopatra:centos7 \ + /build-appimage.sh