Handbook3-7-Ports: add an anchor for non-root port building

This commit is contained in:
John McQuah 2022-08-05 13:32:31 -04:00
parent 71c841f91d
commit 06670c0111
1 changed files with 61 additions and 48 deletions

View File

@ -85,72 +85,77 @@ The output reveals which files are downloaded, updated and deleted.
!!! Listing Local Ports
When the local ports structure has been updated the directory %fn%/usr/ports/%%
will contain two package categories, %fn%core%% and %fn%opt%%. Under each of
will contain at least two collections, %fn%core%% and %fn%opt%%. Under each of
these directories you will find ports. You can simply browse around in the
directory structure to find out which ports are available.
$ cd /usr/ports/core/
$ ls
acl/ gperf/ openssh/
attr/ grep/ openssl/
autoconf/ groff/ patch/
automake/ gzip/ pciutils/
bash/ hdparm/ perl/
bc/ httpup/ pkgconf/
binutils/ iana-etc/ pkgutils/
bison/ inetutils/ ports/
bzip2/ iproute2/ procps/
ca-certificates/ iptables/ prt-get/
COPYING kbd/ psmisc/
COPYRIGHT kmod/ python3/
coreutils/ less/ rc/
cpio/ libarchive/ rdate/
curl/ libcap/ readline/
dash/ libdevmapper/ rsync/
db/ libffi/ sed/
dcron/ libgmp/ shadow/
dhcpcd/ libmpc/ signify/
diffutils/ libmpfr/ sqlite3/
e2fsprogs/ libnsl/ start-stop-daemon/
ed/ libpcre/ sudo/
elfutils/ libpipeline/ sysfsutils/
eudev/ libtirpc/ sysklogd/
exim/ libtool/ sysvinit/
expat/ libusb/ tar/
file/ linux-pam/ time/
filesystem/ lzo/ tzdata/
findutils/ m4/ usbutils/
flex/ make/ util-linux/
gawk/ man-db/ vim/
gcc/ man-pages/ wget/
gdbm/ mlocate/ which/
gettext/ mpdecimal/ xz/
glibc/ nasm/ zlib/
glibc-32/ ncurses/ zstd/
acl/ httpup/ nftables/
attr/ iana-etc/ ninja/
autoconf/ inetutils/ openssh/
automake/ iproute2/ openssl/
bash/ iptables/ patch/
bc/ jansson/ pciutils/
binutils/ jsoncpp/ perl/
bison/ kbd/ pkgconf/
bzip2/ kmod/ pkgutils/
ca-certificates/ less/ ports/
cmake/ libarchive/ procps/
coreutils/ libcap/ prt-get/
cpio/ libdevmapper/ psmisc/
curl/ libedit/ python3/
dash/ libffi/ python3-setuptools/
db/ libgmp/ rc/
dcron/ libmnl/ rdate/
dhcpcd/ libmpc/ readline/
diffutils/ libmpfr/ rhash/
dumb_runtime_dir/ libnftnl/ rsync/
e2fsprogs/ libnghttp2/ sed/
ed/ libnsl/ shadow/
elfutils/ libpcre/ signify/
eudev/ libpcre2/ sqlite3/
exim/ libpipeline/ start-stop-daemon/
expat/ libtirpc/ sudo/
file/ libtool/ sysfsutils/
filesystem/ libusb/ sysklogd/
findutils/ libuv/ sysvinit/
flex/ linux-pam/ tar/
gawk/ lzlib/ time/
gcc/ lzo/ tzdata/
gdbm/ m4/ usbutils/
gettext/ make/ util-linux/
glibc/ man-db/ vim/
glibc-32/ man-pages/ which/
gperf/ meson/ xz/
grep/ mlocate/ zlib/
groff/ mpdecimal/ zstd/
gzip/ nasm/
hdparm/ ncurses/
You can also use '''ports''' with the '''-l''' option to list all local ports. Example:
$ ports -l
core/acl
core/attr
core/autoconf
core/automake
core/bash
core/bc
core/bin86
core/bindutils
core/binutils
...
If you are looking for a specific package, it might be easier to use this
approach (e.g. @@ports -l | grep sendmail@@) to find out if the package is
available and if so in which category it is located.
If you are looking for a specific package, a command like @@ports -l | grep sendmail@@
provides a straightforward way to find out if the package is available and if so
in which collection it is located. More complicated searches (eg., based on
footprint, description, or maintainer) can be performed using @@prt-get@@.
!!! Listing Version Differences
To find out if the ports structure carries ports that are different (likely
newer) compared to the versions currently installed you can use the option
'''-d'''. If version differences are found, the output from the above command
could look something like this:
newer) compared to the versions currently installed, you can use the option
'''-d'''. If differences are found (in either 'version' or 'release'), the
output from the above command could look something like this:
$ ports -d
Collection Name Port Installed
@ -173,7 +178,7 @@ the desired port directory and use '''pkgmk''' to build it. Example:
The '''-d''' option means download missing source files and tells '''pkgmk''' to
download the source(s) specified in the Pkgfile (in case the source is already
downloaded this option is ignored). When the download is completed the package
downloaded, this option is ignored). When the download is completed the package
will be built. If the package was built successfully you can use '''pkgadd''' to
install or upgrade it. Example:
@ -191,6 +196,14 @@ or
This will download, build and then install/upgrade the package. Note that the
package will only be installed/upgraded if the build is successful.
-> If you enable [[#NonRootBuilding | building ports as an unprivileged user]]
and give that user write permissions on the directories for pkgmk {sources, work,
packages}, the unprivileged user will be able to create a package but not to
exercise the '''-i''' and '''-u''' options of '''pkgmk'''. There are forks of
pkgmk that automatically invoke '''sudo''' or '''doas''' when performing the
'''pkgadd''' step, but these forks are not part of the official CRUX utilities
at this time.
!!! Enabling the 'contrib' collection
As previously mentioned, the 'contrib' collection contains useful ports of
@ -246,7 +259,7 @@ As with 'contrib', run @@ports -u@@ and you're ready to use the ports from
%fn%compat-32%%.
!!! Additional tools
!!!! Building ports as unprivileged user
[[#NonRootBuilding]] !!!! Building ports as unprivileged user
Building packages requires root privileges in order to create files with the
correct owner and group. This is a security concern because a malicious or badly