GnuPG for OSX

The files on the Mac GnuPG homepage are a bit dated1). So I compiled a universal binary from the latest sources. It works for me, maybe it works for you as well.

Have fun with this one: GnuPG-1.4.11 Universal (Mac OS X 10.4 and up)

Compile on your own

If you dont trust my binaries then all you need are the sources and the PackageMaker that ships with Apples Xcode.

Unfortunately the GnuPG project wont compile as an universal binary out of the box. It already fails at configure-state when you use both the -arch i386 and -arch ppc flags.

The solution was to compile the sources as INTeL i386/32bit binaries and keep those …

./configure PERL=/usr/bin/perl  CC="/usr/bin/gcc-4.0 -arch i386 -m32 -O2 -ffast-math \
  -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 \
  -I/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include/ " --prefix=/usr/local/  \
  --disable-maintainer-mode --disable-minimal --enable-rsa --enable-idea --enable-aes \
  --enable-blowfish --enable-sha256 --enable-sha512 --enable-twofish \
  --enable-photo-viewers --enable-exec --enable-bzip2  
make

… and in a second step compile the sources as PowerPC G4/32bit binaries …

./configure PERL=/usr/bin/perl  CC="/usr/bin/gcc-4.0 -arch ppc -m32 -O2 -faltivec \
  -ffast-math -isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 \
  -I/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include/ " --prefix=/usr/local/  \
  --disable-maintainer-mode --disable-minimal --enable-rsa --enable-idea --enable-aes \
  --enable-blowfish --enable-sha256 --enable-sha512 --enable-twofish \
  --enable-photo-viewers --enable-exec --enable-bzip2  --build=powerpc-apple-darwin10.4.1
make

… and finaly glue them with the i386 ones. The tool you need for this is called lipo. It is part of Xcode.

lipo -create -output gpg -arch i386 /path/to/i386-binaries/gpg -arch ppc /path/to/ppc-binaries/gpg

You need to glue the binaries inside the bin/ directories and inside the libexec/gnupg/ directories. Please note that gpg-zip is just a shell script and doesn't need to be lipo'ed.

Ah yes.. of course you need to put the different binaries in different locations before. I used a dirty way to achieve this: I renamed my /usr/local/ directory (to keep a backup of whats already in there) and installed the i386 binaries using sudo make install. Then I renamed that new /usr/local/ hierarchy to /usr/local.386/ and did the same for the PowerPC binaries (using /usr/local.ppc/). In a last step I created a vanilla /usr/local/ tree and put the results from lipo in there. I also used that clean filesystem tree to generate the package.

Sourcecode: gnupg-1.4.11.tar.gz PackageMaker project: GnuPG-1.4.11_Package

1) Please note that the main development of GnuPG is now focused on version 2.x and up