pkget

Binary package manager for CRUX
git clone git://git.emmett1.my/pkget.git
Log | Files | Refs | README

pkgrepo.1 (3636B)


      1 .TH PKGREPO 1 "2026-06-11" "pkgrepo 1.0" "User Commands"
      2 .SH NAME
      3 pkgrepo \- binary package repository database generator
      4 .SH SYNOPSIS
      5 .B pkgrepo
      6 [\fB\-p\fR \fIdir\fR]
      7 [\fB\-r\fR \fIdir\fR]
      8 [\fB\-d\fR \fIfile\fR]
      9 [\fB\-e\fR \fIexts\fR]
     10 [\fB\-vh\fR]
     11 .SH DESCRIPTION
     12 \fBpkgrepo\fR reads a CRUX-style ports tree (\fBPkgfile\fR per port)
     13 and generates the two files needed by \fBpkget\fR(1) to serve as a
     14 binary package repository:
     15 .TP
     16 \fBrepo.db\fR
     17 Blank-line-separated stanzas with fields: \fBname\fR, \fBversion\fR,
     18 \fBrelease\fR, \fBfile\fR, \fBdeps\fR, \fBdesc\fR, and optionally
     19 \fBpre-install\fR and \fBpost-install\fR (base64-encoded).
     20 .TP
     21 \fBrepo.sha256\fR
     22 Lines of \fB<sha256>  <filename>\fR (two spaces), compatible with
     23 \fBsha256sum\fR(1) output.
     24 .PP
     25 Pre- and post-install scripts (\fBpre-install\fR, \fBpost-install\fR)
     26 found alongside the \fBPkgfile\fR are embedded directly in the DB
     27 stanza as base64-encoded values.  No separate script files need to
     28 be served.
     29 .SH OPTIONS
     30 .TP
     31 \fB\-p\fR \fIdir\fR
     32 Ports tree directory.  May be specified multiple times for
     33 multiple trees (space-separated).  If not set, auto-detected from
     34 \fBprt-get\fR(8) configuration (\fB/etc/prt-get.conf\fR), falling
     35 back to \fB/usr/ports\fR.
     36 .TP
     37 \fB\-r\fR \fIdir\fR
     38 Package repository directory containing built \fB.pkg.tar.*\fR files
     39 (default: \fB/var/pkg/repo\fR).
     40 .TP
     41 \fB\-d\fR \fIfile\fR
     42 Output path for the repository database (default:
     43 \fB$PKGDIR/repo.db\fR).
     44 .TP
     45 \fB\-e\fR \fIexts\fR
     46 Package file extensions to search, space-separated (default:
     47 \fB\&.pkg.tar.gz .pkg.tar.xz .pkg.tar.bz2\fR).
     48 .TP
     49 \fB\-v\fR
     50 Verbose output.  Prints each port as it is processed.
     51 .TP
     52 \fB\-h\fR
     53 Print usage and exit.
     54 .SH ENVIRONMENT
     55 .TP
     56 \fBPORTSDIR\fR
     57 Ports tree root(s), space-separated.  Must be set or auto-detected.
     58 .TP
     59 \fBPKGDIR\fR
     60 Directory containing built package files (default:
     61 \fB/var/pkg/repo\fR).
     62 .TP
     63 \fBPKGEXT\fR
     64 Package extensions to search, space-separated (default:
     65 \fB\&.pkg.tar.gz .pkg.tar.xz .pkg.tar.bz2\fR).
     66 .SH "PORTS TREE LAYOUT"
     67 The ports tree must follow standard CRUX layout:
     68 .PP
     69 .RS
     70 \fB$PORTSDIR/\fR\fIname\fR\fB/Pkgfile\fR
     71 .br
     72 \fB$PORTSDIR/\fR\fIname\fR\fB/pre-install\fR   (optional)
     73 .br
     74 \fB$PORTSDIR/\fR\fIname\fR\fB/post-install\fR  (optional)
     75 .RE
     76 .SS Pkgfile format
     77 A \fBPkgfile\fR is a shell fragment with variable assignments:
     78 .PP
     79 .RS
     80 \fBname=\fR\fIpkgname\fR
     81 .br
     82 \fBversion=\fR\fI1.2.3\fR
     83 .br
     84 \fBrelease=\fR\fI1\fR
     85 .RE
     86 .PP
     87 Metadata is read from comment annotations:
     88 .PP
     89 .RS
     90 \fB# Depends on:\fR \fIfoo bar baz\fR
     91 .br
     92 \fB# Description:\fR \fIShort description\fR
     93 .RE
     94 .PP
     95 Dependencies may be comma- or space-separated.
     96 .SH "PACKAGE FILE DISCOVERY"
     97 For each port, \fBpkgrepo\fR looks for a built package in \fBPKGDIR\fR:
     98 .IP 1. 3
     99 Exact match: \fB<name>#<version>\-<release><ext>\fR
    100 .IP 2.
    101 Fallback glob: \fB<name>#*<ext>\fR (allows rebuilt packages with
    102 different version/release).
    103 .PP
    104 Each extension in \fBPKGEXT\fR is tried in order.
    105 .SH EXAMPLES
    106 .TP
    107 Generate a repo from a ports tree:
    108 \fBpkgrepo \-p /usr/ports \-r /var/pkg/repo\fR
    109 .TP
    110 Custom output path and extensions:
    111 \fBpkgrepo \-p ./ports \-r ./repo \-d ./repo/custom.db \-e \(dq.pkg.tar.xz .pkg.tar.zst\(dq\fR
    112 .TP
    113 Multiple ports trees:
    114 \fBpkgrepo \-p \(dq/usr/ports/core /usr/ports/opt\(dq \-r /var/pkg/repo \-v\fR
    115 .SH "EXIT STATUS"
    116 .IP 0
    117 Success.
    118 .IP 1
    119 An error occurred (missing ports directory, no packages found, etc.).
    120 .SH "SEE ALSO"
    121 \fBpkget\fR(1), \fBprt\-get\fR(8), \fBpkgmk\fR(8), \fBsha256sum\fR(1)
    122 .SH NOTES
    123 Ports without a corresponding built package are skipped with a
    124 warning; they do not cause a fatal error.  A summary of skipped
    125 ports is printed at the end.