ZENBUILD(5)

NAME
ZENBUILD - buildpkg meta-file

DESCRIPTION
ZENBUILDs are the meta-files fed to buildpkg during automatic build script creation. This manual page will give a run down of all the possible options that can be included in a ZENBUILD and an explanation of each. It might also be helpful to visit the online wiki page for buildpkg at: http://wiki.zenwalk.org/index.php/Buildpkg

MANDATORY VARIABLES AND FUNCTIONS

pkgname
    The name of the package. Per packaging standards, keep it all lowercase.

pkgver
    The version of the software. No dashes or underscores are allowed, just numbers and dots. Letters such as b for beta are allowed but are discouraged.

pkgrel
    This is the release number of the package. A release number is the number of times this package has been created for this particular pkgver. So the first time you package a piece of software at a particular version, it is pkgrel 1, if you package it again at that exact same version perhaps to use different compile options or some other reason, it is pkgrel 2. However, if the package version changes, you go back to 1. So for example, software foo is at version 1.0 and is packaged, so that is pkgrel 1. It is packaged again at version 1.0 because of bad CXXFLAGS, that one is called pkgrel 2. If the software advances to 2.0, and you package that, the pkgrel goes back to 1, and doesn't advance to 3.

zenver
    This is the version of zenwalk you are building for without any dots. So if you are building for version 4.8, it is 48, version 5.0, it is 50.

arch
    The architecture of the build. It will generally be i486 or noarch, but on occasion can be i686. If you aren't sure, go with i486, this is also the architecture that is assigned to the -march C and CXX FLAGS if you are compiling.

source
    This is an array for the source files needed to complete the build. This can be anything from a url to a tarball to a local personally created patch or .desktop file. If you have more than one, just put each one in quotes and make sure there is a space between them and make sure they are inside the parentheses. E.g. source=("http://url.ta r.gz" "gcc.path" "thing.desktop"). For cvs or svn builds, this variable is not technically necessary, you can leave it empty and fetch the svn or cvs source in build().

sourcetemplate
    This is a template to where the source will be put online (the ones that don't contain a full url). E.g. sourcetemplate=http://users.zenwalk.org/user-accounts/pnboy/kgname/kgver.

slackdesc
    This is an array where you put the description of the software you are packaging. On the first line put the package name followed by a space a dash and another space and then a short description. On the following 1-9 lines dependending on how much you need, put a longer explanation. Enclose each line in quotes and make sure each line is under 70 characters, which can be ensured by following the handy ruler provided in the ZENBUILD prototype created by makepkg --generate. For those used to skipping the second line of the slackdesc, the script does that automatically so go straight into the long explanation in the second line.

build()
    This is the function that is executed which actually does all the compiling. Before this function is ran, the path to the current directory is assigned the variable $startdir and then $startdir/src is created. After that anything specified in the source=() array is copied into $startdir/src and all tarballs are untarred. After that $startdir/pkg is created. Then this function is run. So the aim of this function is to put whatever commands that are necessary, be it ./configure, make, make install DESTDIR=$startdir/pkg, or any other combination of commands, to setup $startdir/pkg correctly. $startdir/pkg needs to be setup as if it is the / and so everything underneath goes where it is supposed to. If for instance, you are packaging something that you want to go in /usr/bin/foo, you would make sure it got to $startdir/pkg/usr/bin/foo in this function.

OPTIONAL VARIABLES AND FUNCTIONS

docs
    This is used in almost every package, but might possibly not be used. You fill in whatever documentation that comes with the package, docs=("AUTHORS" "LICENSE" "Changelog") into this variable and they will be moved over appropriately during the build to be included in the package. Don't worry about specifiying any path or the case of the docs because buildpkg does a case insensitive recursive search for whatever you provide. If you have more than one, do like I did above or like you do in source and put each doc in quotes with a space between them.

options
    This is an array that takes certain arguments and affects how the build script operates. As of 1.6.1, the options it takes are 'noextract', 'norequiredbuilder', 'requiredbuilderflatdeps', 'nostrip', 'keepdepfile' and 'noautodotnew'. noextract will prevent the build script from extracting tarballs automatically which is the default behavior. This is useful for those pesky tarbombs which explode all the contents into the current directory when extracted instead of its own dedicated directory and has some other potential uses. If you use this option, you must extract the tarballs yourself in build(). norequiredbuilder will prevent the build script from running requiredbuilder. This is useful for manually adding all the dependencies in the extradepends, this can save time when building packages. requiredbuilderflatdeps will make the build script execute requiredbuilder using a flat dependencies policy. nostrip prevents the execution of the stripping function, can be useful in some applications, that break if they are stripped. keepdepfile is used to don't delete a previously created dep file, neither create a new one. noautodotnew is used to remove the automatic dotnew handling in all files in etc

url A homepage or some other information url about the software.

extradepends
    Although dependencies are automatically detected by requiredbuilder, some packages don't detect properly and so you add those here to make sure they are included.

lessdepends
    The opposite of extradepends, perhaps requiredbuilder detected a dependency that isn't actually a dependency, include that here and it will be removed from the dependency list.

dotnew
    These are generally configuration files that you don't want to overwrite during install because they will mess up any configuration that the user installing the package already had setup. You put the path that they will be on the filesystem. So let's say you don't want /etc/foo.conf to be overwritten and you are packaging a new version of software foo. You put dotnew=('etc/foo.conf') and that file in the package (in $startdir/pkg) will get moved to foo.conf.new and a test will be put in the doint.sh (script that runs after install) to see whether or not to move it over.

CFLAGS / CXXFLAGS
    The script already assigned the FLAGS as -O2 -march=$arch -mtune=i686, where $arch is what you provide in the arch variable mentioned above. If for some reason those aren't the ones that you want, you can override them using these variables.

doinst()
    This is the script that runs after a package is installed, so put any commands in here that you wan't to be run after the package is installed.

AUTHOR
Matthew Bruenig <matthewbruenig@gmail.com>

SEE ALSO
buildpkg(8)