Text Document Icon mports Documentation


mports is the MidnightBSD ports collection. It contains hundreds of ported software applications ready to use on MidnightBSD. mports simplifies installing software packages on your desktop system.

In the future, mports will also include precompiled packages to speed up the installation process. An automated software update system is planned. There are a few precompiled software packages on the MidnightBSD FTP server.

Using mports

You can install mports during the installation of MidnightBSD. If you forgot to do so, you may download the latest mports by using svn. You can use
cd /usr
svn co http://svn.midnightbsd.org/svn/mports/trunk mports

Updating mports periodically is recommended. New versions of software and additional software are added all the time. Keeping up to date will help you maintain best security practices and possibly give you new features and functionality or bug fixes.

To install an mport, simply do the following:
cd /usr/mports
Pick a category from the file system list or use make search key=term where term is what you want to search for. Once you have the mport, you can type make install clean to install it and clean up the compiling mess.

It is recommended that you install mports/sysutils/portupgrade at your convenience. It will allow you to upgrade mports and install mports much easier. You can simply type portinstall portname to install a port called portname. It can speed up the process considerably.

To uninstall a port, simply goto the directory of the mport and type make deinstall

If you prefer to use packages, consult the mport command. It can install packages via mport install or remove packages via mport delete. You can use mport list to see what is currently installed.


MidnightBSD uses the FreeBSD ports collection. Over time it has begun to diverge. Several projects have been influential in the design of the mports system, notably OpenBSD.

The initial import of mports was done by our security officer, archite. mports maintainership was transfered to wintellect after some initial work by laffer1. A massive restructuring of the mports system was done by Chris Reinhardt (ctriv). Now the entire system creates ports in a staging directory called the fake dir. A port is built in the working directory work/ inside the ports directory. Then during the faking stage (before install occurs) it is "installed" into the fake dir which is a combination of the word fake the target arch and a few other nits. It is the job of the mports maintainer to fix any bugs with this faking procedure. It is more work up front, but it means that all ports are installed from packages and therefore all packages must work. This is quite innovative compared to the FreeBSD maybe it works as a package approach, but other projects like OpenBSD have been doing something similar for quite some time.

Currently, all commiters have access to add and modify mports. You may contact any commiter about mports problems or additions. For infrastructure questions or concerns, direct them to ctriv. (use the alias at midnightbsd.org)

Differences Between FreeBSD's ports and mports

FreeBSD's ports install directly into the system at install time, mports however uses a process called "fake" to make a package and then installs that package. This simplifies the logic of the ports system. Code does not need to be duplicated for installation from the port and installation from the package. The change is very recent, and at this time we are still testing the port tree to insure that all ports function properly under the "fake" system.

For information on common reasons for "fake" errors, see the fake transition page.

Mport is endeavoring to be more standardized than the FreeBSD ports tree. See the policy page for information on current port standards.

MidnightBSD introduced the LICENSE variable years before FreeBSD's new LICENSE framework for ports. We got the idea from some of the other BSD projects. Until 2014, mports did not handle multiple license types, but rather we set agg to indicate it was under several liceness. Licenses are indexed into the build cluster software so that mport tools can later display licensing information with mport info pkgname. License is also used to exclude files during the "bless" of a magus run from the FTP server.

FreeBSD introduced support for multiple licenses (both dual license and aggregate/multi) with their ports tree. Recently, we added preliminary support for this to mport tools and mports.

User Configurable License Settings (/etc/make.conf)
Variable Description
LICENSES_ACCEPTED Accepted licenses
LICENSES_REJECTED Rejected licenses
LICENSES_ASK Require explicit user agreement for licenses accepted by default, for example most common licenses in mports/components/licenses.db.mk
NO_LICENSES_DIALOGS Disable dialog menus (GUI), and use the text interface
NO_LICENSES_INSTALL Disable installation of (all) license files. These will possibly be required for future features (specially scripts or tools outside the ports systems).
Port License Settings (Single License)
Variable Description
LICENSE Code of license (short name; only letters, numbers and underscore)
LICENSE_PERMS Permissions (see below)
LICENSE_GROUPS Groups the license belongs to

Full license name (for the reports)
LICENSE_FILE Full path to license (or use LICENSE_TEXT)
LICENSE_TEXT Text to use as a license, for referencing when not available
LICENSE_DISTFILES Name of licensed files (defaults to ${_DISTFILES})
Variable Description
dist-mirror Free redistribution of distfile (like FTP mirroring; opposite of RESTRICTED)
dist-sell Selling of distfile (like in CD-ROM; opposite of NO_CDROM)
pkg-mirror Free redistribution of package (like FTP upload; opposite of NO_PACKAGE)
pkg-sell Selling of package (like in CD-ROM; opposite of NO_CDROM)
auto-accept If present the license is accepted by default, without agreement
(at least LICENSES_ASK is defined by the user)

Note that permissions can be denied by prefixing no-, for example no-dist-sell.

LICENSE_COMB is set to define multi or dual license. This replaces our old approach of using agg. Ports should be updated to reflect this change.

Future Directions

The libmport and mport tools were imported into 0.3-CURRENT for testing. As of 0.4-CURRENT (os version 4004), mport tools support fetching packages, updating, upgrade of all system packages, deleting packages, listing packages needing to be updated, search, and info on a package. The new system will allow us to update packages after a release. As of 0.5, the default package manager is mport. Please consult the man page for more information.