Compare commits

..

2 Commits

Author SHA1 Message Date
8b6807d7f8 prt-auf: notify user about pre- or post-install scripts in test mode 2023-06-26 09:04:06 -04:00
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 \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 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) 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 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 \fIPkgfile\fP(5), which describes how the package should be built. Such
directories are typically populated over rsync, git, or http, using the appropriate directories are typically populated over rsync, git, or http, using the
driver for \fIports\fP(8). Once a suitable \fIPkgfile\fP has been written, each time appropriate driver for \fIports\fP(8). Once a suitable \fIPkgfile\fP has been
you change some source files, you simply execute pkgmeek to bring the package up to date. written, each time you change some source files, you simply execute pkgmeek to
The pkgmeek program uses the last-modification times of \fIPkgfile\fP and all source files bring the package up to date.
to decide if the package needs to be updated. 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 Global build configuration is stored in \fI/etc/pkgmk.conf\fP, the same file
the operation of \fIpkgmk\fP(8). This file is read by pkgmeek at startup. that governs the operation of \fIpkgmk\fP(8). This file is read by pkgmeek at
startup.
.SH OPTIONS .SH OPTIONS
.TP .TP
.B "\-i, \-\-install" .B "\-i, \-\-install"
@ -40,7 +42,7 @@ Build package, ignore new files in a footprint mismatch.
Build package without checking footprint. Build package without checking footprint.
.TP .TP
.B "\-uf, \-\-update\-footprint" .B "\-uf, \-\-update\-footprint"
Update footprint and treat last build as successful. Update footprint and treat the last build as successful.
.TP .TP
.B "\-us, \-\-update\-signature" .B "\-us, \-\-update\-signature"
Update port signature and sha256sums. Only needed after editing a Update port signature and sha256sums. Only needed after editing a
@ -59,13 +61,13 @@ Create new signature and keep existing sha256sums.
.TP .TP
.B "\-sk, \-\-secret\-key <file>" .B "\-sk, \-\-secret\-key <file>"
Use private key in <file> to sign the port. By default, the directories /etc/ports 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 and ~/.ssh are searched for files named $repo.sec, where $repo is the name of
parent directory. the port's parent directory.
.TP .TP
.B "\-pk, \-\-public\-key <file>" .B "\-pk, \-\-public\-key <file>"
Use public key in <file> to check the signature. By default, the name of the 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 port's parent directory $repo is evaluated and the public key is read from
it exists. /etc/ports/$repo.pub, if it exists.
.TP .TP
.B "\-ns, \-\-no\-strip" .B "\-ns, \-\-no\-strip"
Do not strip executable binaries or libraries. Do not strip executable binaries or libraries.
@ -87,35 +89,38 @@ Print help and exit.
.SH DEPRECATED OPTIONS .SH DEPRECATED OPTIONS
.TP .TP
.B "\-c, \-\-clean" .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 source files gives you the flexibility to specify exactly what you want
deleted. There is no longer a need to have this functionality included deleted. There is no longer a need to have this functionality included
in \fBpkgmeek\fP. in \fBpkgmeek\fP.
.TP .TP
.B "\-r, \-\-recursive" .B "\-r, \-\-recursive"
If you want to traverse the working directory for all valid port dirs 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 \fBpkgmeek\fP in each directory found, you should write a wrapper
script instead. Putting that functionality inside \fBpkgmeek\fP itself script instead. Putting that functionality inside \fBpkgmeek\fP itself
requires either hard-coding a specific set of flags passed to the 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 the user to supply the flags. Each of these design decisions would
fit poorly in some use cases, so recursive invocations are now the fit poorly in some use cases, so recursive invocations are now the
user's responsibility. user's responsibility.
.TP .TP
.B "\-cm, \-\-check-md5sum, \-im, \-\-ignore-md5sum, \-um, \-\-update-md5sum" .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 The code to generate a listing of md5 hashes for the source files has been
from \fBpkgmeek\fP. Verifying the integrity of source files should be handled removed from \fBpkgmeek\fP. Verifying the integrity of source files should be
by \fBsignify(1)\fP instead. If you are maintaining a personal port collection and handled by \fBsignify\fP(1) instead. If you are maintaining a personal port
have not saved the signify public key in /etc/ports (corresponding private key in collection and have not saved the signify public key in /etc/ports
~/.ssh or /etc/ports), then other users of your port collection will have no way (corresponding private key in ~/.ssh or /etc/ports), then other users of your
to ensure the integrity of the downloaded source files. Read the CRUX wiki to learn port collection will have no way to ensure the integrity of the downloaded
how to configure a signify public key for your port collection. source files. Read the CRUX wiki to learn how to configure a signify public key
for your port collection.
.SH FILES .SH FILES
.TP .TP
.B "Pkgfile" .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 .TP
.B ".footprint" .B ".footprint"
Package footprint (a listing of all the files that would be unpacked from the 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. source array.
.SH SEE ALSO .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 .SH COPYRIGHT
pkgmeek contains code from: pkgmeek contains code from:
@ -198,6 +204,6 @@ pkgmeek contains code from:
\ \ \ \(bu upkgmk (c) 2018 Fun (http://gitlab.com/therealfun) \ \ \ \(bu upkgmk (c) 2018 Fun (http://gitlab.com/therealfun)
Unifying these two code bases and eliminating awkward transitions between their radically Unifying these two code bases and eliminating awkward transitions between their
different styles was the work of John McQuah (2022). All code is released under the GNU General radically different styles was the work of John McQuah (2022). All code is
Public License. See COPYING for more details. released under the GNU General Public License. See COPYING for more details.

View File

@ -9,7 +9,7 @@
main() { main() {
######################## main routine ################################ ######################## main routine ################################
local pkg_dir src_dir work _local_ here url u pkg_utd f DIR TARGET 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 "$@" parse_options "$@"
# Exit early if refreshing an existing sha256 manifest was requested # 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) { foreach my $k (@ok) {
$note = ($ok_pre{$k}) ? " pre: ok. " : ""; $note = ($ok_pre{$k}) ? " pre: ok. " : "";
$note .= ($ok_post{$k}) ? " post: ok. " : ""; $note .= ($ok_post{$k}) ? " post: ok. " : "";
$note = ( grep /(pre|post):/, $note ) ? "($note)" : ""; ($note) ? print " $k ($note)\n" : print " $k\n";
print " $k $note\n";
} }
print "\n"; print "\n";
} }
if (@ok_readme) { if (@ok_readme) {
print "Ports with README files:\n"; print "Ports with README files:\n";
print join("\n ", @ok_readme); print join("\n ", @ok_readme); print "\n";
} }
if (@not_ok) { if (@not_ok) {
print "Ports with pkgmk/pkgadd failures:\n"; 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)\""; $mkcmd{$t} = "echo \"skipped build (package already exists)\"";
} }
if ($opkg{test} eq "yes") { if ($opkg{test} eq "yes") {
print("$t\n") if ($mkcmd{$t} !~ /skipped/); ($mkcmd{$t} !~ /skipped/) or next BUILDLOG;
$ok{$t}=1; 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; next BUILDLOG;
} }
if (("$opkg{run_scripts} $opkg{pre_install}" =~ /yes/) and (-f "$altroot$pdirs{$t}/pre-install")) { if (("$opkg{run_scripts} $opkg{pre_install}" =~ /yes/) and (-f "$altroot$pdirs{$t}/pre-install")) {