Tutorial: GnuPG 2.0.13 unter Mac OS X 10.6

Die neue Version GnuPG 2 ist schwieriger zu kompilieren als die alte 1.4er Version.
Desweiteren wird ein Pinentry Programm benötigt, um die Passphrase des verwendeten PGP-Schlüssels abzufragen.
Ich verwende hierfür eine angepasste Version aus dem MacGPG-Bundle (basierend auf pinentry 0.7.6)
Um GnuPG2 kompilieren zu können, muss XCode installiert sein.

UPDATE: Libcrypt 1.4.5 wurde veröffentlicht und wird in dem Tutorial nun berücksichtigt.
UPDATE 2: GnuPG 2.0.14 wurde veröffentlicht, die vorgehensweise ist analog zu der Version 2.0.13

1. Die für GnuPG2 benötigten Libaries kompilieren:

mkdir -p ~/gnupg/lib
cd ~/gnupg/lib
wget ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.7.tar.bz2
tar xfvj libgpg-error-1.7.tar.bz2
cd libgpg-error-1.7
mkdir build
./configure CC="gcc -arch i386" --prefix=~/gnupg/lib/libgpg-error-1.7/build/
make && make install
cd ..
 
wget ftp://ftp.gnupg.org/gcrypt/libgcrypt/libgcrypt-1.4.5.tar.bz2
tar xfvj libgcrypt-1.4.5.tar.bz2
cd libgcrypt-1.4.5
mkdir build
./configure CC="gcc -arch i386" --prefix=~/gnupg/lib/libgcrypt-1.4.5/build/ --with-gpg-error-prefix=~/gnupg/lib/libgpg-error-1.7/build/
make && make install
cd ..
 
wget ftp://ftp.gnupg.org/gcrypt/libksba/libksba-1.0.7.tar.bz2
tar xfvj libksba-1.0.7.tar.bz2
cd libksba-1.0.7
mkdir build
./configure CC="gcc -arch i386"  --prefix=~/gnupg/lib/libksba-1.0.7/build/ --with-gpg-error-prefix=~/gnupg/lib/libgpg-error-1.7/build/
make && make install
cd ..
 
wget ftp://ftp.gnu.org/gnu/pth/pth-2.0.7.tar.gz
tar xvfz pth-2.0.7.tar.gz
cd pth-2.0.7
mkdir build
./configure CC="gcc -arch i386"  --prefix=~/gnupg/lib/pth-2.0.7/build/
make && make install
cd ..
 
wget ftp://ftp.gnupg.org/gcrypt/libassuan/libassuan-1.0.5.tar.bz2
tar xfvj libassuan-1.0.5.tar.bz2
cd libassuan-1.0.5
mkdir build
./configure  CC="gcc -arch i386" --prefix=~/gnupg/lib/libassuan-1.0.5/build/ --with-pth-prefix=~/gnupg/lib/pth-2.0.7/build/
make && make install
cd ..

2. GnuPG2 kompilieren:

cd ..
wget ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-2.0.13.tar.bz2
tar xfvji gnupg-2.0.13.tar.bz2
cd gnupg-2.0.13
./configure CC="gcc -arch i386" --prefix=/opt/gnupg --with-gpg-error-prefix=~/gnupg/lib/libgpg-error-1.7/build/ --with-libgcrypt-prefix=~/gnupg/lib/libgcrypt-1.4.5/build/ --with-libassuan-prefix=~/gnupg/lib/libassuan-1.0.5/build/ --with-ksba-prefix=/~/gnupg/lib/libksba-1.0.7/build/ --with-pth-prefix=~/gnupg/lib/pth-2.0.7/build/
make
sudo make install
echo "export PATH=/opt/gnupg/bin:$PATH" >> ~/.profile

3. Pinentry installieren:

wget http://www.x2on.de/dl/pinentry-mac-binary_0-2.tar.gz
tar xvfz pinentry-mac-binary_0-2.tar.gz
cd pinentry-mac-binary_0-2
sudo cp pinentry-mac.app /opt/gnupg/

4. Einstellungen für Pinentry vornehmen:

echo "pinentry-program /opt/gnupg/pinentry-mac.app/Contents/MacOS/pinentry-mac" > ~/.gnupg/gpg-agent.conf

pinentry-mac Dialog

Sourcecode pinentry-mac: Download

Links:

4 Comments

  1. Tobi says:

    Ich hab pinentry-mac_v0.4.zip vom macgpg2 Projekt auf sourceforge installiert, und krieg damit nur immer die Konsolen-Version von pinentry.

    Was hast Du denn bei Deiner Version noch angepasst?

    • Felix Schulze says:

      Ich hab die Version aus dem SVN Repository genommen und nur optische Anpassungen vorgenommen. (Sourcecode + Binary-Download sind im Artikel verlinkt.)

  2. Ludwig says:

    Hast Du vorher gettext o.ä. installiert? Ich laufe beim Bauen von gpg2 in ein altes Problem:

    “utf8conv.c:382: error: ‘ICONV_CONST’ undeclared (first use in this function)”

    Siehe: http://lists.gnupg.org/pipermail/gnupg-users/2007-July/031456.html

    • Felix Schulze says:

      Hm installiert habe ich es nicht direkt für GnuPG, aber es war bereits auf meinem System für eine andere Software über MacPorts installiert.

Leave a Comment