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 !!! Listing Local Ports
When the local ports structure has been updated the directory %fn%/usr/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 these directories you will find ports. You can simply browse around in the
directory structure to find out which ports are available. directory structure to find out which ports are available.
$ cd /usr/ports/core/ $ cd /usr/ports/core/
$ ls $ ls
acl/ gperf/ openssh/ acl/ httpup/ nftables/
attr/ grep/ openssl/ attr/ iana-etc/ ninja/
autoconf/ groff/ patch/ autoconf/ inetutils/ openssh/
automake/ gzip/ pciutils/ automake/ iproute2/ openssl/
bash/ hdparm/ perl/ bash/ iptables/ patch/
bc/ httpup/ pkgconf/ bc/ jansson/ pciutils/
binutils/ iana-etc/ pkgutils/ binutils/ jsoncpp/ perl/
bison/ inetutils/ ports/ bison/ kbd/ pkgconf/
bzip2/ iproute2/ procps/ bzip2/ kmod/ pkgutils/
ca-certificates/ iptables/ prt-get/ ca-certificates/ less/ ports/
COPYING kbd/ psmisc/ cmake/ libarchive/ procps/
COPYRIGHT kmod/ python3/ coreutils/ libcap/ prt-get/
coreutils/ less/ rc/ cpio/ libdevmapper/ psmisc/
cpio/ libarchive/ rdate/ curl/ libedit/ python3/
curl/ libcap/ readline/ dash/ libffi/ python3-setuptools/
dash/ libdevmapper/ rsync/ db/ libgmp/ rc/
db/ libffi/ sed/ dcron/ libmnl/ rdate/
dcron/ libgmp/ shadow/ dhcpcd/ libmpc/ readline/
dhcpcd/ libmpc/ signify/ diffutils/ libmpfr/ rhash/
diffutils/ libmpfr/ sqlite3/ dumb_runtime_dir/ libnftnl/ rsync/
e2fsprogs/ libnsl/ start-stop-daemon/ e2fsprogs/ libnghttp2/ sed/
ed/ libpcre/ sudo/ ed/ libnsl/ shadow/
elfutils/ libpipeline/ sysfsutils/ elfutils/ libpcre/ signify/
eudev/ libtirpc/ sysklogd/ eudev/ libpcre2/ sqlite3/
exim/ libtool/ sysvinit/ exim/ libpipeline/ start-stop-daemon/
expat/ libusb/ tar/ expat/ libtirpc/ sudo/
file/ linux-pam/ time/ file/ libtool/ sysfsutils/
filesystem/ lzo/ tzdata/ filesystem/ libusb/ sysklogd/
findutils/ m4/ usbutils/ findutils/ libuv/ sysvinit/
flex/ make/ util-linux/ flex/ linux-pam/ tar/
gawk/ man-db/ vim/ gawk/ lzlib/ time/
gcc/ man-pages/ wget/ gcc/ lzo/ tzdata/
gdbm/ mlocate/ which/ gdbm/ m4/ usbutils/
gettext/ mpdecimal/ xz/ gettext/ make/ util-linux/
glibc/ nasm/ zlib/ glibc/ man-db/ vim/
glibc-32/ ncurses/ zstd/ 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: You can also use '''ports''' with the '''-l''' option to list all local ports. Example:
$ ports -l $ ports -l
core/acl
core/attr
core/autoconf core/autoconf
core/automake core/automake
core/bash core/bash
core/bc core/bc
core/bin86
core/bindutils
core/binutils
... ...
If you are looking for a specific package, it might be easier to use this If you are looking for a specific package, a command like @@ports -l | grep sendmail@@
approach (e.g. @@ports -l | grep sendmail@@) to find out if the package is provides a straightforward way to find out if the package is available and if so
available and if so in which category it is located. 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 !!! Listing Version Differences
To find out if the ports structure carries ports that are different (likely 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 newer) compared to the versions currently installed, you can use the option
'''-d'''. If version differences are found, the output from the above command '''-d'''. If differences are found (in either 'version' or 'release'), the
could look something like this: output from the above command could look something like this:
$ ports -d $ ports -d
Collection Name Port Installed 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 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 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 will be built. If the package was built successfully you can use '''pkgadd''' to
install or upgrade it. Example: install or upgrade it. Example:
@ -191,6 +196,14 @@ or
This will download, build and then install/upgrade the package. Note that the This will download, build and then install/upgrade the package. Note that the
package will only be installed/upgraded if the build is successful. 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 !!! Enabling the 'contrib' collection
As previously mentioned, the 'contrib' collection contains useful ports of 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%%. %fn%compat-32%%.
!!! Additional tools !!! 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 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 correct owner and group. This is a security concern because a malicious or badly