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

Annotation of ports/README, Revision 1.7

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
                    115: a lot.  Careful use of make clean and make distclean will help you.
1.6       espie     116: `find /usr/ports -type d -name work\* -print' can be useful to find out
1.5       espie     117: ports you forgot to clean out.
                    118:
                    119: There are a few kinks in the building of ports with options yet. Namely,
                    120: all such ports should produce distinct package names if built with
                    121: different options.  Also, there is no check for consistency between
                    122: make and make install. Taking the ssh example again,
                    123: make USA_RESIDENT=No
                    124: make install USA_RESIDENT=Yes
                    125: won't be flagged as an error...
                    126:
                    127: Where do the distfiles come from
                    128: ================================
                    129: Retrieving distfiles is a subpart of `make' that can be invoked separately
                    130: as `make fetch'.
                    131:
                    132: Starting with 2.6, the fetch process is configurable by editing
                    133: INFRA/db/network.conf.
                    134:
                    135: The ports tree does store files it retrieves in a repository area,
                    136: normally /usr/ports/distfiles (defined as DISTDIR=${PORTSDIR}/distfiles;
                    137: you can override this if you need; e.g., assuming you've got a cdrom
                    138: full of distfiles mounted under /cdrom, you can make stuff with
                    139: DISTDIR=/cdrom/distfiles, provided all the distfiles are available on
                    140: the CD-Rom).
                    141:
                    142: If the file is found in the repository, the build process continues.
                    143: In some rare cases, vendors change their archive contents without changing
                    144: the archive name, so the file in the repository may end up having a wrong
                    145: checksum. Or, if you aborted a network transfer, the file in the repository
                    146: may be truncated, and end up having a wrong checksum again. In such a case,
                    147: manual intervention is required (it was deemed that such problems may need
                    148: human expertise and that blindly removing distfiles was not a good idea).
                    149: It's usually as simple as deleting the offending file, or doing a
                    150: make distclean.
                    151:
                    152: To avoid building from corrupted archives, the ports tree holds checksums
                    153: for almost all files it retrieves from other media (a few ports ignore
                    154: checksums from the files listed in IGNOREFILES).
                    155: Those are strong cryptographic checksums: sha1, rmd160, and md5,
                    156: in that order.  See CIPHERS and PREFERRED_CIPHERS in
                    157: INFRA/mk/bsd.port.mk for details.
                    158:
                    159: If the directory /cdrom/distfiles exist, available distfiles are copied
                    160: off that directory to your repository.  You can avoid the copy overhead
                    161: by defining FETCH_SYMLINK_DISTFILES.  You can give another location for
                    162: the distfiles as CDROM_SITE.
                    163:
                    164: OpenBSD `ftp' command is normally used to fetch distfiles off the net,
                    165: so all file addresses are given in URL format.
                    166: Each port uses its own set of sites, and there should also be backups of
                    167: the distribution files on ftp.openbsd.org.  MASTER_SITE_BACKUP holds an
                    168: overridable list of backup sites, normally
                    169: ftp://ftp.openbsd.org/pub/OpenBSD/distfiles/${DIST_SUBDIR}/
                    170: ftp://ftp.openbsd.org/pub/OpenBSD/licensed/${DIST_SUBDIR}/
                    171: ftp://ftp.freebsd.org/pub/FreeBSD/distfiles/${DIST_SUBDIR}/
                    172:
                    173: You can ask the fetch process to try to retrieve files from those sites first
                    174: by setting MASTER_SITE_OVERRIDE, e.g.,
                    175: make MASTER_SITE_OVERRIDE='${MASTER_SITE_BACKUP}'
                    176:
                    177: You can retrieve file from the OpenBSD site only with
                    178: make MASTER_SITE_OPENBSD=Yes
                    179:
                    180: Continuing our CD-Rom example, you could also fetch files off a CD-Rom into
                    181: your repository for safe-keeping by using the following incantation:
                    182: make fetch MASTER_SITE_OVERRIDE='file:/cdrom/{$DIST_SUBDIR}/'
                    183: This is equivalent to using CDROM_SITE.
                    184:
                    185: Some common sites have their own variables. It is strongly recommended
                    186: that you edit the INFRA/db/network.conf file for
                    187: your site.
                    188:
                    189: Please refer to that file for a complete list, and address lists
                    190: (those are not exhaustive). Those include:
                    191: MASTER_SITE_GNU                        FSF and other GPL programs
                    192: MASTER_SITE_XCONTRIB           X11 contributed software
                    193: MASTER_SITE_SUNSITE            Sunsite site and mirror, major linux archive
                    194: MASTER_SITE_GNOME              Gnome
                    195: MASTER_SITE_PERL_CPAN          Comprehensive perl archive network
                    196: MASTER_SITE_TEX_CTAN           Comprehensive TeX archive network
                    197: MASTER_SITE_KDE                        KDE
                    198: MASTER_SITE_TCLTK              Tcl/Tk
                    199: MASTER_SITE_AFTERSTEP          AfterStep
                    200: MASTER_SITE_WINDOWMAKER                WindowMaker
                    201:
                    202: There is a backup copy of that file in
                    203: INFRA/templates/network.conf.template.
                    204:
                    205: In case you don't have a permanent network connection,
                    206: `make fetch-list' should provide you with a shell script you can use to
                    207: retrieve distfiles you're missing to build a given port.
                    208:
                    209: (TODO: improve and systematize fetch-all)
                    210:
                    211: Building several ports
                    212: ======================
                    213: Each category directory holds a Makefile that propagates commands to
                    214: its sub ports, e.g., if you cd /usr/ports/audio && make, this should
                    215: build all ports under /usr/ports/audio.
                    216:
                    217: A more useful command is the
                    218: INFRA/build/find-build-order script.
                    219: You normally prepare a list of the ports you want to build, in the same
                    220: format as  INFRA/db/essentials, and pass it to find-build-order like
                    221: this:
                    222: cd /usr/ports/infrastructure
                    223: cat db/essentials|build/find-build-order
                    224: This yields a sorted list of the required ports.
                    225:
                    226: (Todo: provide for a script which builds everything we want)
                    227:
                    228: You can filter ports that require interaction out with
                    229: make BATCH=yes
                    230:
                    231: Likewise, make FOR_CDROM=yes, make NO_RESTRICTED=yes
                    232: will yield only the ports with the required level of liberty.
                    233:
                    234: Files Summary
                    235: =============
                    236: /usr/ports (PORTSDIR):
                    237:        the whole port collection
                    238: /usr/ports/<category>/<portname>:
                    239:        where to find a given port
                    240: /usr/ports/INDEX:
                    241:        all distfiles, rebuilt with make index
                    242: /usr/ports/README.html
                    243: /usr/ports/<category>/README.html
                    244: /usr/ports/<category>/<portname>/README.html:
                    245:        www indices produced by make readmes
                    246: /usr/ports/distfiles (DISTFILES):
                    247:        repository for distribution files and distribution patches
                    248: /cdrom/distfiles (CDROM_SITE):
                    249:        standard location for distfiles off a CD
                    250: /usr/ports/packages (PACKAGES):
                    251:        where binary packages are built (by category. Normally everything
                    252:        ends up under All, with symlinks for each category)
                    253: /usr/ports/<category>/<portname>/work:
                    254:        where the ports mechanism does the building. This is normally a
                    255:        real directory, but you can set WRKOBJDIR to point to another
                    256:        base which is not /usr/ports, and work/ will  be a link to
                    257:        ${WRKOBJDIR}/category/portname/work.  This can be useful to
                    258:        mount a master /usr/ports directory by NFS on several
                    259:        architectures. Normally, you first
                    260:        cd /usr/ports && make WRKOBJDIR=path obj
                    261:        on the master machine, which creates the symbolic links, so that
                    262:        you can mount your master /usr/ports read-only.
                    263: /usr/ports/<category>/<portname>/pkg/SECURITY:
                    264:        information relative to a security audit of the port.  Usually
                    265:        missing.
                    266: /usr/ports/infrastructure:
                    267:        paraphernalia around the ports tree
                    268: /usr/ports/db/network.conf:
                    269:        your local network configuration (ftp sites)
                    270: /var/db/pkg:
                    271:        installed ports, see pkg_add(1).
                    272: /usr/local (LOCALBASE):
                    273:        where normal ports install themselves.
                    274: /usr/X11R6 (X11BASE):
                    275:        where ports with a large dependency on X11 install themselves.
                    276:
                    277: Other tweaks
                    278: ============
                    279: FORCE_PACKAGE: force package building.  Some ports can't be distributed
                    280: as packages for legal reasons, but you may wish to build a package for
                    281: your private consumption.
                    282: HAVE_MOTIF: set in /etc/mk.conf if we own a copy of the real thing.
                    283: MOTIF_STATIC: set in /etc/mk.conf to use a static version of the Motif
                    284: library only.
                    285: NO_MTREE: don't run mtree before installing a port. This is a dangerous
                    286: option.
                    287: NO_PKG_REGISTER: used for make install, don't register port under
                    288: /var/db/pkg.   This is a dangerous option.
                    289: FORCE_PACKAGE_REGISTER: override an existing port (the <pkgname> is already
                    290: installed message). You will end up with several flavors of the same
                    291: package.  This is a dangerous option, as this will probably erase the other
                    292: port.
                    293: NO_IGNORE: coerce fetch, build, install... into doing their job even though
                    294: there might be a good reason not to. Good reasons include BROKEN,
                    295: ONLY_FOR_ARCH, IS_INTERACTIVE in BATCH mode, NO_CDROM in FOR_CDROM... This
                    296: is a dangerous option.
                    297:
                    298: Keeping up with the Jones, ports as a moving target
                    299: ===================================================
                    300: The OpenBSD ports tree is growing from release to release. It needs
                    301: people to write and test new ports.
                    302: Like for src, you can choose to live on the bleeding edge by updating
                    303: your ports dir thru cvs or ftp, and contribute bug-reports.
                    304:
                    305: If you prefer to stay with a stable release, we try to make sure
                    306: the distfiles for a given release stay on the OpenBSD site between
                    307: releases.
1.1       joey      308:
1.3       marc      309: No matter how fast we update the tree it seems that we are always
                    310: behind.  For this reason you will sometimes find a port that is
                    311: marked as BROKEN.  If you try to build the port you will see a
                    312: message something like:
                    313:
                    314:    ===> xxx-1.0 is marked as broken: newer version available.
                    315:
                    316: This means we know there is a newer version of the application but
                    317: have not yet had time to update the port.  If you get this message
                    318: all may not be lost.  If the old sources are still available (and
                    319: this is often the case) you can force a build using the old sources
                    320: using the command:
                    321:
                    322:        make NO_IGNORE=yes
                    323:        sudo make NO_IGNORE=yes install
                    324:
1.4       marc      325: If you're feeling generous a better solution is to update the port
1.3       marc      326: to use the new sources and feed the changes back to the project.
                    327: If you are interested in contributing (or creating a new port)
                    328: please visit
                    329:
1.1       joey      330:        http://www.openbsd.org/porting.html
1.3       marc      331:
1.7     ! espie     332: $OpenBSD: README,v 1.6 1999/09/26 10:52:55 espie Exp $