BSD Packaging Systems
- The Persistence of Porting
- FreeBSD Ports and Packages
- OpenBSD Ports and Packages
- NetBSD pkgsrc
- Summary
The Persistence of Porting
In a previous article, I covered the differences between the major BSDs, but glossed over an area where the BSD family has traditionally excelled: package management. Each member of the BSD family has a slightly different approach in this area, although they share common themes.
In the early days of UNIX, each vendor would extend the code in its own way. Because many of these extensions were useful, they would be used by developers. Unfortunately, when those developers tried to run their code on another flavor of UNIX, they would find that it didn’t have the required features, or implemented features with a slightly different interface. Instead of the "write once, compile anywhere" vision that UNIX vendors of the time were selling, there was a "write once, port everywhere" feeling.
The situation has improved significantly over the last decade or so with the development of UNIX standards. The nice thing about standards, as the saying goes, is that there are so many to choose from. In the UNIX world, the two most popular are POSIX and the Single UNIX Specification. Most UNIX-like systems come close to compliance with these standards, although there are usually small gaps.
Because the gaps in support are not in the same place, some porting is still required. This situation is exacerbated by developers who still rely on operating system–specific features, such as detecting processor type by reading /proc/cpuinfo on Linux. Ideally, the fixes would be incorporated by the project’s developer. Unfortunately, this process usually takes time, so it’s common for each package to have a set of patches associated with it that allow it to run on (or integrate better with) the target operating system.
In addition to managing the application of patches, a good packaging system should also handle the installation of dependencies. All of the BSD ports systems do this, as well as providing methods for uninstalling packages.
This article discusses the three major porting systems:
- FreeBSD ports and packages
- OpenBSD ports and packages
- NetBSD’s pkgsrc