makepack users guide

Contents

Requirements

In short, a full standard Slackware Installation should be able to run makepack to install any software described with a makepack rule.

The Makefile itself of makepack needs a few tools: Different software will also need different compilers like gcc, g++, perl or python for successful installation. If a Slackware installation is unable to use makepack it is probably because some development packages was omitted during installation and such an installation would also fail to compile software without makepack.

Configuration

Settings.mk

Gnu Make does all the work of makepack by using Makefile which includes Settings.mk and different rule files for different software to install. The file Settings.mk controls the behavior of makepack. It contains lines which can be changed for altering configurations, but it also contains some lines which are not supposed to be altered, they are only there to help users understand how to write their own rule files. The Makefile is not supposed to be changed and adding support for new software means adding a new rule file. At the end of the file there are the following variables to change:
VariableDefault valueDescription
PREFIX/usr/local Prefered path for software installation. Be aware that not all rule files will care about this variable. Some software like python packages might install into a hardcoded path like /usr/lib/python2.3/site-packages/.
SOURCE_DIRsource Where downloaded source packages shall be placed.
BUILD_DIRbuild Which directory to use for compiling software. Depending on the setting of CLEAN_BUILD this directory might be considered a directory for temporary files.
PACKAGE_DIRpackages Where the created Slackware packages will be placed.
LOG_DIR/var/log/packages Where Slackware keeps its logs of installed software. You are not supposed to change this variable unless you have done something strange to your Slackware installation.
ARCHi486 The arch part of the package name. It might also affect the compilation flags variable CFLAGS. As this variable is set with ?= the setting can be overriden by setting an environment variable before running make.
PKG_RELEASEmp The build number part of the package name.
CLEAN_BUILDTrue If this variable is set the build directory with the compiled sources will be removed after software installation. This is the default and is a good choice as it saves disk space. If you are creating your own rule files and want to debug the compilation you it might help to comment out this variable from Settings.mk.
CFLAGS-O2 Optimization flags for C programs. This variable might be altered by the ARCH variable and it might also be overridden by some rule files.
CREATE_PKGsudo checkinstall $(CHECKINSTALL_FLAGS) How to create a Slackware package during software installation. The default is to use sudo to avoid having to run all the steps of makepack as root.
INSTALL_PKGsudo installpkg How to install a Slackware package. The default is to use sudo to avoid having to run all the steps of makepack as root.
The default settings in Settings.mk are supposed to work for most people.

Environment variables

ARCH These environment variable can be used to override the value in Settings.mk. Example for how to set a variable:
In bashexport ARCH=pentium4
In tcshsetenv ARCH pentium4
PREFIX

sudo

The use of the root account should be minimized to avoid bad consequences from mistakes and security issues. However, installing software system wide usually needs root privileges. It would be possible to run the makepack Makefile as root, but as root privileges are not needed to download and compile software it is recomended to run makepack as a normal user. By configuring sudo to allow that normal user to run checkinstall and installpkg makepack gets root privileges only when needed.

It is important to note that a user given root privileges to run checkinstall and installpkg really should be a trusted user. The programs checkinstall and installpkg are able to overwrite any file and to run any command.

If you have a trusted user who has the username "spock" you should add the following two lines to /etc/sudoers by using the visudo command:

spock ALL=(ALL) NOPASSWD: /usr/sbin/checkinstall
spock ALL=(ALL) NOPASSWD: /sbin/installpkg
    
Using visudo is like using the vi editor. If you haven't used vi before you should do some reading first. For a beginner it can even be hard to get out of vi. You will find many good texts about vi at Google.

Usage

By calling make with a target you will get makepack to do its work. The following targets are supported:
TargetDescription
make helpShows this help about targets
make listWill list the software of all rule files
make program download Will download the source of program all all its dependencies without compiling or installing anything.
make program install Will check if program is already installed. Otherwise its source will be downloaded if necessary and program will be unpacked, compiled and installed.
make program check Will check if program or any of its dependencies are already installed.
make all download Will download the source of all software described by rule files.
make all install Will install all software described by rule files which are not already installed.
make clean Will remove any files in the build directory. However, downloaded source archives or created packages are not removed. By default, it is not necessary to do "make clean" as CLEAN_BUILD is set in Settings.mk.