Package Howto This HOWTO is aimed at trying to help users build packages for Slackware. It is just a rough guide and is not an all inclusive howto. To start we need to make some rules for our packages. The first is that since we are building them for others we need to pay special attention to the build. This howto shows the quick and dirty way build scripts are always the better route to take if possible. You can always go see them, most are called "program".build or Slackbuild in the source area on cdrom.com or its mirrors. Special Attentions Items: * Permissions * Dependencies * Installation Location We will cover each in detail later on. For now lets see how to make one. First step is to make a clean work area. In this work area I have a place that I do all the compiles and also a directory that I do all the installs to. For instance I have a directory called work and inside that one I have two directories one I keep my build scripts if I make them and also one for the actual install. My setup is like this: * /work (my work area) * /work/scripts (where I keep my scripts to make it easy to upgrade them if needed) * /work/builds (where I try and install the program to) I keep my scripts for several reasons, one for easy upgrade of a package should I need to build a new version and so that I can distribute them with my package. You need to be consistent with the package, for example it must be installed the exact same way as you did the first time so that upgradepkg will work with it and it will not break any other programs. Lets go through a sample build: The first step is of course get the program and unarchive it to your work area. tar xfz whatever.tar.gz. Then next step is of course to cd into the directory and check out how its configure script works. I generally do a ./configure --help and check out all the options. This helps me determine if something needs to be turned on by configure or turned off. Some programs need to know the location of files or libraries and also may need things set before the compile. This is also the time when we are going to tell it where to install to. 90% of the time you will pass it something like this: ./configure --prefix=/usr This will depend on the program of course. First we do this because if you have noticed most programs will install to /usr/local by default. We don't want this since we are going to let others use this package /usr/local is off limits basically for packages that others will be using. This is outlined in the FSB. We pass this even though we will not be installing the package there in the build process. Once we have configured it we will go ahead and compile it. Again pay attention to any requirements the program may have. If a library that it needs is not part of SL7 the package will not work for the user. Its best to do all your builds on a clean machine if possible since over time most tend to loose track of what you have installed. There are two ways to approach this problem. First is make another package that has the required library (preferred) or include the library with the package (not a good thing since it could cause problems later). Now simply type make to build the package, you need to watch the make process as well sometimes paths are hard coded into a program that may for instance have a conf file if you see it pointing to someplace besides where you told configure the prefix is you will have to go back and figure out where to change that. I have had some programs that I have had to actually change the source on just to get this to work. Once you have the program compiled well will pass it another prefix to actually put it in our build area. make install prefix=/work/builds/usr This will generally work for most programs however some will not. During the make install watch very closely make sure it all went to /work/builds/usr and not to your /usr sometimes some of it will go to one location and some to the /usr. Onc ============================================ Making packages for slack: how? Author: Luner Date: 08-26-02 03:36 I'm interested in making packages for Slackware Linux. I'm ussaly experimenting with new software and I'd be glad to share it with other people - to send it on linuxpackages.net and I have site (slackware.co.yu - Serbia Slackware) where I'm describing some program for linux (and I want to offer tgz package for slack with article). I'm doing that like this: $ mkdir ~/source $ mkdir ~/makepkg $ tar zxf source.tar.gz ~/source $ cd ~/source $ ./configure --with-options $ make $ make DESTDIR=~/makepkg install $ cd ~/makepkg $ su # makepkg pkgname.tgz # installpkg pkgname.tgz Is this correct? Reply To This Message Re: Making packages for slack: how? Author: mi Date: 08-26-02 08:03 It is correct. I usually do for example make install prefix=/home/mi/makepkg/usr instead of make DESTDIR, but I guess it works in both ways. I would just add 2 things: First, the package name should contain the version, arch and release number. And the other, it is nice to copy files like README, AUTHORS, COPYING license to /usr/doc/pkgname too. That is, when creating the 'makepkg' directory, you should create a tree .../makepkg/usr/doc/pkgname and copy any important documentation there. .misfit (@linuxbr.org)