Skip to content
This repository was archived by the owner on Jan 15, 2018. It is now read-only.

Installation and Configuration

Izzy edited this page Jan 15, 2018 · 1 revision

This page describes the Installation and Configuration of pkgmake.

Installation

Installation methods

Depending on your system, there are several installation methods available. First and preferred over all others is the installation from the provided packages: In the IzzySoft Apt Repository, you will find both RPM and Debian packages. They should be generic and not dependent on a specific Linux distribution - i.e. the RPM packages should install fine not only in RedHat, but also on SuSE and other distributions using the RedHat packaging system, and the Debian packages should be fine for any distribution using Debian packages (in fact, they are tested only with Ubuntu).

If you cannot use any of those packages, the next alternative is to use make install. As a last resort, you can try a manual install by copy the sources to the right place. Details follow:

Installation from packages

This is the most easy and also most convenient way. Best is to include the IzzySoft Apt Repository directly in your packaging system - which should work for APT (Debian) and YUM (RPM). Details on how to do this can be found on the Repository Site. One of the big advantages will be that all dependencies should be resolved automatically, and you will never need to check for updates manually - they will be monitored by your packaging system then, and updates are installed when available. First-time installation then is as easy as entering yum install pkgmake for RPMs, or apt-get install pkgmake for the Debian package. Similarly a clean uninstallation can be handled, if necessary, using yum remove pkgmake resp. apt-get remove pkgmake (or even apt-get remove --purge pkgmake to also remove the configuration files).

If you cannot include the repository into your packaging system, you still can download the RPM/Debian package from there and install it manually, e.g. by issuing the command rpm -ivh pkgmake*.rpm resp. dpkg -i pkgmake*.deb. This will however require you to also download and install the packages pkgmake depends on - i.e. debbuild. Updates then can be handled the same way. A clean uninstallation can be handled by those tools as well then: rpm -e pkgmake resp. dpkg -r pkgmake or dpkg --purge pkgmake.

Installation using make

A first precondition is to have debbuild installed. Past installations showed that not all versions of the debbuild script seem to work with pkgmake. You will find debbuild at http://www.deepnet.cx/debbuild/ (or in the SVN repository at https://secure.deepnet.cx/svn/debbuild/).

As soon as those preconditions are met, download and unpack the .tar.gz archive. After changing into the directory where you unpacked the tarball, you should find a file named Makefile there. In that directory, issue the command make install (which will install pkgmake into the /usr/local hierarchy) or make DESTDIR=/usr install (to install directly below /usr). Similarly, uninstallation can be done replacing "install" by "uninstall".

Manual installation

Only if none of the above methods work for you, you should do a manual installation. The crux with this is, that later on a uninstallation also has to be done manually - and you may forget some things then. However, here's what you need to do for a manual installation - after you solved the dependencies (i.e. installed debbuild) correctly:

Variant 1

Simply unpack the .tar.gz archive to where you want the application to be. Optionally copy the version and pkgmake.conf files into the /etc/pkgmake directory, and optionally create yourself an alias to the pkgmake executable, since it probably will not be in your $PATH.

This is the most simple way, and uninstallation is as easy as removing the installation directory plus the two config files. However, the man pages won't be found if you call "man pkgmake", and some other simple things maybe missing. So this method may be suited for a "first try" only.

Variant 2

Basically you will do what make install would have done for you, after unpacking the .tar.gz archive:

  • copy the pkgmake file to /usr/local/bin (or any other directory contained in your $PATH)
  • copy the version and pkgmake.conf files to /etc/pkgmake/
  • copy the manpage files (man/* to the corresponding manpage directories (/usr/man/man?/ or /usr/local/man/man?/, replace the question mark by the number the manfile carries)

This is a complete installation, so all things should work as intended - so this variant should be preferred over the first one (but not over the package or "make" installation!).

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/debian where your build directories are located. Here you should find the directories BUILD, DEBS, RPMS, SDEBS, SOURCES, SPECS and SRPMS
DEBBUILD debbuild ((full) path and) name of the debbuild script. If debbuild is in your $PATH, the default should be fine.
RPMBUILD rpmbuild ((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
RMDSPEC 1 whether to remove (1) the Debian-specific SpecFile (created from your template) or not (0) once the run completes
RMSPEC 1 same for the RPM SpecFile
CHANGELOGSORT 1 shall 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
BUILDARCH noarch architecture of the created packages. Values are things like i386 or noarch
LICENSE GPL which 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
AUTOSECT 0 whether pkgmake shall automatically find a matching Debian section from the specified RPM group (1) or not (0)
MKTAR 1 whether to create .tar.gz archives (1) or not (0)
MKDEB 1 same for Debian packages
MKRPM 1 same for RPM packages
NUKECVS 1 whether 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:

Clone this wiki locally