Previous Section  < Day Day Up >  Next Section

Recipe 4.5. Using CheckInstall to Create Packages from Sources

4.5.1 Problem

You want to create Slackware, Red Hat, or Debian packages from source code, because an application that you want to install does not come in the package you want. You have read up on building packages, and it's very complicated. Isn't there an easier way?

4.5.2 Solution

Use CheckInstall. Again using Joe's Own Editor in this example, on Debian, do the following:

# mkdir /doc-pak

# tar zxvf joe-2.9.8.tar.gz

# cd joe-2.9.8

# ./configure

# make

# checkinstall -D

CheckInstall replaces make install, so it must run from the root of the source tree. Follow the prompts and do what they say. It will build and install a .deb, as we can verify:

$ dpkg -l | grep joe

ii  joe          2.9.8-1      joe's own editor, my fave

And that's it. It's installed and ready to go to work. A copy of the package will remain in the source directory.

To build a Slackware package, use:

# checkinstall -S

To build an RPM package, use:

# checkinstall -R

4.5.3 Discussion

The doc-pak directory is where CheckInstall places READMEs and other program documentation. If you don't create the doc-pak directory, CheckInstall asks if you want to build a default documentation directory. If you say no, your package will have no documentation.

CheckInstall uses the native installation program's package manager: RPM on Red Hat, installpkg on Slackware, .apt on Debian. To remove a CheckInstall package, simply use your system's package manager.

CheckInstall supports any install scripts. For example:

# checkinstall -D make install_packages

# checkinstall -R make modules_install

# checkinstall -S install.sh

# checkinstall -D setup

Remember to study the README of the program you're installing, and any other included documentation. Not all source packages use the traditional configure-make-make install dance. Some use other installation scripts, as in the example above.

CheckInstall does not yet allow creating a package without automatically installing it, though this may change in future releases.

4.5.4 See Also

    Previous Section  < Day Day Up >  Next Section