src2pkg for the impatient

The following instructions presume at least a basic understanding of:

  1. Linux (!)
  2. Software packages & their installation on your system
  3. Experience building programs from source is helpful, but not required

src2pkg has been developed to make it as easy as possible to go from a single source archive to a single installable package. It is not, however, a substitute for package-making experience and understanding.

For a more complete picture, try the tutorial.

Download & install

Download the Slackware package here.

Install as root, with:

~# installpkg src2pkg-*.tgz

After installation, while still root:

~# src2pgk --setup

Put the kettle on.

Setup & Preparation

It's advisable to set up a clean working area to keep your source if you don't have one already, and doubly advisable to do so as a user, not root.

~$ mkdir src

Next, take a look at the configuration file just installed.

~$ less /etc/src2pkg/src2pkg.conf

The important part we need to know is on line 185:

## Working Directories
# The default settings for these are like for Slackware SlackBuilds:
#
# The tarball, or link to it, is in the current directory 
# SOURCES_DIR="$CWD"
# Sources are unpacked and built in /tmp
# SRC_BUILDS_DIR="/tmp"
# The package build tree is also in /tmp
# PKG_BUILDS_DIR="/tmp"
# Finished packages are left in /tmp
# PKG_DEST_DIR="/tmp"

Read the rest of the file for details. Now we know most of what's going to happen is going to happen in /tmp .

Make tea.

Package building

Push the button, make the noise:

~/src$ src2pkg http://example.com/sources/a_configure_make_makeinstall.tar.gz

Pay attention to the output.

You should now find a package in /tmp called:

/tmp/a_configure_make_makeinstall-1.0.1-i486-1.tgz

Drink you tea.

Finishing up

Install the package you've just created, and do the washing up.

What next?

Some ideas:

  • Check the Tutorial for a more detailed description on package building.
  • Verify the packages you've built by untarring them before installing. Make sure all the binaries you think should be there are.
  • Pay attention to the output of the package build. Check the FAQ for ideas on solutions to build failures.
  • Configure your global build settings in /etc/src2pkg/src2pkg.conf, and tweak your user settings in ~/.src2pkg/src2pkg.conf. The latter is especially useful for not overriding the main configuration file.
  • Generate a script with the -N option, then run the build from the script with -X.
  • Tweak the script as required, reading about the processes in the file.
  • Convert a file from an RPM to a Slackware package.
  • Set up any pre- and post-hooks to these processes by adding commands to the ~/.src2pkg/extensions/<process_number>.<type>, where type is pre or post and process_number is the number found from the process index - the two digit number prefixed on the files in /usr/libexec/src2pkg/.
 
quickstart.txt · Last modified: 2013/03/30 08:53 by Gilbert Ashley
Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki