___ ____ ____ ____ / _ \ _ __ ___ _ __ | __ ) ___|| _ \ | | | | '_ \ / _ \ '_ \| _ \___ \| | | | | |_| | |_) | __/ | | | |_) |__) | |_| | \___/| .__/ \___|_| |_|____/____/|____/ |_| P O R T S & P A C K A G E S ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ sdk/uugrn/2021-01-08 #-----------N-E-X-T---S-L-I-D-E-------------- // INDEX 1. What is a PORT? 2. What is a PACKAGE? 3. Package Survival Guide 4. Understanding Ports (5) 5. Creating a Port (7) 6. More Information #-----------N-E-X-T---S-L-I-D-E-------------- What is a PORT? <---, ------------------------------------------ | A port is a set of instructions about how | to download, patch and compile a program. | | What is a PACKAGE? | ------------------------------------------ | A package is a compiled program in binary | form. Packages are created from PORTS. -----' #-----------N-E-X-T---S-L-I-D-E-------------- Package Survival Guide ------------------------------------------ $ pkg_info -Q # list packages $ pkg_info # show description $ pkg_add # install package $ pkg_delete # delete package $ pkg_delete -a # cleanup leftovers ------------------------------------------ ...but what if there is no package? #-----------N-E-X-T---S-L-I-D-E-------------- Undestanding Ports (1/5) ------------------------------------------ * Installing the ports tree: - have ~4G of free space in /usr/ports - download ports.tar.gz from https://cdn.openbsd.org/pub/OpenBSD/6.8 - extract it to /usr/ports #-----------N-E-X-T---S-L-I-D-E-------------- Undestanding Ports (2/5) ------------------------------------------ /usr/ports # all ports /usr/ports/mystuff # your custom ports /usr/ports/distfiles # source downloads /usr/ports/pobj # build directory /usr/ports// /usr/ports/mystuff// #-----------N-E-X-T---S-L-I-D-E-------------- Undestanding Ports (3/5) ------------------------------------------ /usr/ports/misc/sent $ tree |-- Makefile # build instructions |-- distinfo # make makesum |-- patches # make update-patches | |-- patch-Makefile | |-- patch-config_def_h | `-- patch-config_mk `-- pkg |-- DESCR # port description `-- PLIST # make plist #-----------N-E-X-T---S-L-I-D-E-------------- Undestanding Ports (4/5) ------------------------------------------ $ pwd /usr/ports/misc/sent $ make install # install port $ make deinstall # deinstall port $ make clean # delete source #-----------N-E-X-T---S-L-I-D-E-------------- Undestanding Ports (5/5) ------------------------------------------ $ make fetch # download software | S $ make extract # extract software | E $ make patch # patch software | Q $ make build # compile software | U $ make fake # install into fake dir | E $ make package # create binary package | N $ make install # install port V C $ make deinstall # deinstall port E $ make clean=all # delete all artifacts #-----------N-E-X-T---S-L-I-D-E-------------- Creating a Port (1/7) ------------------------------------------ |-- Makefile # build instructions (2) |-- distinfo # make makesum (3) |-- patches # make update-patches(4) `-- pkg |-- DESCR # port description (5) `-- PLIST # make plist (6) #-----------N-E-X-T---S-L-I-D-E-------------- Creating a Port (2/7) ------------------------------------------ |-- Makefile # build instructions ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ COMMENT = simple presentation tool DISTNAME = sent-1 CATEGORIES = misc PERMIT_PACKAGE = Yes MASTER_SITES = http://dl.suckless.org/tools WRKDIST = ${WRKDIR} .include #-----------N-E-X-T---S-L-I-D-E-------------- Creating a Port (3/5) ------------------------------------------ |-- distinfo # make makesum ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SHA256 (sent-1.tar.gz) = e/Pe7W...S8vXvjM= SIZE (sent-1.tar.gz) = 15285 #-----------N-E-X-T---S-L-I-D-E-------------- Creating a Port (4/7) ------------------------------------------ |-- patches # make update-patches(4) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ $ cd /usr/ports/pobj/$DISTNAME $ cp filetochange.c filetochange.c.orig $ vim filetochange.c $ cd /usr/ports/mystuff/$CATEGORY/$DISTNAME $ make update-patches #-----------N-E-X-T---S-L-I-D-E-------------- Creating a Port (5/7) ------------------------------------------ |-- DESCR # port description ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ sent is a simple plaintext presentation tool. sent does not need latex, libreoffice or any other fancy file format, it uses plaintext files and png images. Every paragraph represents a slide in the presentation. [...] #-----------N-E-X-T---S-L-I-D-E-------------- Creating a Port (6/7) ------------------------------------------ `-- PLIST # make plist ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @comment $OpenBSD: PLIST,v$ @bin bin/sent @mandir share/man/ share/man/man1/ @man share/man/man1/sent.1 #-----------N-E-X-T---S-L-I-D-E-------------- Creating a Port (7/7) ------------------------------------------ Port helper: * portcheck [-N] * make port-lib-depends-check #-----------N-E-X-T---S-L-I-D-E-------------- More Information ------------------------------------------ * ports(7) * bsd.port.mk(5) * port-modules(5) * https://www.openbsd.org/faq/ports/ports.html * ports@openbsd.org #-----------N-E-X-T---S-L-I-D-E-------------- THXBYE