Documentation for ODU pkg_tools
This document is an attempt to describe how to build packages using ODU pkg_tools. The heart of ODU pkg_tools is the PSpec (Package Specification) file, which gives information on the name of the package, program, version, dependencies, installation scripts, et al.
Before you build your first package with ODU pkg_tools, you will want to keep in mind the following thoughts:
- What you want to package
- Where you want to install it
- How do you want to install/remove it
- Are there any dependencies?
The first question is somewhat easy - what program do you want to install on your system? The second question takes a little thinking - usually, this would be in /usr/local. The other two questions may take some planning on your part - some packages only require a simple
./configure maketo build them, whereas others are much more involved, especially when it comes to dependencies (for instance, KDE and Python require the C++ libraries be installed on the system).
Let's use a sample program to produce a 'Hello World' message. This particular program uses only the 'configure/make' combination above to build it and 'make install' to install it.
Once you've figured out how you want to plan your package, code it up in a PSpec file by starting with the required declarative verbs:
%%package %%program %%version %%source %%files
The following verbs are optional, but necessary for complete documentation:
%%revision %%description %%copyright %%install_dir
In addition to the above verbs, we need describe how to do mundane things like how to unpack the source code, what patches to apply if any, how to build the program (usually, ./configure;make) and how the program is installed, as well as any scripts that need to be run. This is done by specifying the following:
- %%prep
- unpacking the sources
- %%build
- building the program binaries
- %%install
- how/where to install the binaries
- %%clean
- how to clean up the mess before/after unpacking/building

