Sbbuilder (SlackBuild Builder) is a small perl script for automating the
generation of the directory structure and the SlackBuild necessary for
making packages compliant with the VectorLinux repository.
It was made with three goals. The first one is to give facilities for
making a standard repository. The script would reproduce the same
structure for every package making more easy the maintenance and the
realization of automated tasks. The second is to give a tool for packagers
in order to make your life a bit easier and improve your productivity.
Developers and enthusiastics that build many packages will find it (we hope)
useful. Finally, we hope it will be part of a bigger app developed for porting
an existing VL repository to different architectures.
First the installation. We are using Template-Toolkit, you need to install it
in your system. It is very easy:
cpan Template
If you install it as root the resource will be available for all users, if you
are planning to use sbbuilder as your regular user you can install TT with your
regular account. You will be prompted with a few questions, defaults are OK.
If you never used cpan before, it's the perl modules repository. It ask for
your location the first time in order to use the nearest mirror. We are going
to include TT in the default installation in the future.
Now we are ready to take a look into Sbbuilder. Install it with
slapt-get --install sbbuilder
Its usage is pretty straight forward. Two parameters are required:
ssbuilder --package=<name_of_the_package> --version=<version>
This will build the directories and place a SlackBuild with the package name
and version information.
The directory tree is like this:
AppName
|
`-- Version Number
|
`-- src
|
`-- AppName.SlackBuild
The SlackBuild will be filed with AppName and Version where is pertinent.
A number of optional arguments can be used in a way that it allows to
generate the whole SlackBuild without need of extra editing.
--user Your packager ID. If not used it will look for the
VL_PACKAGER environment variable (you can define it in your shell
startup script, tipically ~/.bashrc). If that var is not set the
script will use the current username returned by `whoami`.
--build Define a build number (as in 1vl60). If not defined the
script will default to 1.
--link This is a new variable in the SlackBuild template. You can
define a URL to the tar.gz or tar.bz2. The SlackBuild will download
the sources using wget if no sources are found in the working dir.
This variable will be useful if a repackaging is needed.
--type Different kinds of sources are available in the OpenSource
world

. We need to configure the sources properly.It defaults to usual configure
The possible values of this argument are:
* perl Use this to build perl modules and general perl
applications. Perl packages need a special configuration for
working and this option provides it.
* python Obviously for building python apps

. This option
writes the classic python setup.py lines in the proper place.
* noarch This will replace the ARCH (tipically i586)value with
"noarch". In this way users know that they can use your package
in any architecture.
* cmake For modern and cool developers that are using cmake
instead the old lady GNU Autoconf.
--configure_options Pass extra options for the configure script (or cmake)
with this option.
--ldflags Define extra ldflags for the actual compiling process.
--help You wont believe it, it shows a short help message.
--manual Well, shows the manual.
As you note, if all the options are used you get a fully working SlackBuild with a
oneliner (I admit it, a long one), and if you place a slack-desk file in the same
dir of the SlackBuild, you may not need extra editing. Of course this is for
applications in general, many will need extra tweaking of the SlackBuild.
The new template written by uelsk8s provides a special place for the application of
patches, and you have the classic "extra tweakings" section after the configure
lines. It's very important to use the indicated places for doing this stuff, so the
script will be easy to understand for other packagers and also automated tasks can
be made (grep is powerful!

).
Enjoy and as always, suggestions, patches, fixes and insults are welcome.
uelsk8,rbistolfi,kidd