This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature: Slackware

Sbopkg provides seamless package repository integration for Slackware

By Drew Ames on October 01, 2008 (9:00:00 PM)

Share    Print    Comments   

No Linux distribution can bundle every package that users might want, so most distros host software repositories from which users can download and install additional applications. Since 2006 Slackbuilds.org has served as a high-quality repository for Slackware users, but using it requires several steps and switching between a Web browser and a virtual terminal. Sbopkg is a new ncurses-based utility that helps users build packages from SlackBuilds.org and seamlessly integrates the repository with the operating system.

Slackbuilds.org is closest thing available to an official Slackware repository. It is administered by people on the Slackware development team and recommended by Slackware's maintainer, Patrick Volkerding, in the Slackware release notes. Sbopkg automates and streamlines the process of working with Slackbuilds.org to build packages.

To understand how sbopkg works, it is necessary to understand Slackware packages and how Slackbuilds.org works.

How Slackware packages work

If Slackware Linux has one overriding philosophy, it is transparency to users. Slackware users expect to manually edit configuration files, compile software from source, and generally take a hands-on approach to administering their systems. Conversely, using a binary package that somebody else compiled means not knowing if they used the same libraries or versions of libraries that you have installed, and not having a chance to customize compile options.

Slackware can use binary packages, but they must follow certain standards so Slackware's package management tools can use them to upgrade or remove installed applications. Therefore, Slackware developers use SlackBuild scripts to automate the process of making packages.

Slackbuild scripts are shell scripts, usually run as root, that set up a temporary build directory; configure, compile, and install the software to that directory; then use Slackware's makepkg utility to create a package. Slackware packages are gzipped tar files. The SlackBuild scripts ensure that proper configuration and compilation options are used. Makepkg ensures that when Slackware's package utilities uncompress the files into the "/" directory tree, they go into the right places with the correct permissions.

Slackbuilds.org offers SlackBuild scripts and the associated ancillary files for applications not included in Slackware's official distribution. Its goal is to "have the largest collection of SlackBuild scripts available while still ensuring that they are of the highest quality." The list of available applications ranges from high-profile ones like OpenOffice.org to more than 200 individual libraries that are dependencies for other packages.

Using the site is straightforward but time-consuming. You can either browse the repository or search for a specific package. Each package has its own page on the site, with links for downloading the source file (which is hosted on its own site, not Slackbuilds.org), and a compressed file containing the SlackBuild script, a few text files providing information on the package, and sometimes another script to be run after installation. Building a package using SlackBuild scripts requires you to:

  1. Download the SlackBuild archive and extract it into its own folder.
  2. Download the source file and put it in the same folder.
  3. Edit the SlackBuild script if necessary.
  4. Execute the SlackBuild script as the root user. At the end of the process, the completed package will usually be in the /tmp directory.
  5. Install the package.

While this process is not onerous, it does require a lot of manual work. Building a single package this way may not take much time, but the time adds up quickly when you're building a complex package that also has a lot of dependencies that need to be built.

What Sbopkg does

Sbopkg streamlines the process, automating the package creation steps. To get started with sbopkg, download either the source file or the precompiled binary from the download page of the sbopkg Web site. Sbopkg's own SlackBuild script is included in the source file. As root, install the package, then edit the /etc/sbopkg/sbopkg.conf.new file. By default it has the following options:

RSYNCMIRROR=slackbuilds.org::slackbuilds SLACKVER=12.1 LOCALREPO=${LOCALREPO:-/home/sbo} SRCDIR=${SRCDIR:-/var/cache/sbopkg} export TMP=${TMP:-/tmp/SBo} KEEPLOG=YES TERMBUILD=NO # Optional - the $OUTPUT variable is used by SlackBuild scripts only # and can be used to change the output location of compiled packages. #export OUTPUT=${OUTPUT:-/tmp}

The default values should work well for most people. I uncommented the last line and changed the output directory from /tmp to another folder I use for packages I have built.

When you are done editing, save the file as /etc/sbopkg/sbopkg.conf. Still logged in as root, start sbopkg. You should see the main menu. Select the first menu item, Rsync, which downloads a local copy of the SlackBuilds.org repository. The repository takes 11MB of disk space -- a small amount of space for the ability to build more than 1,000 packages. With this one step, all of the SlackBuild scripts and associated files, though not the source files, are downloaded and ready for use.

Sbopkg's menu-driven interface makes browsing or searching the repository as easy as using the Web site. To build a package, first navigate to that package's menu. From that menu, you have the option to view the readme, .info, slack-desc file (a brief description of the package), and the SlackBuild script. The menu also has options for editing the SlackBuild script, deleting the edited script, and building the package. If you select the option to build the package, sbopkg downloads the source file, runs the SlackBuild script (using the edited version if one exists), and then offers to install the completed package -- three steps that have to be done manually without sbopkg.

Beyond building packages, the main menu offers other options for managing SlackBuilds.org packages:

  • List installed SBo packages.
  • List potential updates to installed SBo packages.
  • View the contents of the cache directory (where source files are stored). After viewing, a second menu offers users an option to delete the source files.
  • View the permanent build log (also offering a choice to delete the log).

Keeping track of the installed third-party Slackware packages and potential updates to them is a valuable feature. Sbopkg follows Slackware (and by extension, SlackBuilds.org) convention by not offering automatic dependency checking. However, the readme files for each of the packages list dependencies, and required libraries are available in the repository.

Sbopkg has a command-line interface too. Typing sbopkg -h lists the command-line options. The CLI is nearly as easy to use as the menu-driven interface. For example, typing sbopkg -s moria searches the repository for a string matching "moria." If it finds the package, it displays the readme file, .info file, slack-desc file, and SlackBuild script piped through more. Typing sbopkg -b moria builds the package and asks if you want to install it.

Sbopkg performed nearly flawlessly in my testing. It successfully built everything I tried except for OpenOffice.org, and the problem with OpenOffice.org turned out to be a corrupt, incomplete download. If the source file is incomplete or corrupted, sbopkg fails to build the package, as it should. But I discovered a bug where sbopkg does not offer a way to clear the failed source file and try again. I reported this bug on the discussion list for sbopkg, and its author, Chess Griffin, worked to fix it immediately.

The only other hiccup I had was when I edited a SlackBuild script. I discovered that the editor defaults to vi. There is nothing wrong with vi, of course, but my fingers are used to Emacs, so I was momentarily nonplussed. The sbopkg man page anticipated my discomfort. It explains:

Certain features of sbopkg rely on outside binaries, such as a pager to view the text files when sbopkg is run from the command line, and an editor to edit the SlackBuild ... the edit SlackBuild function found when sbopkg is used with the dialog interface will look to $EDITOR and will default to 'vi' if no $EDITOR has been defined. If the user wants sbopkg to use another EDITOR, such as nano, then adding the requisite information in ~/.bashrc or other similar configuration file to export EDITOR will suffice.

Adding export EDITOR='emacs -nw' to the .bashrc file for the root user changed sbopkg's behavior, though I would prefer that the $editor variable be set in /etc/sbopkg/sbopkg.conf rather than relying on a system-wide setting.

By integrating the SlackBuilds.org repository with the operating system, sbopkg greatly streamlines building and installing third-party Slackware packages. Sbopkg is actively developed, but it is stable, powerful, and exceptionally useful already.

Drew Ames is a transportation planner in Harrisburg, Penn.

Share    Print    Comments   

Comments

on Sbopkg provides seamless package repository integration for Slackware

Note: Comments are owned by the poster. We are not responsible for their content.

Sbopkg provides seamless package repository integration for Slackware

Posted by: Anonymous [ip: 10.241.128.10] on October 02, 2008 11:05 AM
Defaulting to vi if $EDITOR or $VISUAL are not set is normal, widely accepted behaviour.

Interesting article, but one that suggests that Slackware is an OS which is stuck in the past. How does it cope with package updates (upstream security fixes etc?). Is the user notified, or is it necessary to manually check through every installed package? How does it cope with substantial (e.g. libc) updates and the resultant chaos in dependant packages?

#

Re: Sbopkg provides seamless package repository integration for Slackware

Posted by: Anonymous [ip: 70.91.34.61] on October 02, 2008 01:31 PM
You said:

"Defaulting to vi if $EDITOR or $VISUAL are not set is normal, widely accepted behaviour."

Absolutely! Which is why it's nice that the sbopkg manual explains the behavior _and_ how to do something differently.

"Interesting article, but one that suggests that Slackware is an OS which is stuck in the past. How does it cope with package updates (upstream security fixes etc?). Is the user notified, or is it necessary to manually check through every installed package? "

In some ways, Slackware is stuck in the past, but that's a conscious design decision and one that Slackware users appreciate. Package updates are straightforward: (1) check the changelog (or read your e-mail notification); (2) download the updated packages; and (3) upgrade the existing packages to the new ones.

There are a number of tools available to Slackware users for automatically checking and updating. Some people user them, others find it simpler to do it manually.

"How does it cope with substantial (e.g. libc) updates and the resultant chaos in dependant packages?"

These generally happen only with version updates -- that is, going from 11 to 12, or from 12 to 12.1. When that happens, the whole distribution is compiled against the new core utilities. Packages user compile and install that are not part of the distribution may need to be recompiled. Tools like sbopkg can help with that chore.

-Drew

#

Sbopkg provides seamless package repository integration for Slackware

Posted by: Anonymous [ip: 71.166.233.112] on October 02, 2008 03:55 PM
Since several other common utilities (for example: crontab, svn) also check $EDITOR or $VISUAL setting it to 'vim' (instead of vi which is symlinked to elvis by default) is my first order of business on any Slackware install.

Also, changing the ~/.bashrc file is not a system-wide change since it only affects one user. Making the change in /etc/profile would be a system-wide change (which would still be overridden by ~/.bashrc). You could also change the editor on a per-application basis by calling it like this:
# EDITOR="emacs" sbopkg

I completely agree with the choice to use $EDITOR instead of sbopkg.conf. Since most Slackware users would already have set their preference for text editor in their ~/.bashrc why ask them to set it again in a different location? That would be redundant and counter-intuitive to the target audience.

Also, with regard to security updates: I use slackpkg to keep up-to-date with official patches and manually update the 3rd-party packages I use I lurk several security sites almost daily so I'd like to think I'm reasonably aware of potential security threats.

#

Sbopkg provides seamless package repository integration for Slackware

Posted by: Anonymous [ip: 91.150.80.51] on October 02, 2008 04:16 PM
I agree with the previous poster.
Just FTR, exporting $EDITOR in the sbopkg.conf works

#

Sbopkg provides seamless package repository integration for Slackware

Posted by: Anonymous [ip: 192.168.20.108] on October 02, 2008 06:54 PM
Hummm, almost a emerge ....

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya