Skip to content

Instantly share code, notes, and snippets.

@phryneas
Last active August 29, 2015 14:16
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save phryneas/cb53a87c3136c9896240 to your computer and use it in GitHub Desktop.
build gnupg2.1 on ubuntu trusty

This Makefile builds gnupg 2.1, creates .deb packages and installs them on ubuntu trusty (and most likely anywhere else where the necessary build-dependencies are present and checkinstall is installed ).

If you are missing dependencies, the ./configure steps should tell you about those.

Building

  • download gnupg-modern and all required libraries (libgcrypt,libgpg-error,libksba,libassuan,pinentry) from https://gnupg.org/download/index.html
  • potentially change version numbers in the Makefile
  • run make gpg

manual intervention

When building libgpg-error0, manual intervention is necessary:

Ubuntu has libgpg-error0 on a multiarch install and only accepts a package of the same version as the i386 version to be co-installed. Additionally, the package mode has to be set to multiarch:both. Checkinstall will halt and ask for modifications to the control file to be made. Those are:

Version: 1.12-0.2ubuntu1
Multi-Arch: same

exit your editor and everything should continue.

WARNING

the above multiarch hack may or may not break things. you have been warned.

GNUPG=2.1.2
LIBASSUAN=2.2.0
LIBGCRYPT=1.6.2
LIBGPG_ERROR=1.18
LIBKSBA=1.3.2
PINENTRY=0.9.0
ARCH=amd64
RELEASE=1
DIR=$(shell pwd)
gpg: gnupg2_$(GNUPG)-$(RELEASE)_$(ARCH).deb
gnupg2_$(GNUPG)-$(RELEASE)_$(ARCH).deb: libassuan0_$(LIBASSUAN)-$(RELEASE)_$(ARCH).deb libgcrypt20_$(LIBGCRYPT)-$(RELEASE)_$(ARCH).deb libgpg-error0_$(LIBGPG_ERROR)-$(RELEASE)_$(ARCH).deb libksba8_$(LIBKSBA)-$(RELEASE)_$(ARCH).deb pinentry-gtk2_$(PINENTRY)-$(RELEASE)_$(ARCH).deb
tar xvf gnupg-$(GNUPG).tar
cd gnupg-$(GNUPG); \
./configure && \
make && \
sudo checkinstall -y --pkgname gnupg2 --pkgversion $(GNUPG) --provides "gnupg2" --requires "libassuan0,libgcrypt20,libgpg-error0,libksba8,pinentry" --exclude /usr/local/share/info/dir --pakdir=$(DIR) --pkgrelease $(RELEASE)
libassuan0_$(LIBASSUAN)-$(RELEASE)_$(ARCH).deb:
tar xvf libassuan-$(LIBASSUAN).tar
cd libassuan-$(LIBASSUAN); \
./configure && \
make && \
sudo checkinstall -y --pkgname libassuan0 --pkgversion $(LIBASSUAN) --provides "libassuan0,libassuan0-dbg,libassuan-dev" --requires "libc6,libgpg-error0" --exclude /usr/local/share/info/dir --pakdir=$(DIR) --pkgrelease $(RELEASE)
libgcrypt20_$(LIBGCRYPT)-$(RELEASE)_$(ARCH).deb: libgpg-error0_$(LIBGPG_ERROR)-$(RELEASE)_$(ARCH).deb
tar xvf libgcrypt-$(LIBGCRYPT).tar
cd libgcrypt-$(LIBGCRYPT); \
./configure && \
make && \
sudo checkinstall -y --pkgname libgcrypt20 --pkgversion $(LIBGCRYPT) --provides "libgcrypt20,libgcrypt20-dbg,libgcrypt20-dev" --requires "libc6,libgpg-error0" --exclude /usr/local/share/info/dir --pakdir=$(DIR) --pkgrelease $(RELEASE)
libgpg-error0: libgpg-error0_$(LIBGPG_ERROR)-$(RELEASE)_$(ARCH).deb
#see comment below
libgpg-error0_$(LIBGPG_ERROR)-$(RELEASE)_$(ARCH).deb: libgpg-error0_1.12-0.2ubuntu1-1_amd64.deb
libgpg-error0_1.12-0.2ubuntu1-1_amd64.deb:
tar xvf libgpg-error-$(LIBGPG_ERROR).tar
cd libgpg-error-$(LIBGPG_ERROR); \
./configure && \
make && \
sudo checkinstall -y --pkgname libgpg-error0 --pkgversion "$(LIBGPG_ERROR)" --maintainer "MANUAL INTERVENTION NECESSARY! SET Version TO '1.12-0.2ubuntu1' and add the line 'Multi-Arch: same'" --provides "libgpg-error0,libgpg-error0:$(ARCH),libgpg-error-dev,libgpg-error0-udeb" --requires "multiarch-support,libc6" --exclude /usr/local/share/info/dir --pakdir=$(DIR) --pkgrelease "" --review-control
# this one needs manual intervention to be installed alongside the i386 multiarch version provided by debian.
# in the review control set the version to your ubuntu installed version: "1.12-0.2ubuntu1"
# and add the line "Multi-Arch: same"
libksba8_$(LIBKSBA)-$(RELEASE)_$(ARCH).deb: libgpg-error0_$(LIBGPG_ERROR)-$(RELEASE)_$(ARCH).deb
tar xvf libksba-$(LIBKSBA).tar
cd libksba-$(LIBKSBA); \
./configure && \
make && \
sudo checkinstall -y --pkgname libksba8 --pkgversion $(LIBKSBA) --provides "libksba8,libksba-dev" --requires "libc6,libgpg-error0" --exclude /usr/local/share/info/dir --pakdir=$(DIR)
pinentry-gtk2_$(PINENTRY)-$(RELEASE)_$(ARCH).deb:
tar xvf pinentry-$(PINENTRY).tar
cd pinentry-$(PINENTRY);\
./configure --enable-pinentry-gtk2 --enable-fallback-curses --disable-pinentry-qt4 && \
make && \
sudo checkinstall -y --pkgname pinentry-gtk2 --pkgversion $(PINENTRY) --provides "pinentry-gtk2,pinentry" --requires "libc6,libglib2.0-0,libgtk2.0-0,libncurses5,libpango-1.0-0,libtinfo5" --exclude /usr/local/share/info/dir --pakdir=$(DIR)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment