portgen(1)

portgen1

Port modules on the fly

Usage

portgen [-m makeopt] type module-name

Overview

The portgen utility creates ports for the given module-name from type module framework. The module is downloaded, analyzed and translated into a port. Any missing dependencies are handled recursively. New ports will land under ${PORTSDIR}/mystuff. The PORTSDIR value will be taken from current user environment, and defaults to /usr/ports.

The options are as follows:

-m makeopt

Pass makeopt to make(1) invocations while resolving missing dependencies, mostly useful with ‘FETCH_PACKAGES=’ to avoid building everything from scratch.

The portgen utility currently supports the following type values:

p5

for Perl modules on CPAN.

ruby

for Ruby gems.

go

for Go modules.

A go module may be used with an @version suffix to specify a tag or branch to port. The default suffix is @latest, which is interpreted as the latest release.

The following packages must be installed prior to the invocation of portgen:

sqlports

p5-DBI

p5-DBD-SQLite

Exit status

The portgen utility exits 0 on success, and >0 if an error occurs.

Examples

The following command will download the latest version of Config::AutoConf from CPAN, parse it and create a port for it:

portgen p5 Config::AutoConf

Caveats

Not every module could be converted to a port.

Releases

18 releases since OpenBSD 6.4; the text changed 6 times.

  1. 6.4–6.5
  2. 6.6
  3. 6.7
  4. 6.8
  5. 6.9–7.0
  6. 7.1
  7. 7.2–8.0

-m since OpenBSD 7.1.

History

The portgen utility first appeared in OpenBSD 5.9 as a result of Google Summer of Code 2015.

Authors

Giannis Tsaraias ⟨[email protected]⟩

From man 8.0-current-20261101 in OpenBSD 8.0-current (2026-11-01). Parsed by carta from the page's mdoc source.