Below are a few examples of commands for building Slackware packages from different types of source files with commentary explaining them. Most of these come from an article Drew Ames wrote for Linux.com.
The following user options are useful for builds:
An example of building Emacs 22.1 taking advantage of src2pkg to download the source file and then build the package with this command:
Src2pkg successfully downloaded the source code archive, and configured, made, and built the package. The configure process automatically found the GTK libraries. When src2pkg finished, it displayed a message with the location of the Slackware package. I installed it, and Emacs 22.1 ran without a problem.
To test src2pgk's ability to convert RPM files and its creation of build scripts, I downloaded a game called Orbit, file name orbital-1.01-691.i586.rpm, from the OpenSUSE 10.2 repository. The command:
src2pkg -N orbital-1.01-691.i586.rpm
built a src2pkg script called orbital.src2pkg.auto. The src2pkg script is in the same directory as the source file.
src2pkg -VV -C -W -X orbital-1.01-691.i586.rpm
built the package using the src2pkg script in that directory.
The build script generated by src2pkg is very simple, consisting of 44 lines. The following lines are where some users will want to add configuration options:
# Any extra options go here
# STD_FLAGS='-O2 -march=i486 -mtune=i686'
Build scripts can help users save specific configuration options so that they can be repeated each time the package is built. Additionally, build scripts can be real time-savers when you're troubleshooting a package build. Simply change a line or two in the script, build the package again, and repeat the process until the package is just the way you want it.
The web browser, Opera, distributes the browser's source code as a generic binary that uses an interactive shell script, install.sh, to configure and build the application. Therefore, src2pkg requires the use of the -S switch.
To build the package, I used the command:
src2pkg -C -VV -W -S opera-9.24-20071015.6-shared-qt.i386-en.tar.gz.
The interactive installation script successfully ran within the src2pgk process.