[BACK]Return to README CVS log [TXT][DIR] Up to [local] / ports

Annotation of ports/README, Revision 1.8

1.4       marc        1:
1.2       joey        2:                Welcome to the OpenBSD ports collection.
                      3:        For more information on the OpenBSD ports tree please visit
                      4:                   http://www.openbsd.org/ports.html
                      5:        For general information on the OpenBSD tree please visit
                      6:                        http://www.openbsd.org
1.1       joey        7:
                      8:
1.7       espie       9: Contacts
                     10: ========
1.5       espie      11: * individual ports list a
                     12: MAINTAINER=
1.7       espie      13: line in their Makefile.
1.5       espie      14: * specific issues related to the ports framework (e.g., bugs in
                     15: bsd.port.mk)  should go to ports-admin@openbsd.org
                     16: * ports without explicit maintainers, and other general issues should
                     17: go to ports@openbsd.org
                     18:
1.7       espie      19: Considering the size of the ports tree, and even though we strive to
                     20: eradicate all bugs, things may go wrong on invidual ports.
                     21: In such a case, as a general rule, try to contact the MAINTAINER first.
                     22: If nothing happens after a reasonable delay, start plaguing him,
                     23: or go to the next step.
1.5       espie      24:
                     25: Developpers with a major investment in the ports tree include
                     26: brad@cvs.openbsd.org, turan@cvs.openbsd.org, espie@cvs.openbsd.org
                     27:
                     28: Those people can be contacted to put some pressure on a lazy maintainer.
                     29: But we do read ports@openbsd.org, so...
                     30:
                     31: The ports tree
                     32: ==============
                     33: The ports tree usually live under /usr/ports. It's a hierarchical
                     34: list of recipes to build various pieces of software.
                     35: We'll call that PORTSDIR in the following discussion.
                     36: Stuff that doesn't constitue a port proper, but rather paraphernalia,
                     37: is stored under /usr/ports/infrastructure, INFRA in the following
                     38: discussion.
                     39:
                     40: The main Makefile, PORTSDIR/Makefile, can be used to obtain various
                     41: information.
                     42:
                     43: * make search key=<keyword>
                     44: will locate ports that match the given keyword in the Index and print
                     45: information about them.
                     46:
                     47: * make index
                     48: can be used to rebuild that INDEX, normally useful after you update your
                     49: ports dir through cvs.
                     50:
                     51: * make readmes
                     52: will populate the ports tree with a set of html indices.
                     53:
                     54: The script INFRA/build/out-of-date will find
                     55: discrepancies between your installed packages and the INDEX. This might
                     56: give you an hint as to what you would need to rebuild to update a machine.
                     57:
                     58: Some useful `make' trivia
                     59: =========================
                     60: * if you always use some make variables, e.g., DISTDIR, CLEANDEPENDS, or
                     61: MASTER_SITE_OVERRIDE you can put this in your local make configuration
                     62: file instead: /etc/mk.conf.
                     63: * starting with 2.6, make can deal with case issues, so CLEANDEPENDS=Yes
                     64: or CLEANDEPENDS=YES or even CLEANDEPENDS=yEs should be equivalent.
                     65: * the make process uses some subroutines out of /usr/share/mk. Starting
                     66: with 2.6, the `port' subroutines live in INFRA/mk.
                     67: The bsd.port.mk and bsd.port.subdir.mk in /usr/share/mk are only stubs
                     68: that redirect to those files.
                     69:
                     70: Building a port
                     71: ===============
                     72: It's usually as simple as
                     73: cd category/portname && make && make install
                     74:
                     75: That specific `make' will normally
                     76: * resolve dependencies and go out to install required ports recursively
                     77: * fetch the software source (`distfiles' and `distribution patches')
                     78: from the available media into your repository
                     79: * extract the source
                     80: * apply distribution patches and OpenBSD patches
                     81: * build the program
                     82:
                     83: `make install' will
                     84: * install the software on your system
                     85: * log the installation so that later pkg_info or pkg_delete can deal with
                     86: the software.
                     87:
                     88: Some ports can have some options, or demand that you make some choice
                     89: before building, e.g.,
                     90: cd /usr/ports/security/ssh
                     91: make all install USA_RESIDENT=no
                     92:
                     93: Some ports may prompt you for more choice, or give you important
                     94: information about ports building.  Likewise, installing or uninstalling
                     95: a port may give you useful information. READ IT.
                     96:
                     97: You can also use
                     98: * `make uninstall' to remove the installed software (same as pkg_delete)
                     99: * `make package' to convert the installed software into a binary `package'
                    100: (a tar ball that you can share with other machines with the same
                    101: configuration, contribute to the ftp project, or that you can backup
                    102: separately). Packages normally end up in /usr/ports/packages, overridable
                    103: with PACKAGE.
                    104: * `make fetch-list' to build a small shell-script that should be able to
                    105: retrieve the missing distfiles and distribution patches for the given port.
                    106: * `make clean' to remove all scaffolding after the port is built and
                    107: installed.
                    108: * `make distclean' to also remove distfiles and distribution patches
                    109: from the repository
                    110: * `make clean CLEANDEPENDS=Yes' will also remove sub ports that have been
                    111: recursively built.
                    112: * `make distclean CLEANDEPENDS=Yes', guess what this does.
                    113:
                    114: Please note that, in normal use, the OpenBSD ports tree will grow quite
1.8     ! espie     115: a lot.  Careful use of make clean and make distclean will help you. You
        !           116: can also redirect ports activity elsewhere by making use of WRKOBJDIR
        !           117: and DISTDIR.  `find /usr/ports -type d -name work\* -print'
        !           118: can be useful to find out ports you forgot to clean out.
1.5       espie     119:
                    120: There are a few kinks in the building of ports with options yet. Namely,
                    121: all such ports should produce distinct package names if built with
                    122: different options.  Also, there is no check for consistency between
                    123: make and make install. Taking the ssh example again,
                    124: make USA_RESIDENT=No
                    125: make install USA_RESIDENT=Yes
                    126: won't be flagged as an error...
                    127:
                    128: Where do the distfiles come from
                    129: ================================
                    130: Retrieving distfiles is a subpart of `make' that can be invoked separately
                    131: as `make fetch'.
                    132:
                    133: Starting with 2.6, the fetch process is configurable by editing
                    134: INFRA/db/network.conf.
                    135:
                    136: The ports tree does store files it retrieves in a repository area,
                    137: normally /usr/ports/distfiles (defined as DISTDIR=${PORTSDIR}/distfiles;
                    138: you can override this if you need; e.g., assuming you've got a cdrom
                    139: full of distfiles mounted under /cdrom, you can make stuff with
                    140: DISTDIR=/cdrom/distfiles, provided all the distfiles are available on
                    141: the CD-Rom).
                    142:
                    143: If the file is found in the repository, the build process continues.
                    144: In some rare cases, vendors change their archive contents without changing
                    145: the archive name, so the file in the repository may end up having a wrong
                    146: checksum. Or, if you aborted a network transfer, the file in the repository
                    147: may be truncated, and end up having a wrong checksum again. In such a case,
                    148: manual intervention is required (it was deemed that such problems may need
                    149: human expertise and that blindly removing distfiles was not a good idea).
                    150: It's usually as simple as deleting the offending file, or doing a
                    151: make distclean.
                    152:
                    153: To avoid building from corrupted archives, the ports tree holds checksums
                    154: for almost all files it retrieves from other media (a few ports ignore
                    155: checksums from the files listed in IGNOREFILES).
                    156: Those are strong cryptographic checksums: sha1, rmd160, and md5,
                    157: in that order.  See CIPHERS and PREFERRED_CIPHERS in
                    158: INFRA/mk/bsd.port.mk for details.
                    159:
                    160: If the directory /cdrom/distfiles exist, available distfiles are copied
                    161: off that directory to your repository.  You can avoid the copy overhead
                    162: by defining FETCH_SYMLINK_DISTFILES.  You can give another location for
                    163: the distfiles as CDROM_SITE.
                    164:
                    165: OpenBSD `ftp' command is normally used to fetch distfiles off the net,
                    166: so all file addresses are given in URL format.
                    167: Each port uses its own set of sites, and there should also be backups of
                    168: the distribution files on ftp.openbsd.org.  MASTER_SITE_BACKUP holds an
                    169: overridable list of backup sites, normally
                    170: ftp://ftp.openbsd.org/pub/OpenBSD/distfiles/${DIST_SUBDIR}/
                    171: ftp://ftp.openbsd.org/pub/OpenBSD/licensed/${DIST_SUBDIR}/
                    172: ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
                    173:
                    174: You can ask the fetch process to try to retrieve files from those sites first
                    175: by setting MASTER_SITE_OVERRIDE, e.g.,
                    176: make MASTER_SITE_OVERRIDE='${MASTER_SITE_BACKUP}'
                    177:
                    178: You can retrieve file from the OpenBSD site only with
                    179: make MASTER_SITE_OPENBSD=Yes
                    180:
                    181: Continuing our CD-Rom example, you could also fetch files off a CD-Rom into
                    182: your repository for safe-keeping by using the following incantation:
1.8     ! espie     183: make fetch MASTER_SITE_OVERRIDE='file:/cdrom/${DIST_SUBDIR}/'
1.5       espie     184: This is equivalent to using CDROM_SITE.
                    185:
                    186: Some common sites have their own variables. It is strongly recommended
                    187: that you edit the INFRA/db/network.conf file for
                    188: your site.
                    189:
                    190: Please refer to that file for a complete list, and address lists
                    191: (those are not exhaustive). Those include:
                    192: MASTER_SITE_GNU                        FSF and other GPL programs
                    193: MASTER_SITE_XCONTRIB           X11 contributed software
                    194: MASTER_SITE_SUNSITE            Sunsite site and mirror, major linux archive
                    195: MASTER_SITE_GNOME              Gnome
                    196: MASTER_SITE_PERL_CPAN          Comprehensive perl archive network
                    197: MASTER_SITE_TEX_CTAN           Comprehensive TeX archive network
                    198: MASTER_SITE_KDE                        KDE
                    199: MASTER_SITE_TCLTK              Tcl/Tk
                    200: MASTER_SITE_AFTERSTEP          AfterStep
                    201: MASTER_SITE_WINDOWMAKER                WindowMaker
                    202:
                    203: There is a backup copy of that file in
                    204: INFRA/templates/network.conf.template.
                    205:
                    206: In case you don't have a permanent network connection,
                    207: `make fetch-list' should provide you with a shell script you can use to
                    208: retrieve distfiles you're missing to build a given port.
                    209:
                    210: (TODO: improve and systematize fetch-all)
                    211:
                    212: Building several ports
                    213: ======================
                    214: Each category directory holds a Makefile that propagates commands to
                    215: its sub ports, e.g., if you cd /usr/ports/audio && make, this should
                    216: build all ports under /usr/ports/audio.
                    217:
                    218: A more useful command is the
                    219: INFRA/build/find-build-order script.
                    220: You normally prepare a list of the ports you want to build, in the same
                    221: format as  INFRA/db/essentials, and pass it to find-build-order like
                    222: this:
                    223: cd /usr/ports/infrastructure
                    224: cat db/essentials|build/find-build-order
                    225: This yields a sorted list of the required ports.
                    226:
                    227: (Todo: provide for a script which builds everything we want)
                    228:
                    229: You can filter ports that require interaction out with
                    230: make BATCH=yes
                    231:
                    232: Likewise, make FOR_CDROM=yes, make NO_RESTRICTED=yes
                    233: will yield only the ports with the required level of liberty.
                    234:
                    235: Files Summary
                    236: =============
                    237: /usr/ports (PORTSDIR):
                    238:        the whole port collection
                    239: /usr/ports/<category>/<portname>:
                    240:        where to find a given port
                    241: /usr/ports/INDEX:
                    242:        all distfiles, rebuilt with make index
                    243: /usr/ports/README.html
                    244: /usr/ports/<category>/README.html
                    245: /usr/ports/<category>/<portname>/README.html:
                    246:        www indices produced by make readmes
                    247: /usr/ports/distfiles (DISTFILES):
                    248:        repository for distribution files and distribution patches
                    249: /cdrom/distfiles (CDROM_SITE):
                    250:        standard location for distfiles off a CD
                    251: /usr/ports/packages (PACKAGES):
                    252:        where binary packages are built (by category. Normally everything
                    253:        ends up under All, with symlinks for each category)
                    254: /usr/ports/<category>/<portname>/work:
                    255:        where the ports mechanism does the building. This is normally a
                    256:        real directory, but you can set WRKOBJDIR to point to another
                    257:        base which is not /usr/ports, and work/ will  be a link to
                    258:        ${WRKOBJDIR}/category/portname/work.  This can be useful to
                    259:        mount a master /usr/ports directory by NFS on several
                    260:        architectures. Normally, you first
                    261:        cd /usr/ports && make WRKOBJDIR=path obj
                    262:        on the master machine, which creates the symbolic links, so that
                    263:        you can mount your master /usr/ports read-only.
                    264: /usr/ports/<category>/<portname>/pkg/SECURITY:
                    265:        information relative to a security audit of the port.  Usually
                    266:        missing.
                    267: /usr/ports/infrastructure:
                    268:        paraphernalia around the ports tree
                    269: /usr/ports/db/network.conf:
                    270:        your local network configuration (ftp sites)
                    271: /var/db/pkg:
                    272:        installed ports, see pkg_add(1).
                    273: /usr/local (LOCALBASE):
                    274:        where normal ports install themselves.
                    275: /usr/X11R6 (X11BASE):
                    276:        where ports with a large dependency on X11 install themselves.
                    277:
                    278: Other tweaks
                    279: ============
                    280: FORCE_PACKAGE: force package building.  Some ports can't be distributed
                    281: as packages for legal reasons, but you may wish to build a package for
                    282: your private consumption.
                    283: HAVE_MOTIF: set in /etc/mk.conf if we own a copy of the real thing.
                    284: MOTIF_STATIC: set in /etc/mk.conf to use a static version of the Motif
                    285: library only.
                    286: NO_MTREE: don't run mtree before installing a port. This is a dangerous
                    287: option.
                    288: NO_PKG_REGISTER: used for make install, don't register port under
                    289: /var/db/pkg.   This is a dangerous option.
                    290: FORCE_PACKAGE_REGISTER: override an existing port (the <pkgname> is already
                    291: installed message). You will end up with several flavors of the same
                    292: package.  This is a dangerous option, as this will probably erase the other
                    293: port.
                    294: NO_IGNORE: coerce fetch, build, install... into doing their job even though
                    295: there might be a good reason not to. Good reasons include BROKEN,
                    296: ONLY_FOR_ARCH, IS_INTERACTIVE in BATCH mode, NO_CDROM in FOR_CDROM... This
                    297: is a dangerous option.
                    298:
                    299: Keeping up with the Jones, ports as a moving target
                    300: ===================================================
                    301: The OpenBSD ports tree is growing from release to release. It needs
                    302: people to write and test new ports.
                    303: Like for src, you can choose to live on the bleeding edge by updating
                    304: your ports dir thru cvs or ftp, and contribute bug-reports.
                    305:
                    306: If you prefer to stay with a stable release, we try to make sure
                    307: the distfiles for a given release stay on the OpenBSD site between
                    308: releases.
1.1       joey      309:
1.3       marc      310: No matter how fast we update the tree it seems that we are always
                    311: behind.  For this reason you will sometimes find a port that is
                    312: marked as BROKEN.  If you try to build the port you will see a
                    313: message something like:
                    314:
                    315:    ===> xxx-1.0 is marked as broken: newer version available.
                    316:
                    317: This means we know there is a newer version of the application but
                    318: have not yet had time to update the port.  If you get this message
                    319: all may not be lost.  If the old sources are still available (and
                    320: this is often the case) you can force a build using the old sources
                    321: using the command:
                    322:
                    323:        make NO_IGNORE=yes
                    324:        sudo make NO_IGNORE=yes install
                    325:
1.4       marc      326: If you're feeling generous a better solution is to update the port
1.3       marc      327: to use the new sources and feed the changes back to the project.
                    328: If you are interested in contributing (or creating a new port)
                    329: please visit
                    330:
1.1       joey      331:        http://www.openbsd.org/porting.html
1.3       marc      332:
1.8     ! espie     333: $OpenBSD: README,v 1.7 1999/10/07 14:35:52 espie Exp $