[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
slackware:package_management_hands_on [2014/02/17 06:53 (UTC)] – Work in progress kikinovak | slackware:package_management_hands_on [2014/02/20 11:42 (UTC)] (current) – [Managing package dependencies] added missing formatting codes alienbob | ||
---|---|---|---|
Line 595: | Line 595: | ||
# installpkg / | # installpkg / | ||
</ | </ | ||
+ | |||
+ | ===== Building third-party packages ===== | ||
+ | |||
+ | Slackware offers only a limited choice of packages compared to behemoth distributions like Ubuntu or Debian. More often than not, you'll want to install a package that's not provided by the distribution. In that case, what can a poor boy do? | ||
+ | |||
+ | The [[http:// | ||
+ | | ||
+ | ==== Building packages using the SlackBuilds.org scripts ==== | ||
+ | |||
+ | In the following example, we will build and install the '' | ||
+ | |||
+ | For a start, '' | ||
+ | |||
+ | < | ||
+ | # cd / | ||
+ | </ | ||
+ | |||
+ | Download the following components into this directory : | ||
+ | |||
+ | - the compressed tarball containing the scripts to build the package; | ||
+ | - the compressed source code tarball. | ||
+ | |||
+ | In our case: | ||
+ | |||
+ | < | ||
+ | # links http:// | ||
+ | </ | ||
+ | |||
+ | - In the Search field in the upper left corner of the screen, type '' | ||
+ | - Follow the '' | ||
+ | - Once you're on the '' | ||
+ | |||
+ | <note tip> | ||
+ | |||
+ | Here's our two downloaded tarballs: | ||
+ | |||
+ | < | ||
+ | # ls -l cowsay* | ||
+ | -rw-r--r-- 1 root root 15136 nov. 25 08:14 cowsay-3.03.tar.gz | ||
+ | -rw-r--r-- 1 root root 2855 nov. 25 08:14 cowsay.tar.gz | ||
+ | </ | ||
+ | |||
+ | Uncompress the tarball containing the scripts: | ||
+ | |||
+ | < | ||
+ | # tar xvzf cowsay.tar.gz | ||
+ | cowsay/ | ||
+ | cowsay/ | ||
+ | cowsay/ | ||
+ | cowsay/ | ||
+ | cowsay/ | ||
+ | cowsay/ | ||
+ | </ | ||
+ | |||
+ | Eventually, you can do a little cleanup and delete the tarball: | ||
+ | |||
+ | < | ||
+ | # rm -f cowsay.tar.gz | ||
+ | </ | ||
+ | |||
+ | Now move the source tarball to the newly created '' | ||
+ | |||
+ | < | ||
+ | # mv -v cowsay-3.03.tar.gz cowsay/ | ||
+ | « cowsay-3.03.tar.gz » -> « cowsay/ | ||
+ | </ | ||
+ | |||
+ | Here's what we have: | ||
+ | |||
+ | < | ||
+ | # tree cowsay | ||
+ | cowsay | ||
+ | |-- cowsay-3.03.tar.gz | ||
+ | |-- cowsay.info | ||
+ | |-- cowsay.SlackBuild | ||
+ | |-- cowsay.SlackBuild.patch | ||
+ | |-- README | ||
+ | `-- slack-desc | ||
+ | </ | ||
+ | |||
+ | Now '' | ||
+ | |||
+ | < | ||
+ | # cd cowsay/ | ||
+ | # ls -l cowsay.SlackBuild | ||
+ | -rwxr-xr-x 1 kikinovak users 1475 mai | ||
+ | # ./ | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | If everything goes well, the process spews out a package in ''/ | ||
+ | |||
+ | < | ||
+ | ... | ||
+ | Slackware package / | ||
+ | </ | ||
+ | |||
+ | All that's left to do is install the package using '' | ||
+ | |||
+ | < | ||
+ | # installpkg / | ||
+ | # cowsay Hi there ! | ||
+ | | ||
+ | < Hi there ! > | ||
+ | | ||
+ | \ ^__^ | ||
+ | | ||
+ | (__)\ )\/\ | ||
+ | ||----w | | ||
+ | || || | ||
+ | </ | ||
+ | |||
+ | ==== Managing package dependencies ==== | ||
+ | |||
+ | Some packages require the presence of other packages, either to build (//build dependencies// | ||
+ | |||
+ | To take an example, let's have a look at the '' | ||
+ | |||
+ | < | ||
+ | This requires: libgnomecups. | ||
+ | </ | ||
+ | |||
+ | Moreover, every script tarball contains an '' | ||
+ | |||
+ | < | ||
+ | PRGNAM=" | ||
+ | VERSION=" | ||
+ | HOMEPAGE=" | ||
+ | ... | ||
+ | REQUIRES=" | ||
+ | ... | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | |||
+ | This simply means that before we build the '' | ||
+ | |||
+ | Besides strictly required dependencies, | ||