Compare commits

...

2 Commits

Author SHA1 Message Date
John McQuah 8b6807d7f8 prt-auf: notify user about pre- or post-install scripts in test mode 2023-06-26 09:04:06 -04:00
John McQuah 7d6795728d pkgmeek: update man-page
restore a needed flag for the bsdtar command
2023-06-26 08:55:39 -04:00
3 changed files with 45 additions and 35 deletions

View File

@ -7,18 +7,20 @@ pkgmeek \- make a binary package that can be installed by pkgadd
\fBpkgmeek\fP is a tool for building \fIbinary packages\fP using the
instructions found in a CRUX ports tree. A \fIbinary package\fP is an
archive of files (.pkg.tar.gz, .pkg.tar.bz2 or .pkg.tar.xz)
that can be installed using pkgadd(8).
that can be installed using \fBpkgadd\fP(8).
In order to use pkgmeek, you must change to a directory containing a
\fIPkgfile\fP(5), which describes how the package should be built. Such
directories are typically populated over rsync, git, or http, using the appropriate
driver for \fIports\fP(8). Once a suitable \fIPkgfile\fP has been written, each time
you change some source files, you simply execute pkgmeek to bring the package up to date.
The pkgmeek program uses the last-modification times of \fIPkgfile\fP and all source files
to decide if the package needs to be updated.
directories are typically populated over rsync, git, or http, using the
appropriate driver for \fIports\fP(8). Once a suitable \fIPkgfile\fP has been
written, each time you change some source files, you simply execute pkgmeek to
bring the package up to date.
The pkgmeek program uses the last-modification times of \fIPkgfile\fP and all
source files to decide if the package needs to be updated.
Global build configuration is stored in \fI/etc/pkgmk.conf\fP, the same file that governs
the operation of \fIpkgmk\fP(8). This file is read by pkgmeek at startup.
Global build configuration is stored in \fI/etc/pkgmk.conf\fP, the same file
that governs the operation of \fIpkgmk\fP(8). This file is read by pkgmeek at
startup.
.SH OPTIONS
.TP
.B "\-i, \-\-install"
@ -40,7 +42,7 @@ Build package, ignore new files in a footprint mismatch.
Build package without checking footprint.
.TP
.B "\-uf, \-\-update\-footprint"
Update footprint and treat last build as successful.
Update footprint and treat the last build as successful.
.TP
.B "\-us, \-\-update\-signature"
Update port signature and sha256sums. Only needed after editing a
@ -59,13 +61,13 @@ Create new signature and keep existing sha256sums.
.TP
.B "\-sk, \-\-secret\-key <file>"
Use private key in <file> to sign the port. By default, the directories /etc/ports
and ~/.ssh are searched for files named $repo.sec, where $repo is the name of the port's
parent directory.
and ~/.ssh are searched for files named $repo.sec, where $repo is the name of
the port's parent directory.
.TP
.B "\-pk, \-\-public\-key <file>"
Use public key in <file> to check the signature. By default, the name of the
port's parent directory $repo is evaluated and the public key is read from /etc/ports/$repo.pub, if
it exists.
port's parent directory $repo is evaluated and the public key is read from
/etc/ports/$repo.pub, if it exists.
.TP
.B "\-ns, \-\-no\-strip"
Do not strip executable binaries or libraries.
@ -87,35 +89,38 @@ Print help and exit.
.SH DEPRECATED OPTIONS
.TP
.B "\-c, \-\-clean"
Using \fBprtwash(1)\fP to remove the built package and downloaded
Using \fBprtwash\fP(1) to remove the built package and downloaded
source files gives you the flexibility to specify exactly what you want
deleted. There is no longer a need to have this functionality included
in \fBpkgmeek\fP.
.TP
.B "\-r, \-\-recursive"
If you want to traverse the working directory for all valid port dirs
(containing a \fBPkgfile(5)\fP, .signature, and .footprint) and run
(containing a \fBPkgfile\fP(5), .signature, and .footprint) and run
\fBpkgmeek\fP in each directory found, you should write a wrapper
script instead. Putting that functionality inside \fBpkgmeek\fP itself
requires either hard-coding a specific set of flags passed to the
\fBfind(1)\fP command (such as whether to follow symlinks), or asking
\fBfind\fP(1) command (such as whether to follow symlinks), or asking
the user to supply the flags. Each of these design decisions would
fit poorly in some use cases, so recursive invocations are now the
user's responsibility.
.TP
.B "\-cm, \-\-check-md5sum, \-im, \-\-ignore-md5sum, \-um, \-\-update-md5sum"
The code to generate a listing of md5 hashes for the source files has been removed
from \fBpkgmeek\fP. Verifying the integrity of source files should be handled
by \fBsignify(1)\fP instead. If you are maintaining a personal port collection and
have not saved the signify public key in /etc/ports (corresponding private key in
~/.ssh or /etc/ports), then other users of your port collection will have no way
to ensure the integrity of the downloaded source files. Read the CRUX wiki to learn
how to configure a signify public key for your port collection.
The code to generate a listing of md5 hashes for the source files has been
removed from \fBpkgmeek\fP. Verifying the integrity of source files should be
handled by \fBsignify\fP(1) instead. If you are maintaining a personal port
collection and have not saved the signify public key in /etc/ports
(corresponding private key in ~/.ssh or /etc/ports), then other users of your
port collection will have no way to ensure the integrity of the downloaded
source files. Read the CRUX wiki to learn how to configure a signify public key
for your port collection.
.SH FILES
.TP
.B "Pkgfile"
Package build description.
Package build description. Sourced by bash before \fI/etc/pkgmk.conf\fP, so
that any variables related to the port (name, version, release) are available
for customizing the directory where the package is saved.
.TP
.B ".footprint"
Package footprint (a listing of all the files that would be unpacked from the
@ -190,7 +195,8 @@ in the local copy. See \fBPkgfile(5)\fP for more details and an example
source array.
.SH SEE ALSO
pkgmk.conf(5), Pkgfile(5), pkgadd(8), pkgrm(8), pkginfo(8), rejmerge(8), signify(1), curl(1), wget(1)
pkgmk.conf(5), Pkgfile(5), pkgadd(8), pkgrm(8), pkginfo(8), rejmerge(8),
signify(1), curl(1), wget(1)
.SH COPYRIGHT
pkgmeek contains code from:
@ -198,6 +204,6 @@ pkgmeek contains code from:
\ \ \ \(bu upkgmk (c) 2018 Fun (http://gitlab.com/therealfun)
Unifying these two code bases and eliminating awkward transitions between their radically
different styles was the work of John McQuah (2022). All code is released under the GNU General
Public License. See COPYING for more details.
Unifying these two code bases and eliminating awkward transitions between their
radically different styles was the work of John McQuah (2022). All code is
released under the GNU General Public License. See COPYING for more details.

View File

@ -9,7 +9,7 @@
main() {
######################## main routine ################################
local pkg_dir src_dir work _local_ here url u pkg_utd f DIR TARGET
local errDL=0; local errUZ=0; local BSDTAR="/usr/bin/bsdtar --format=gnutar"
local errDL=0; local errUZ=0; local BSDTAR="/usr/bin/bsdtar -a --format=gnutar"
parse_options "$@"
# Exit early if refreshing an existing sha256 manifest was requested

View File

@ -170,18 +170,17 @@ if (($action =~ /^(listinst|listorphans|dependent)/)
foreach my $k (@ok) {
$note = ($ok_pre{$k}) ? " pre: ok. " : "";
$note .= ($ok_post{$k}) ? " post: ok. " : "";
$note = ( grep /(pre|post):/, $note ) ? "($note)" : "";
print " $k $note\n";
($note) ? print " $k ($note)\n" : print " $k\n";
}
print "\n";
}
if (@ok_readme) {
print "Ports with README files:\n";
print join("\n ", @ok_readme);
print join("\n ", @ok_readme); print "\n";
}
if (@not_ok) {
print "Ports with pkgmk/pkgadd failures:\n";
print join("\n ", @not_ok);
print join("\n ", @not_ok); print "\n";
}
}
@ -804,8 +803,13 @@ sub up_inst { # returns scalar references to five arrays
$mkcmd{$t} = "echo \"skipped build (package already exists)\"";
}
if ($opkg{test} eq "yes") {
print("$t\n") if ($mkcmd{$t} !~ /skipped/);
$ok{$t}=1;
($mkcmd{$t} !~ /skipped/) or next BUILDLOG;
print("$t");
("$opkg{run_scripts} $opkg{pre_install}" !~ /yes/) or
(! -f "$pdirs{$t}/pre-install") or print(" (+pre)");
("$opkg{run_scripts} $opkg{post_install}" !~ /yes/) or
(! -f "$pdirs{$t}/post-install") or print(" (+post)");
print("\n");
next BUILDLOG;
}
if (("$opkg{run_scripts} $opkg{pre_install}" =~ /yes/) and (-f "$altroot$pdirs{$t}/pre-install")) {