m4_dnl -*-html-*- m4_include(`template.m4') m4_dnl $Id$ m4_define(`EN') m4_define(`DE_FILE', `build-installer-gnulinux-de.html') PAGE_START

Build Gpg4win under GNU/Linux

This example specifically describes how to create a new Gpg4win installer on a Debian GNU/Linux 'Etch' 4.0. In principle, any other GNU/Linux system could be used as well.

Back to overview on building installer

Create a new installer package

The character '#' indicates commands to be executed as administrator (root) and '$' for commands to be executed as regular user.
  1. Install required packages on your Debian GNU/Linux 4.0:
    # apt-get install mingw32 nsis stow unzip texinfo imagemagick
    # apt-get install libglib2.0-dev tetex-bin tetex-extra gs-common hyperlatex
  2. Get the sources anonymously (i.e. with out write-access):
    $ svn checkout https://svn.wald.intevation.org/svn/gpg4win/trunk/
    or download the source code package gpg4win-n.n.n.tar.gz, unpack it and change to the directory gpg4win-n.n.n. We recommend to work with the SVN version if you want to do more that just update a single module for yourself.
  3. Download all necessary Gpg4win modules from Internet:
    $ cd packages
    $ sh download.sh
    (takes some time, especially the first time)
    $ cd ..
  4. If you work with the SVN version:
    $ ./autogen.sh
    $ ./configure --enable-maintainer-mode --host=i586-mingw32msvc
    else:
    $ ./configure --host=i586-mingw32msvc
  5. Now build the Gpg4win installer package:
    $ make

That's all. The new installer package is here:
src/gpg4win-n.n.n.exe
The corresponding source code packages (with the sources of all modules, very big!) is here:
src/gpg4win-src-n.n.n.exe

Update a single module for Gpg4win

Fort this task you should have build at least once a new installer package as described above. Consider now we want to update the module gnupg.
  1. First, remove the old version:
    $ cd packages
    $ rm gnupg-*
  2. Then download the desired new release, e.g:
    $ wget ftp://ftp.gnupg.org/gnupg/gnupg-1.4.3.tar.bz2
    $ wget ftp://ftp.gnupg.org/gnupg/gnupg-1.4.3.tar.bz2.sig
    $ gpg --verify gnupg-1.4.3.tar.bz2.sig
    Only continue if that latter command shows a valid signature. You will find further hints on this at the href="http://www.gnupg.org/download/integrity_check.html">GnuPG Website. If the module does not provide any signature you should ensure authenticity of the file with another reasonable method.
  3. Build a new installer:
    $ cd ..
    $ make clean
    $ ./configure --host=i586-mingw32msvc
    $ make

Attention: From now on your should not execute the script download.sh anymore because it would revert to the previous (i.e. official) version of the module. For a permanent activation of the new module version for the official Gpg4win installer package, the following steps are necessary.

Precondition is that you have write access to the SVN directory (i.e. a user account at wald.intevation.de with developer status for Gpg4win).

  1. Adapt file
    packages.current
    accordingly for the new module version (read the head of this file about the syntax) and upload to Subversion repository:
    $ svn commit packages.current
  2. Create a signature for this file:
    $ gpg -sb packages.current
  3. If haven't so far ever authorized an updated package list, you need to add your PGP key to the keyring an den Schlüsselbund
    packages.keys
    using this command:
    $ gpg --export --armor YOUR-KEY-ID > gpg_pub_key.asc
    $ gpg --no-default-keyring --keyring ./packages.keys --import gpg_pub_key.asc
    A lost of the current keys is shown with this command:
    $ gpg packages.keys
  4. Upload the two files to the Gpg4win website:
    $ make update

Integrate a new module into Gpg4win

Hierfür sollte man schon einmal ein Installationspaket wie oben beschrieben For this task you should have at least once created a installer package according to the description above using the SVN version.
  1. For your new module 'MYMOD' first create constants in the file include/config.nsi.in by adding the following lines:
    @HAVE_PKG_MYMOD@
    !define gpg4win_pkg_mymod @gpg4win_pkg_mymod@
    !define gpg4win_pkg_mymod_version @gpg4win_pkg_mymod_version@
    You will find various examples in this file, e.g. see 'HAVE_PKG_WINPT'.
  2. Write the NSIS installation script
    src/inst-mymod.nsi
    In the same directory you will find many examples to learn from.
  3. Write the NSIS de-installation script
    src/uninst-mymod.nsi
    In the same directory you will find many examples to learn from.
  4. Extend the NSIS main script
    src/inst-sections.nsi
    with MYMOD. Do this analogous to existing entries and read the explanations in the comments.
  5. Now add rules for integration into the build process into the file
    configure.ac
    For this you can use macros from the file
    m4/gpg4win.m4
    Due to the already integrated modules there are plenty of examples given. A main distinction is between cross-compiled modules and those that have been compiled for Windows elsewhere and integrated as compiled binaries.
  6. Now update the package list
    packages/packages.current
    as described above.
  7. Gpg4win has to be configured anew for the new module:
    $ AUTOMAKE_SUFFIX=-1.9 ./autogen.sh
    $ ./configure --enable-maintainer-mode --host=i586-mingw32msvc
  8. The last step is to build the new package:
    $ make

The new installer package is here:
src/gpg4win-n.n.n.exe
The corresponding source code packages (with the sources of all modules, very big!) is here:
src/gpg4win-src-n.n.n.exe