install.pl:
Consider putting perl modules in appropriate place for Homebrew if in use.

Instead of doing pre-check audit, check the specific files in the tar.

pkg_add can get a perl:util:safesysrealloc error in single-user mode on
OpenBSD.

(Done 1.9a) Add "etcdir" as a default unlock group for packages, if
present (now that syslock default config for OpenBSD locks /etc).

(Done 1.9) Fix bugs:

    use Signify.pm 1.3's named-argument calls (verify_gzip in
    verify_signature, the same change as distribute.pl, and verify for
    .grp files) and require Signify.pm 1.3. Fix two defects in
    verify_signature that made the fallback to a key other than this
    year's always fail: fileparse's return values were taken in the
    wrong order, so the second verification required a public key
    named "./"; and a header key path in /etc/signify was compared
    without fileparse's trailing slash. Packages signed with last
    year's key, an OpenBSD key, or another <domain>-<year>-pkg key in
    /etc/signify were refused since 1 January 2026. A plain/custom
    package that stops extracting part way (an entry that cannot be
    written) is now reported, recorded in CHANGELOG as partially
    installed, left in place, and makes install.pl exit 1; previously
    the files before the failing entry were installed silently and it
    said nothing could be installed. unveil: no x on the install
    locations, the install dir or /tmp (nothing is run from them), no
    unveil of sysctl (run only before pledge); comments say why
    /dev/null and /bin/pwd are unveiled.

(Done 1.8) Fix four bugs:

* A bad upgrade could destroy a working install and still report
  success. An upgrade with a malformed +CONTENTS deleted the installed
  1.0, installed nothing, and exited 0. In 1.8 it rejects the new
  package before touching the old one, and exits 255.

* New perl lib dirs were unreadable to non-root users. 1.7 created
  /usr/local/lib/site_perl with mode 0600 when the package set a
  restrictive @mode. It also gave every perl module the mode of the
  last one listed. 1.8 creates the directory 0755 and gives each
  module its own mode.

* Unmodified ${SYSCONFDIR} configs never got upgraded. The delete side
  rejected the path, so the old sample stayed put. 1.8 replaces an
  unmodified sample, and a sample you’ve edited still survives the
  upgrade.

* A FIFO in /var/install hung install.pl forever. 1.8 skips FIFOs and
  symlinks with a message.

(Done 1.7) Gracefully handle one or two component filenames (as might be observed
on macOS when not in home location), allow -k custom key specification (also for
such cases). Remove requirement for PLIST comment in packages, no longer used in
OpenBSD packages. Allow common variable substitutions in @sample lines.

(Done 1.6) Look for /var/install/<hostname> dir, and if present, use it.

(Done 1.5a) Fixed +DISPLAY hash computation bug (made 1.4 fix not work),
make pkg_info.pl more robust.

(Done 1.5) fixed +DISPLAY block (undeclared var, ->add typo),
version_gt vN comparison (also fixed in distribute.pl) macOS/@sample
absolute-path dir creation, syslock re-lock on die (END + signal
handlers), regex metachar quoting, OpenBSD version-parse fallback, and
effective-UID privilege check.

(Done 1.4) Don't print package +DISPLAY contents if prior version of package
had same +DISPLAY contents.

(Fixed 1.3b) Need chown pledge in addition to fattr to cover the chown
in Archive::Tar setting gid on files when root is not a member of gid.

(Done 1.3a) Make second signature verification also fail fast.

(DONE 1.3) Modified locking and unlocking behavior to unlock only if necessary
and to only re-lock if we did the unlock. Remove bareword filehandles (also
in pkg_info.pl).

(DONE) perl modules need to go to a different location for Linux,
probably best to go with /usr/local/lib/site_perl (do substitution
when path is /usr/local/libdata/perl5/site_perl)
Ditto for macOS, everything in macOS @INC has the perl version # in
it, best may be /Library/Perl/Updates/<version>/
(Alternatively, could leave things in place and create a hard link
in the new place.) Better is probably to extract to new place, creating
extra dir if needed, and change +CONTENTS, so that no equivalent change
need be made to minimal_pkg_delete. (DONE)

install: register the package in /var/db/pkg (DONE)
   This means it won't install again over an existing installation of the
   same version.
To also do:
* Use @sample, copy sample config files only if there isn't already one there.
  (DONE)
* If an older version of the package is installed, uninstall it but leave
  configs untouched unless it is unchanged from the original sample.
  (In +CONTENTS, file name is followed by @sha and @size and @ts (timestamp)
  that can be set by the perl utime function but should already come from
  the tar file content; @sample follows
  the example config file with path to install it, could get even more
  ambitious and look for conf basename starting with 'macOS' or 'linux' and
  installing the appropriate config based on OS instead of the default
  OpenBSD one.)
  Note: @sample could include an /etc subdir in one line and the conf file
  in the subsequent line (reportnew, rsync-tools). The second line has the
  config file name as the basename, would be good to prepend 'macos' if such
  a file exists and os=darwin, or 'linux' if a file exists and os=linux (DONE)
* pkg_info displays pkg name and first line of +DESC for all installed
  packages (DONE)
* Maybe right way to do this is create a separate pkg_add, pkg_delete,
  and pkg_info?  Or is that excessive?  It is nice to have the minimal
  capability built-in. Only really need minimal pkg_delete for updating.
(Above DONE)
* If really ambitious, add +REQUIRES and +REQUIRED_BY and manage package
  dependencies. (based on @depend, @wantlib ... catch is that on linux
  or macOS, stuff may be installed by other means, e.g., want to check
  apt installs on linux--Debian: /var/lib/dpkg/info/package-name.list (w/o
  version # in name--no version info recorded?) also package-name.md5sums
  list includes line for each dir starting at /.; md5sums includes all the
  file md5s.

Provide a way to run install without being in single-user mode if the
required unlocking is only uchg. (Maybe just a -f force option that
also passes it along to syslock/sysunlock.) (DONE)

Can install run as non-root?  The two parts that need to run as root are
the tar expansion and the pkg_add.  Well, actually all -- because it has
to run in single-user mode for immutable file systems.
