Understanding Ports Skeleton In FreeBSD


In FreeBSD, there are two ways to install software packages: pkg and ports collection. The pkg is used to install from prebuilt binaries while the ports are compiled and install from the source of an application.

In this article, we will understand the ports skeleton and how a port or package is compiled and installed in FreeBSD.

What is ports collection

So before we discuss ports skeleton you should understand the ports collection and how ports collection is used to install packages in FreeBSD.

Ports collection in FreeBSD offers a simple way to compile and install third-party applications. It is also used to build packages that are to be installed using pkg.  Ports collection can be installed and updated using portsnap.

By default, it gets stored as the subdirectory of /usr/ports.

Now if you run the following command you will see different categories of softwares –

ls /usr/ports

 

If you move into any of these categories you will see the related software packages these packages are known as ports.

cd editors
ls | more

You can see a list of ports in the image below –

 

What is ports skeleton

In ports collection, each application subdirectory contains a set of files that tells FreeBSD how to compile and install that application, known as ports skeleton. Now if you move into any one of listed ports and run the following command you will see a set of files –

ls

Each of the ports contains the following files and directories –

Makefile –

This file contains the statements that specify how the application should be compiled and its components will be installed on a system.

distinfo –

It contains the name and checksum of the file that must be downloaded to build the port.

pkg-descr –

This file describes a port completely enough so that a user is not needed to see the documentation or visit its website.

pkg-plist –

It contains the list of all the files that will be installed by the port. This file is also called the ‘packing list’ because the package is built by packing the files listed here. It also tells the system which files to remove when the package is deinstalled.

files/ –

This directory contains patches and some other files that are required to compile and install or build an application in FreeBSD.

Some applications or ports include pkg-message and such other files to handle the special situation. These ports don’t include actual source code, which is also known as distfile. It automatically downloads the source code of a port whenever required and saves it in /usr/ports/destfiles.

Ok, that’s all for now. If you want to say something on this topic then write to us in the comments below.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.