This is an old revision of the document!
Table of Contents
SlackBuild scripts
A SlackBuild script is a shell script (usually Bourne shell compatible) that automates the process of configuring, compiling and creating a Slackware package (*.tgz, *.txz, *.tbz files) from source archives.
Overview
The basic process of creating a Slackware package from source can be summarized as follows, while details may vary from one build system to another.
- Uncompress the source archive (usually .tar.gz or .tar.bz2 file) into a “work directory.”
- Configure the source, and apply patches if needed.
- Compile/build the source and generate the binaries.
- Install the program to a temporary directory. This step may be a little bit tricky, depending on how the
make install
(or similar functionality) of the build system works. In GNU Make, theDESTDIR
variable passed to the command should be sufficient. In other cases, this might involve patching theMakefile
(or similar file) or editing a build configuration setting. - Copy the program documentation and other necessary files to the appropriate subdirectories in the temporary directory. These locations should adhere to default directory structure used by Slackware to store applications installed by the package manager, viz. inside the
/usr/
folder. - Use the
makepkg
utility from the temporary directory (installation location) to create a Slackware package that can then be installed using theinstallpkg
utility.
While the above steps can be done by hand, the process is tedious, sometimes complex, and involves typing in a lot of commands. Automating the process by a shell script allows the user to share the process with the community at large. It also makes sense to use and modify existing SlackBuild scripts for upgrading the same program to a newer version.
External Links
- SlackBuilds - http://www.slackbuilds.org/
- Templates - http://slackbuilds.org/templates/
Sources
- Originally written by V.Harishankar for the SlackDocs Wiki Project