mkpk

Packaging system using Plan9 mk

Manual

See https://strahinja.srht.site/man/mkpk/mkpk.8.html.

Prerequisites

Installation

$ git clone https://git.sr.ht/~strahinja/mkpk
$ 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=/lib/mkpk
<$mkpklib/defaults.mk

# ...

<$mkpklib/standard.mk		# or add your own rules

# ...

<$mkpklib/package.mk

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

Environment

mkpklib
Directory holding the library mkfiles. By default, /lib/mkpk.
BINDDIRS
Passed to PRoot as an argument. Defaults to -b /etc, which bind-mounts /etc when creating a package.
MKFILESREPO
URL of the repository with the mkfiles with information on how to build individual packages. Defaults to galeb-mkfiles repository.
NOBINDDIRS
If set to 1, no directories will be bind-mounted by PRoot when creating a package.
PKG
Full name of a package. For example, gcc-12.1.0-2 or vim-9.0.135.
PKGBASE
Base name of a package. For example, gcc or vim.
PKGDB
Package database; TSV file holding the names, versions and installation timestamps of all installed packages. By default, /pkg/pkgdb.tsv.
SRCBASEDIR
Base directory for source code. Defaults to /src.
SRCDIRS
Space-separated list of directories which are created by extracting archives.
SRCCRDIRS
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.
SRCEXDIRS
Space-separated list of directories to which the archive will be extracted. An alternative to SRCCRDIRS, when the directories already exist.
SRCTODIRS
Space-separated list of directories to which the directories from SRCDIRS will be renamed after extracting source archives.
SRCMKFILES
Directory holding mkfiles. By default, /src/mkfiles.
SRCREPOS
Space separated list of repository URLs holding the source code for the package.
SRCTARBALLS
Space separated list of tarballs (archives) with the source code of the package.

License

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 https://www.gnu.org/licenses/.

Generated by slweb © 2020-2024 Strahinya Radich.