Search code examples
bashmakefilepackagingdeb

Deb file from sh script


Im trying to establish if it possible to create a deb package for the following app:

http://openfoam.org/download/4-0-source/

It uses an Allmake shell script which contains various standard shell commands and wmake commands to compile the source. wmake appears to be specific to this application but does call make:

http://www.cfdsupport.com/OpenFOAM-Training-by-CFD-Support/node25.html https://github.com/OpenFOAM/OpenFOAM-2.1.x/blob/master/wmake/wmake

Is it possible to call the shell script from within a debian/rules file? or is there a better way of doing this if it is indeed possible?

Any assistance is much appreciated.


Solution

  • Indeed, the general idea of the debian/rules file is to run whatever commands are required to configure and install the upstream package into a location suitable for the dpkg toolchain.

    Modern debhelper-based debian/rules files are typically extremely terse, because most typical packages adhere to build conventions for which good, very simple canned helpers are available, but traditional, more complex and explicit rules files are well-documented in older Debian packaging documentation.

    Basically, the debian/rules file is a Makefile; it should have a binary target with the commands to build the upstream package into the Debian package root.

    https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#rules is probably useful as a starting point - unless your needs are really arcane, the dh defaults will mostly make sense, and it allows you to easily override the parts which don't.