Configuration

Configuration files

Configuration files are located in the /etc/pkgmake (global configuration) and $HOME/.pkgmake (user configuration) directories. pkgmake first reads its global configuration, and then overwrites those settings with definitions from the user configuration (if any).

All configuration takes place in the pkgmake.conf file - there are no other files to edit (except your SpecFile templates, of course).

Configuring pkgmake

Taking the distributed pkgmake.conf as starting point is a good idea. Most of the settings will already be good for you - however, you may want to change some of them (most likely the personal ones). Which changes you to the global file (in /etc/pkgmake) and which to the personal one (in your home directory) is completely up to you and will of course depend on how many users will work with pkgmake on the particular machine.

Application specific stuff

Some settings are specific to the application as such - they reflect the dependencies the program has. Usually, these settings already should be fine if you installed from the RPM/DEB packages:

Variable Default Explanation
BUILDDEB/usr/src/debianwhere your build directories are located. Here you should find the directories BUILD, DEBS, RPMS, SDEBS, SOURCES, SPECS and SRPMS
DEBBUILDdebbuild((full) path and) name of the debbuild script. If debbuild is in your $PATH, the default should be fine.
RPMBUILDrpmbuild((full) path and) name of the rpmbuild executable. If rpmbuild is in your $PATH, the default should be fine.
DEBOPTS<empty>additional options passed to debbuild
RPMOPTS<empty>additional options passed to debbuild
RMDSPEC1whether to remove (1) the Debian-specific SpecFile (created from your template) or not (0) once the run completes
RMSPEC1same for the RPM SpecFile
CHANGELOGSORT1shall pkgmake take care the ChangeLog is sorted correctly? rpmbuild needs a correct sorting, or it aborts.

Project defaults

Some other settings reflect the defaults for the packages you will be creating. Of course these defaults can be overwritten in the SpecFile itself or on the command line. They are intended for those cases you use the placeholders in your SpecFile, and don't provide replacements on the command line:

Variable Default Explanation
BUILDARCHnoarcharchitecture of the created packages. Values are things like i386 or noarch
LICENSEGPLwhich license is protecting your software
RELEASE<empty>this string is appended to the package name. If set e.g. to "johnny1", a package name could look like "dummy_0.1.2-johnny1_all.deb"
GROUP<empty>the RPM group the packages should belong to. Make sure to escape slashes
SECTION<empty>same for Debian packages
AUTOSECT0whether pkgmake shall automatically find a matching Debian section from the specified RPM group (1) or not (0)
MKTAR1whether to create {{{.tar.gz}}} archives (1) or not (0)
MKDEB1same for Debian packages
MKRPM1same for RPM packages
NUKECVS1whether pkgmake shall clean up the CVS/SVN specific files in the distributed packages (1) or not (0)

These are just some examples (you will find more settings in that section). The other settings are mostly comparable to the examples given here. For a more complete reference, please see the corresponding manpage (man pkgmake.conf).

SpecFile templates

Once you configured the application, your main place of changes will be the SpecFile templates: Here you finally define the build of your packages. A few sample templates are already shipped with the distribution of pkgmake, so you can get an idea of this part. A practical template is pkgmake.tpl - the template from which the pkgmake packages themselves are created. If you installed pkgmake from an RPM or Debian package, this is proof the template worked :)

If you are familiar with the structure of the RPM SpecFile (which is a good precondition for the work with pkgmake), you will recognize the structures. There are plenty of placeholders available (you can easily tell them: All letters are UPPERCASE and they are enclosed by double underscores). You will probably never need them all - but some of them are very useful, even more when working with relman as a frontend to pkgmake. To give you some examples, based on the pkgmake.tpl:

  • the __NAME__ will probably never change, so this is a stupid placeholder
  • __VERSION__ and __RELEASE__ are very good examples - they will permanently change. So you will not need to edit the SpecFile for that, but simply provide this information on the command line
  • stupid that I did not use the __VENDORURL__ here - which probably will be the same for all my projects. If it changes once, I'd have to update all my SpecFile templates now - that could have been avoided by using the __VENDORURL__ placeholder here.
  • __RECOMMENDS__, __SUGGESTS__, __PROVIDES__: These are Debian-specific settings, which would break rpmbuild. Thanks to these placeholders, rpmbuild takes care that this does not happen - but my Debian package will include the necessary "Recommends:", "Suggests:" and "Provides:" lines.

There may be other things which are handled differently on a RPM and Debian system - for this we can use conditional settings as specified by the RPM SpecFile rules. You will find them close to the end of the pkgmake.tpl file: Look out for "%if %{REDHAT} ". Uncommenting the RPMOPTS and DEBOPTS lines in the sample pkgmake.conf, you could use things like that as well.

We don't go more into details here - so I finally will give you some references were to find more information:

Last modified by izzy, 09/17/08 20:43:17 (5 years ago)