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

Build Installer Package

Building a new Gpg4win installer package is mostly automized.

What you need: A Debian GNU/Linux 3.1 'sarge' system. For this system the follwing instructions are tested. In principle the procesure should also work for other system, perhaps some adapations are necessary.
Furthermore, you need at least 200 MByte on your harddisk and a acceptable fast internet connection for downloading about 40 MBytes.

Typical tasks:

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 3.1:
    # apt-get install mingw32 nsis stow unzip texinfo imagemagick
    # apt-get install tetex-bin gs-common hyperlatex
  2. Get the sources anonymously (i.e. with out write-access):
    $ svn checkout https://svn.wald.intevation.org/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:
    $ AUTOMAKE_SUFFIX=-1.9 ./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