Packaging system using Plan9 mk



$ git clone
$ su
# mk install

mkpk helper usage (for admins/users)

# mkpk update			# Pulls the MKFILESREPO repository
# mkpk fetch foo		# fetches the sources of foo to SRCBASEDIR
# mkpk build foo 		# builds the foo tarball and puts it into PKGDIR
# mkpk install foo 		# installs the built tarball
# mkpk list foo 		# lists files in the installed tarball
# mkpk info foo			# shows information about the installed tarball
# mkpk uninstall foo 		# uninstalls the package using the installed
				# tarball as a filelist
# mkpk upgrade foo		# upgrades the existing package, by running
				# fetch -> build -> uninstall -> install

With table:

$ tsvtable /pkg/pkgdb.tsv	# Displays a nicely formatted table of all
				# installed tarballs and their versions

Usage in your projects (for hackers)

$ cd /path/to/project
$ cat <<! >mkfile

# ...

<$mkpklib/		# or add your own rules

# ...


# ...
$ mk package			# creates mypackage-1.2.3.{tar.xz,sha512}
$ doas mk package-install	# installs the above to PKGDIR


Directory holding the library mkfiles. By default, /lib/mkpk.
Passed to PRoot as an argument. Defaults to -b /etc, which bind-mounts /etc when creating a package.
URL of the repository with the mkfiles with information on how to build individual packages. Defaults to galeb-mkfiles repository.
If set to 1, no directories will be bind-mounted by PRoot when creating a package.
Full name of a package. For example, gcc-12.1.0-2 or vim-9.0.135.
Base name of a package. For example, gcc or vim.
Package database; TSV file holding the names, versions and installation timestamps of all installed packages. By default, /pkg/pkgdb.tsv.
Base directory for source code. Defaults to /src.
Space-separated list of directories which are created by extracting archives.
Space-separated list of directories to be created, to which the archives are to be extracted. Useful when a source archive doesn't have a root directory like it should.
Space-separated list of directories to which the archive will be extracted. An alternative to SRCCRDIRS, when the directories already exist.
Space-separated list of directories to which the directories from SRCDIRS will be renamed after extracting source archives.
Directory holding mkfiles. By default, /src/mkfiles.
Space separated list of repository URLs holding the source code for the package.
Space separated list of tarballs (archives) with the source code of the package.


mkpk - Packaging system using Plan9 mk

Copyright (C) 2022 Страхиња Радић

This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program. If not, see

Generated by slweb © 2020-2023 Strahinya Radich.