Building Shorewall from Git Tom Eastep 2009 2010 Thomas M. Eastep Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover, and with no Back-Cover Texts. A copy of the license is included in the section entitled GNU Free Documentation License. This information is provided primarily for Shorewall developers. Users are expected to install from pre-built tarballs or packages.
Git Taxonomy The Shorewall Git tree at Sourceforge serves as the master repository for Shorewall 4.4 and later versions. It is not possible to simply export a directory from Git and run the install.sh script in that directory. A build step is required to produce a directory that is suitable for the install.sh script to run in.
trunk The development branch of each product is kept here. Shorewall Shorewall6 Shorewall-lite Shorewall6-lite There are also several other directories which are described in the following sub-sections.
trunk/docs The development release XML documents. Depending on the point in the release cycle, these documents may also apply to the current stable version. In that case, there is no docs directory in that release's directory in branches.
trunk/manpages, trunk/manpages6, trunk/manpages-lite and trunk/manpages6-lite The development release XML manpages. Depending on the point in the release cycle, these documents may also apply to the current stable version.
tools This is where the release and build tools are kept. There are two subordinate directories: trunk/tools/build Tools for building and uploading new releases. trunk/tools/web Tools for publishing web content
web The files from the web site that are maintained in HTML format. are kept in this directory.
Build Tools As described above, the build tools are kept in trunk/tools/build. They are described in the following sections.
setversion The setversion script updates the version number in a directory. The script is run with the current working directory being trunk.
setversion version
The version may either be a minor version or a patch version.
build44 This is the script that builds Shorewall packages from Git. The script copies content from Git using the git archive command. It then uses that content to build the packages. In addition to the usual Gnu utilities, the following software is required: rpmbuild (I use rpm version 4.4.2.3-20.3) Required to build the RPM packages. xsltproc (libxslt -- I use version 1.1.24-19.1) Required to convert the XML documents to other formats. Docbook XSL Stylesheets (I use docbook-xsl-stylesheets version 1.74.0-1.35) Required to convert the XML documents to other formats. Perl (I use Perl 5.10.0-62.17.1) Required to massage some of the config files. xmlto (I use version 0.0.18-182.27) Required to convert the XML manpages to manpages. Note that not all versions of xmlto will work (those released by Debian and Ubuntu, for example, do not work). If you find that xmlto fails, install tools/build/xmlto in /usr/local/bin. You should ensure that you have the latest script. The scripts change periodically as we move through the release cycles. The scripts may need to be modified to fit your particular environment. There are a number of variables that are set near the front of the script: STYLESHEET Must point to the XHTML docbook.xsl stylesheet from your Docbook XSL Stylesheets installation. LOGDIR Directory where you want the build log placed. Defaults to the current working directory. RPMDIR Points to your RPM directory . DIR Directory where you want the release to be built. Defaults to the current working directory. GIT Shorewall GIT repository The scripts assume that there will be a separete build directory per major release. To build a release, you cd to the appropriate directory and run the build script. The general form of the build command is:
build44 [ -options ] release [ prior release ]
where options are one of the following. If no options are given then all options are assumed t build tar files r build RPMs c Build the shorewall package. l Build the shorewall-lite package. 6 Build the shorewall6 package. L Build the shorewall6-lite package. h Build the html document package. x Build the xml document package. release The release version to build. Must match the version in the associated Git path. prior release The release to be used to generate patch files. Example 1 - Build Shorewall 4.3.7 and generate patches against 4.3.6:
build44 4.3.7 4.3.6
Example 2 - Build Shorewall 4.2.7.1 Shorewall and generate patches against 4.2.7:
build44 -trSc 4.3.7.1 4.3.7
upload44 This script is used to upload a release to lists.shorewall.net. The command is run in the build directory for the major release of the product.
upload44 [ -products ] release
where products specifes the products to upload. If not given, all products are uploaded. This option is generally given only when uploading a patch release. c Upload the shorewall package. l Upload the shorewall-lite package. 6 Upload the shorewall6 package. L Upload the shorewall6-lite package. release The version number of the release to upload. Example 1 - Upload release 4.3.7:
upload44 4.3.7
Example 2 - Upload shorewall-perl-4.3.7.3:
upload44 -p 4.3.7.3