[Index] [About]  
Author Simes
Created:  2005-11-18
Last changed:  2005-11-18
[Root]  [Prev] [Idx] [Next] http://www.bpfh.net/computing/software/pkg-tools/build.html 

Building the InstallPackage/build directory

The directory InstallPackage/build contains the actual files which will be installed within the package. The structure of this directory is:

For absolute packages
An absolute package is one where the pkginfo BASEDIR parameter is /. This is the default package type for packages built using these tools.

For this type of package the structure under the InstallPackage/build directory should mirror the locations of the files et al as they would be under / on the system the package is to be installed under.

Thus the file InstallPackage/build/etc/foo will end up being installed at /etc/foo when the package it is a part of is added via pkgadd to a system.

For relative packages
A relative package is one where the pkginfo BASEDIR parameter is something other than /. You have to specify the -R flag to build-pkg to generate packages of this type using these tools.

For this type of package the structure under the InstallPackage/build directory should mirror the locations of the files et al as they would appear under the specified BASEDIR parameter from the pkginfo file.

Thus if the BASEDIR pkginfo file parameter was /usr/local then the file InstallPackage/build/etc/foo would end up at /usr/local/etc/foo when the package it is a part of is added via pkgadd to a system.

The rest of this document will concern itself with absolute packages only.

There are three basic ways in which you can populate the InstallPackage/build directory:

Via chroot-install
This is the default method of populating the InstallPackage/build directory. If the InstallPackage/build directory does not exist then build-pkg will create it and then invoke chroot-install to populate it.

 

Via make parameters
In situations where running make install from within a chroot()ed environment will cause make to attempt to re-build the software for some reason and there is a suitable Makefile variable which specifies the root of the installation tree then you can use command line parameters to a make invocation to have it populate the InstallPackage/build directory.

Thus if you are using software which has been configured using GNU autoconf - i.e. you called a script called configure - then you could use:

+---------

% make install prefix=`pwd`/InstallPackage/build/usr/local

+---------

This generally works as the variable prefix in a Makefile generated by GNU autoconf contains the installation root, normally /usr/local.

It should be noted that there is nothing stopping a package from installed items outside of directories which include the prefix variable; for example you could have files installed in /etc. For that reason you should ensure the following:

 

Self population
You can always install software directly into the InstallPackage/build directory yourself, i.e.:

+---------

% umask 022
% mkdir -p InstallPackage/build/usr/local/bin
% cp somebin InstallPackage/build/usr/local/bin/somebin
% chmod 755 InstallPackage/build/usr/local/bin/somebin

+---------

To create a package with a single file called somebin which will be installed at /usr/local/bin/somebin when the package is added via pkgadd.

[Root]  [Prev] [Idx] [Next] http://www.bpfh.net/computing/software/pkg-tools/build.html 
 [Index] [About] Powered by WML
Author Simes
Created:  2005-11-18
Last changed:  2005-11-18
 
More by the same author Comments? EMail webmaster@bpfh.net
 
© Simes