This pages presents an overview of src2pkg, its features, and how to get it and install it.
src2pkg makes the creation of installable Slackware packages easier and more reliable for both beginners and advanced users. It creates packages using the simple 'tgz' format used by Slackware and many of its' derivatives.
src2pkg makes it possible for beginners to create packages without knowing all the details of what makes a proper package. And it allows advanced package creators to focus on the more difficult aspects of package making which can't always be handled automatically, such as creating or modifying init scripts which allow the package to work properly when installed.
src2pkg can create packages from many sources using only simple command-line options or no options at all. For more advanced or difficult packages, a src2pkg script can be used, making many more options available. src2pkg scripts use a simple, easy-to-understand syntax which is mostly self-explanatory. Package creation is divided into 16 basic steps, each of which is performed by a certain block of src2pkg code. Each block is written as a shell function and is meant to work independently of the other functions. This makes it possible to leave out functions when they are not needed or when the package requires doing things in some non-standard way.
src2pkg can usually be used while logged in as a normal user. For some sources which are difficult to package without really installing the software, you must log in as user 'root' or other user with full permissions for writing files and running any commands on the system.
src2pkg is not a package manager or system updater. It is not designed to keep your system up-to-date with Slackware current. Nor is it designed to download and install pre-built packages, resolving dependencies as it goes. It is not meant to replace or perform the same functions as programs such as slackpkg, slapt-get or swaret.
src2pkg does not work with Slackbuild scripts or the Slackbuilds.org repository like sbopkg (http://www.sbopkg.org/)does.
Download src2pkg here: http://distro.ibiblio.org/pub/linux/distributions/amigolinux/download/src2pkg/
The latest version is 1.9.9.
If you are installing src2pkg for the first time, simply use 'installpkg' to install the src2pkg package (src2pkg-X.X.X-noarch-X.tgz). Then,while still logged in as user 'root', run the command: src2pkg –setup to setup src2pkg for use on your system. The –setup switch automatically compiles and installs a few small helper applications.
src2pkg –setup as user root after upgrading to this version of src2pkg.Please see the CHANGES file here: http://distro.ibiblio.org/pub/linux/distributions/amigolinux/download/src2pkg/CHANGES for details on new features in this, and previous versions.
For version 1.9.9:
src2pkg is able to automatically handle package creation from many different kinds of content. The original purpose was to create packages from source-code tarballs -unpacking, configuring, and compiling the sources before creating the package content. But, the modularity of the src2pkg functions makes it easy to create packages from so called 'noarch' conetent or from pre-compiled binary content, such as proprietary video drivers, media players or any other type of content. It can also convert foreign or generic binary packages, such as binary *.rpm or Debian *.deb packages, into the Slackware format.
a. autoconf sources -most commonly available sources use the 'autoconf/automake' system for configuration. src2pkg handles these automatically -even when the sources are incomplete or outdated. Incomplete sources are sources from CVS or SVN which must have their configuration files generated first before running 'configure'. Many sources also use outdated configuration files which are incompatible with the versions of autoconf and automake which are installed on your system. src2pkg recognizes these and runs extra commands to update them first. It also properly handles sources which use GNUmakefiles instead of the more common Makefiles.
b. src2pkg automatically handles sources which must be configured using cmake
c. It also handles sources which use the 'scons' SConstruct system.
d. It also handles sources which are configured to use the 'jam' system.
e. Sources which use no configuration and contain pre-made Makefiles are also handled automatically. src2pkg can even correct the hard-coded installation paths when these are different than your default choice.
e. src2pkg also handles sources whch use the Imake system for configuration.
f. It can also automatically handle creating packages from python modules which use a setup.py script
g. And it can also automatically handle sources which are normally installed by running an install.sh script.
h. binary packages -src2pkg automatically handles the conversion of binary archives which use the .rpm or .deb suffix. When these are unpacked, src2pkg recognizes them and converts them to the Slackware- conformant format regarding placement of files and ownership and permissions of files and directories.
i. generic binary content - Some programs sucg as the Opera browser are delivered as pre-compiled generic content. src2pkg can recognize these and create a package from such content.
j. source code with no installation routine- Some sources don't come with any Makefile rule or script to do the installation for you. Many times src2pkg is able to create a package from them, finding the binaries, included documents and man-pages and packaging them for you.
k. conversion/verification of Slackware-type packages- src2pkg can be used to repackage or verify the content of packages which already are in the Slackware format. This may sound strange at first, but it can be used to verify packages made by others which you have downloaded. A couple of users have reported using src2pkg to verify packages that they have using other methods -src2pkg is able to scan the content for comnmon mistakes such as misplaced documents/manpages and also correct wrong file or directory permissions and ownership
l. perl/CPAN modules- src2pkg automatically handles perl or CPAN modules which are built using a Makefile.pl file.
src2pkg transparently handles source archives which use the 'normal' gzip or bzip2 format -that is archives with these suffixes: .tar.gz .tgz .tar.bz2 .tbz It also handles rpm-type source archives which have the .rpm suffix. This includes rpm archives which contain compressed gzip or bzip2 archives, as above, and also those which conatin a simple .tar archive or which have the sources located in an already-uncompressed directory.
It also works with binary rpm packages that have the '.rpm' suffix and debian binary packages which have the '.deb' suffix. It also recognizes Slackware packages which have the '.tgz' suffix. src2pkg first uncompresses archives and then examines the content to figure out what it is so it can decide what to do with it.
Support is also planned for '.tar.lzma' or '.tlz' archives as they are becoming more common.
src2pkg has been tested and works with the stable releases of Slackware 11.0, 12.0, 12.1, 12.2, and both 32-bit and 64-bit versions of Slackware 13.
src2pkg and trackinstall both include a 'usage' function which will print a help message to the screen. Running the command 'src2pkg –help' or 'trackinstall –help' will show the help message. You can also get slightly more detailed help by seeing the manpage for each of the programs. In a terminal, type 'man src2pkg' or 'man trackinstall' to see the man page for each program.
Other documents such as an FAQ are included with the program. Reading them will provide additional details which are not covered here.
The code itself contains many comments and explanations which are more suited to advanced users. These are found mostly in the files which contain the src2pkg functions, located in /usr/libexec/src2pkg.
Some of the basic behavior of src2pkg can be changed by editing the configuration file in /etc/src2pkg/src2pkg.conf. The file contains comments which will help you understand what can be changed and when or why you might want to do so. Note that the src2pkg.conf file is not needed for src2pkg to function properly. Most common defaults are set when src2pkg reads in the file /usr/libexec/src2pkg/DEFINES, but settings in the src2pkg.conf file will usually override these settings depending on how you specify them in the src2pkg.conf file.
You can always contact me directly for more help or if you have problems. e-mails can be sent to amigo@ibiblio.org. Be sure to include the word 'src2pkg' in the subject line so that I'll notice it. I get lots of spam e-mails so its' easy to overlook your message if it doesn't have 'src2pkg' in the subject line.
Also, many users post their questions on the official Slackware forum at linuxquestions.org. Since I am a frequent poster there you can usually get help there pretty quickly. Also there are many friendly users of src2pkg which are members of the forum and they often answer questions about src2pkg before I see the posts myself. I live in Europe so the time difference between myself and users in the Americas or Asia means that I sometimes don't see your question until the next day.