5

I am looking for a succinct howto on the basics.

3

The ubuntu packaging guide is a good introduction. The rest you can learn by studying existing packages, and reading manuals (CDBS, and of course Debian Policy). However, as directhex said, it depends a lot on the kind of package you work on.

For RPM, I liked the Mandriva wiki, and some Fedora RPM Guide and Guidelines.

3

For RPM you can start with 'Maximum RPM' (download here), which is old, but very elaborate, a good place to start learning. There is also a course on IBM DeveloperWorks, which is more of a tutorial.

Once you grasp the basics, you should try and read the packaging guidelines for Fedora or OpenSUSE (which are much alike), so you can see how packaging is actually done in real life.

I know that Ubuntu had a packagers class on IRC a while back, but I don't know about its current status. Debian (and Ubuntu) packaging tutorials are abundant out there. For Debian, too, read their packaging guidelines to see how it is actually done.

1

It is often best to learn how to package the specific type of thing you're packaging. A Mono app is very different to a Python app, and you're best if you can learn information relevant to you, first and foremost.

  • For a mono or python app I would just need to make the package dependent on the relevant mono/python packages, or am I missing something? – djp Aug 12 '10 at 21:52
  • No, but if you make those dependencies manually, you're doing it wrong. There are documented best practices on how to produce packages which go into the right place, and do the right thing, and have the right deps, and those are documents maintained by independent teams. Most Mono packages only depend on ${cli:Depends} and ${misc:Depends}, thanks to assorted automation facilities dictated in the best-practice docs – directhex Aug 20 '10 at 13:13
1

On FreeBSD, for an installed port:

cd /usr/ports/category/myport
make package

or

make package-recursive

The first one makes a package from the port while the second also includes all dependencies. Alternatively, you can gain more control by using pkg_create. Like make package it also requires the port to be installed:

pkg_create -Rb mysoftware myswpkgname

Unfortunately there is no clean and easy way to make a package without first installing it unless you delve into the nitty-gritty of ports maintenance and package creation which you can read about here. This will be necessary if you want to package something you've written yourself.

There are, however, a few alternatives to make life easier if you need to make software packages that aren't installed on your system. The first is to use a build jail. Alternatively (or concurrently), you can also just remove the software you install:

make deinstall

from the port directory, or

pkg_delete -r mypackage

which provides more control (the -r switch removes dependencies as well). See the man pages for ports, pkg_delete and pkg_create for details.

0

You should look for guides for the specific system you're packaging for. They are different and require different approaches in some cases. If there's anything in common, you'll pick it up by learning one system reasonably well. Others will be slightly easier to learn once you figure out the ways they were designed to work.

An idea worth remembering in any system, though: pristine sources and unattended builds.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.