MirPorts: The MirOS Ports Framework

Sponsored by
HostEurope Logo

MirPorts: The MirOS Ports Framework

⚠ This page contains old, outdated, obsolete, … historic or WIP content! No warranties e.g. for correctness!

(The official MirPorts homepage can always be reached at http://mirbsd.de/ports which redirects to a "known working" mirror.)

On this page:


MirPorts—a derivative of the OpenBSD ports tree—is our solution for installing additional software packages not contained in the base system.

Both MirOS and MirPorts should put most of the “dotfiles” in users’ home directories in a single directory named “.etc”. You can have your own programs and scripts in ~/.etc/bin.

MirPorts is portable. It has support for the following operating systems:

Even on stable releases, using the newest MirPorts version is recommended. For all platforms, we are still searching for developers as well as testers to build packages and to submit bug reports.

Set-up instructions

Please refer to the installer’s manual page for an invocation reference of the Setup.sh script.

System-wide installation

The system-wide setup is usually carried out by a user who can run commands as root by using sudo(8).

  1. First, MirPorts must be checked out from CVS into either /usr/ports or /usr/mirports. If you are on MirOS and installed the ports10.ngz set, you can skip this step, and you will find the sources unpacked in /usr/ports. In the following commands, replace “mirports” by “ports” to use the /usr/ports directory.
    $ cd /usr
    $ sudo mkdir mirports
    $ sudo chown 2999 mirports
    $ cvs -d _anoncvs@anoncvs.mirbsd.org:/cvs co -d mirports ports
  2. Now you need to run the setup script. It will automatically use sudo(8) to gain root privileges where necessary. If the -e flag is given below, the configuration files will be placed inside /usr/mpkg/etc instead of /etc. If you do not have mksh, replace it by bash.
    $ cd /usr/mirports
    $ mksh Setup.sh -e

    On MirOS, you can skip this step if you installed the pkgutl10.ngz set during the installation. If not, then run

    $ cd /usr/ports ; make setup

    instead of the commands above.

  3. On non-MirOS systems, to use MirPorts, some environment variables (PATH etc.) have to be set. For Bourne shells (mksh, bash or similar), run the following command:
    $ . /usr/mpkg/db/SetEnv.sh

    and add it to your ~/.profile or /etc/profile (for all users). For tcsh, the command is

    $ source /usr/mpkg/db/SetEnv.csh

    To make the changes permanent, the command must be added to ~/.tcshrc.

Installation as an unprivileged user

For an unprivileged installation, the same three steps as above are necessary. In the Setup.sh invocation, the -u flag is used to select an unprivileged setup, and the target directory is selected with the -l flag. This directory is usually located in your home directory and will contain all installed packages, configuration files and the package database. In the following, we will use for this directory.

  1. Checkout:
    $ cvs -d _anoncvs@anoncvs.mirbsd.org:/cvs co -d mirports ports
  2. Setup:
    $ cd ports
    $ mkdir -p /bin
    $ MKSH=/bin/mksh bash Setup.sh -uel 
  3. Set environment variables:
    $ . /db/SetEnv.sh

    Or for tcsh:

    $ source /db/SetEnv.csh

Platform-specific notes


To install MirPorts system-wide on MirOS BSD, just execute

 $ cd /usr/ports
 $ make setup

as an unprivileged user. The sudo command is invoked automatically to gain root privileges where needed.

Note: If you installed the pkgutl10.ngz dist set, do not do this, because that set is basically the result of running that command, tarred up.

Mac OS X

Before using MirPorts, you need to install the Developer Tools from the separate DVD provided, as well as the X11 package from the installation DVD.


MidnightBSD support is experimental, and it currently lacks support for the “i386-unknown-midnightbsd0.2” gnutarget in most applications. This should be unproblematic due to MirLibtool.

You must install perl from mports before setting up MirPorts, as parts of the infrastructure are written in Perl.

Note that the MirPorts Framework always uses the MirBSD Korn Shell internally to run command lines embedded in the Makefiles, configure scripts, etc. Since mksh lives as /bin/mksh in MidnightBSD, there is no need to install it; however, if a more recent version is available, you can upgrade it from shells/mksh; export MKSH=/mksh then (or overwrite the system’s copy).


Using MirPorts on OpenBSD is currently untested but should work well in principle. It does not conflict with the OpenBSD ports tree. You can use ksh for the Setup.sh invocation in step 2 above.

If you use MirPorts on OpenBSD and are willing to help us test, please drop an e-mail to the miros-discuss@ mailing list. Thanks!

Using the MirPorts Framework

The directories below /usr/ports are the categories for ports. Each port is contained in its own subdirectory and contains a Makefile. Just executing mmake install in such a directory will download the source code, compile it, create a binary package and install it. Dependencies are automatically installed when necessary. Some ports exist in different “flavours”, e.g. with or without X support.

For example, to install the “joe” port from the “editors” category, use the following commands:

 $ cd /usr/ports/editors/joe
 $ mmake install clean

Always use mmake instead of make for invoking MirPorts commands. Some other useful commands are:

MirBSD Logo