This page should guide you to the creation of binary packages from OpenFOAM for your favorite Linux distribution. It is mainly written for Debian/Ubuntu at the moment.
The Debian Policies describing the basic rules for Debian based distributions. The goal would be to get the OpenFOAM debian package conform with these policies and not vice-versa.
As the OpenFOAM package uses CDBS at the moment, you'll should check the CDBS Documentation, just in case.
A very nice guide about Debian and dynamic libraries can be found here: Debian libpkg-guide
1.2 Creating Debian Source Package
In the packaging/ubuntu/10.04 branch of the extend project there is a small bash script createDebianSourcePackage.sh available, which relies on the git-buildpackage package. With this script or git-buildpackage you can easily create a debian src package from this git branch by executing it (make sure the debian directory is available).
Maybe you have to adapt a couple of files in the debian directory or elsewhere in the OpenFOAM source code, this is case dependent. You should have at least set a new version number for your new debian package. If you don't know how to do this, RTFM.
1.3 Testing the source package
1.3.1 Setup pbuilder
In order to test the debian src package, use pbuilder: Pbuilder Howto
Using pbuilder the first time
sudo pbuilder create
, you have to tell him also to use additional packages from the PPA. To do so, create a file ~/.pbuilderrc with the following content (make sure you adjust the desired ubuntu release name)
COMPONENTS="main restricted universe multiverse" OTHERMIRROR="deb http://ppa.launchpad.net/cae-team/ppa/ubuntu lucid main"
afterwards update the pbuilder with
sudo pbuilder update --override-config
or alternatively (in that case you'll don't need a ~/.pbuilderrc config file) with
sudo pbuilder update --override-config --othermirror "deb http://ppa.launchpad.net/cae-team/ppa/ubuntu lucid main|deb-src http://ppa.launchpad.net/cae-team/ppa/ubuntu lucid main|deb ftp://ftp.rrzn.uni-hannover.de/pub/mirror/linux/ubuntu lucid main universe restricted multiverse"
1.3.2 Create the binary package
After pbuilder was setup and updated correctly (the update command should be executed regularly), compile the debian src package with the following command (Please adjust the path and name to the desired dsc file):
sudo pbuilder build --pkgname-logfile ~foam/OpenFOAM/openfoam-1.6-ext_1.6.0-1ppa1~lucid1.dsc
1.4 Uploading the source package
After the pbuilder run was successful, you can upload the original debian src package to launchpad for example. PPA Upload Guide