[BACK]Return to checklist.html CVS log [TXT][DIR] Up to [local] / www

Annotation of www/checklist.html, Revision 1.2

1.1       marc        1: <html>
                      2:  <head>
                      3:   <meta http-equiv="Content-Type"
                      4:        content="text/html; charset=iso-8859-1">
                      5:   <meta name="resource-type"
                      6:        content="document">
                      7:   <meta name="description"
                      8:        CONTENT="How to make an OpenBSD port; Marc's porting checklist">
                      9:   <meta name="keywords"
                     10:        content="openbsd,ports">
                     11:   <meta name="distribution"
                     12:        content="global">
                     13:   <meta name="copyright"
                     14:        content="This document copyright 1998 by the OpenBSD project">
                     15:   <title>Marc's Porting Checklist</title>
                     16:   <link rev="made" HREF="mailto:www@openbsd.org">
                     17:  </head>
                     18:  <body text="#000000" bgcolor="#FFFFFF" link="#23238E">
                     19:   <img height=30 width=141 src=images/smalltitle.gif alt="[OpenBSD]" >
                     20:
                     21:   <h2><font color=#e00000>Marc's Porting Checklist</font></h2>
                     22:
                     23:   I use this checklist as a reminder of things to do when creating
                     24:   new ports and when validating old ports.  I don't claim this list
                     25:   is totally accurate, much less perfect, but only hope that some
                     26:   find it useful. Direct your questions and/or comments to me at
                     27:   <a href=mailto:marc@snafu.org>marc@snafu.org</a>.
                     28:   <p>
                     29:   <ol>
                     30:    <li>Create Makefile -- start with this skeleton
                     31:        <a href="#makefile">makefile</a>.
                     32:    <p>
                     33:    <li><code>make fetch</code><br>
                     34:        This verifies that the master site, distname, and extract suffix are
                     35:        correct.
                     36:    <p>
                     37:    <li><code>make makesum</code><br>
                     38:        This creates the files directory and the md5 checksum for the
                     39:        fetched files.
                     40:    <p>
                     41:    <li><code>make extract</code><br>
                     42:        Ensures that the file can be extracted into the work directory.
                     43:        This also verifies that the checksum created in step 3 is good.
                     44:    <p>
                     45:    <li>Create initial patches<br>
                     46:        When the extract is complete cd to the work directory and read
                     47:        any install docs.  You may need to modify the WRKSRC variable
                     48:        in the makefile as well as generate initial patches to configure
                     49:        for openbsd.
                     50:     <p>Note: Patches go in the directory `patches' and are names patch-xx
                     51:        where xx should be aa, ab, ..., az, ba, bb ... zz.
                     52:        <ul>
                     53:        <li>only patch one source file per patchfile, please
                     54:        <li>use diff -u to generate patches
                     55:        <li>all patches MUST be relative to ${WRKSRC}
                     56:        </ul>
                     57:    <p>
                     58:    <li><code>make patch</code><br>
                     59:        this will apply patches to the extracted sources.  If you want
                     60:        to see the output use the command:
                     61:     <p><code>make PATCH_DEBUG=YES patch</code>
                     62:     <p>The easiest way to re-run patches is to `make clean && make patch'.
                     63:        This will delete the work directory and re-extract and patch.
                     64:    <p>
                     65:    <li>add configuration options to Makefile and/or create configuration
                     66:        script.<br>
                     67:        You can add a port configuration script named `configure' to a
                     68:        directory named scripts.  This will be run before any
                     69:        configuration specified by GNU_CONFIGURE or HAS_CONFIGURE is run.
                     70:     <p>If GNU_CONFIGURE is used you may want to run ./configure --help
                     71:        to see what options are available.  Anything thay you may want to
                     72:        override can be changed by adding the --option flags to the
                     73:        CONFIGURE_ARGS parameter in the Makefile
                     74:    <p>
                     75:    <li><code>make configure</code><br>
                     76:        Peruse the output (if any) and tweak any options in the Makefile.
                     77:        To repeat issue the command `make clean && make configure'.
                     78:     <p>Note: make sure host dependent files go in /etc or /etc/<name>, but
                     79:        NEVER replace existing files in /etc.  Best to have install place
                     80:        in /usr/local/lib/<name> and then copy to /etc or /etc/<name> only
                     81:        the files do not exist.
                     82:     <p>The OpenBSD file locations are:
                     83:        <pre>
                     84:    user executables:                   /usr/local/bin
                     85:    system admin executables:           /usr/local/sbin
                     86:    program executables:                        /usr/local/libexec
                     87:    libraries                           /usr/local/lib
                     88:    architecture dependent data         /usr/local/lib/<name>
                     89:    installed include files:            /usr/local/include or
                     90:                                        /usr/local/include/<name>
                     91:    single-machine data:                        /etc or /etc/<name>
                     92:    local state:                                /var/run
                     93:    GNU info files:                     /usr/local/info
                     94:    man pages:                          /usr/local/man/...
                     95:    read-only architecture-independent: /usr/local/share/<name>
                     96:    misc documentation:                 /usr/local/share/doc/<name>
                     97:        </pre>
                     98:    <p>
                     99:    <li><code>make</code><br>
                    100:        Begin a cycle of makes until the port is ready.  Patch (see above)
                    101:        clean, and make until the port is generated.  Get rid of all warnings
                    102:        if possible, especially security related warnings.
                    103:    <p>
                    104:    <li><code>mkdir pkg; touch pkg/{DESCR,COMMENT,PLIST}</code><br>
                    105:         Create dummy versions of the package files.  Edit DESCR and COMMENT.
                    106:      <p>COMMENT is the one-line description of the port. Do NOT include the
                    107:         package name (or version number of the software) in the comment.
                    108:      <p>DESCR is a longer description of the port. One to a few paragraphs
                    109:         concisely explaining what the port does is sufficient.
                    110:      <p>PLIST is kept empty at this point.
                    111:    <p>
                    112:    <li><code>sudo make install</code><br>
                    113:        install the application.
                    114:    <p>
                    115:    <li>Create pkg/PLIST<br>
                    116:        After the install is complete use the developers command:
                    117:     <p><code>make plist</code>
                    118:     <p>which makes a the file PLIST-auto in the pkg directory.  This file
                    119:        is a candidate packing list.  Beware: the files are found by
                    120:        timestamp.  This means it does NOT:
                    121:        <ul>
                    122:         <li>list any files installed with `tar' as their timestamp
                    123:             will not change and thus won't be found by `find'
                    124:        <li>update the <code>info/dir</code> file if .info files are
                    125:            added.  You'll have to add that by hand.  Also, be sure that
                    126:            the <code>info/dir</code> is not part of the PLIST.
                    127:        <li>try to do anything special with links or symbolic links.  A
                    128:            cursory test of tar shows it does the right thing with links
                    129:            and symbolic links so I don't see why we need to special case
                    130:            anything in the packing list.  But still...
                    131:        </ul>
                    132:      <p>Peruse `PLIST-auto' and verify that everything was installed and
                    133:         that it was installed in the proper locations.  Anything not installed
                    134:        can be added to a port Makefile `post-install' rule.
                    135:      <p>Copy `PLIST-auto' to `PLIST'
                    136:    <p>
                    137:    <li>uninstall and reinstall; repeat until perfect.<br>
                    138:        <em>Perfect</em> is when everything installs and uninstalls
                    139:        in its proper location.  `pkg_delete <pkg_name>' is used to
                    140:        uninstall.  `sudo make reinstall' is used to reinstall.  See the
                    141:        `pkg_create' man page for other commands that may be added to PLIST
                    142:        to ensure all is cleaned up.  After an uninstall the command
                    143:        <p><code>find /usr/local -newer work/.install_started -print</code>
                    144:        <p>should only list standard directory names.
                    145:    <p>
                    146:    <li>Create package:<br>
                    147:        After the port installs correctly issue the command
                    148:        <code>make package</code> to create a package.  To test the
                    149:        package first do a <code>pkg_delete</code> and then do a
                    150:        <code>pkg_add</code>   The results after an add should EXACTLY
                    151:        match the results after a `make install'.
                    152:   </ol>
                    153:   <hr>
                    154:   <a name=makefile>
                    155:   <h2><font color=#e00000>Skeleton ports makefile</font></h2>
                    156:   </a>
                    157:
                    158:   <code>;;;</code> indicates values that must be supplied by the
                    159:    porter.  Remove extraneous comments when done.
                    160: <pre>
                    161: # OpenBSD makefile for:        ;;;
                    162: # Version required:    ;;;
                    163: # Date created:                ;;;
                    164: # Whom:                        you@your.domain
                    165: #
1.2     ! marc      166: # $OpenBSD: checklist.html,v 1.1 1998/07/30 23:04:47 marc Exp $
1.1       marc      167: #
                    168:
                    169: # What port/package will be created
                    170: #
                    171: DISTNAME=              ;;;
                    172: #DIST_SUBDIR=          ;;;
                    173: #PKGNAME=              ;;;
                    174: CATEGORIES=            ;;;
                    175:
                    176: # Reasons why the port/package shouldn't be built
                    177: #
                    178: #COMES_WITH=           2.3
                    179: #ONLY_FOR_ARCHS=       list architectures here
                    180: #BROKEN=               "reason"
                    181: #NO_CDROM=             "reason"
                    182: #RESTRICTED=           "reason"
                    183:
                    184: # where to send bitches about this port
                    185: #
                    186: MAINTAINER=            ports@openbsd.org
                    187:
                    188: # where the source files and patches can be fetched
                    189: #
                    190: MASTER_SITES=          ;;;
                    191: #MASTER_SITE_SUBDIR=   ;;;
                    192: #DISTFILES=            ;;;
                    193: #PATCH_SITES=          ;;;
                    194: #PATCHFILES=           ;;;
                    195:
                    196: # How to extract the sources
                    197: #
                    198: #EXTRACT_SUFX=         .tar.Z
                    199: #EXTRACT_CMD=          ;;;
                    200: #EXTRACT_BEFORE_ARGS=  ;;;
                    201: #EXTRACT_AFTER_ARGS=   ;;;
                    202:
                    203: # Dependencies
                    204: #
                    205: #FETCH_DEPENDS=                ;;;
                    206: #BUILD_DEPENDS=                ;;;
                    207: #RUN_DEPENDS=          ;;;
                    208: #LIB_DEPENDS=          ;;;
                    209:
                    210: # Is the build automagic or is it interactive
                    211: #
                    212: #IS_INTERACTIVE=       yes
                    213:
                    214: # build/configuration variables
                    215: #
                    216: #USE_GMAKE=            yes
                    217: #USE_IMAKE=            yes
                    218: #USE_X11=              yes (assumed if USE_IMAKE is yes)
                    219:
                    220: #GNU_CONFIGURE=                yes
                    221: #HAS_CONFIGURE=                yes (assumed if GNU_CONFIGURE is yes)
                    222: #CONFIGURE_SCRIPT=     ;;; (if other than configure)
                    223: #.if (${MACHINE_ARCH} != "alpha")
                    224: #CONFIGURE_ARGS+=      --enable-shared
                    225: #.endif
                    226: #CONFIGURE_ARGS+=      --enable-static
                    227: #CONFIGURE_ENV=                ${SETENV}
                    228:
                    229:
                    230: # Things that we don't want to do for this port/package
                    231: #
                    232: #NO_DEPENDS=           yes
                    233: #NO_WRKDIR=            yes
                    234: #NO_WRKSUBDIR=         yes
                    235: #NO_CHECKSUM=          yes
                    236: #NO_EXTRACT=           yes
                    237: #NO_PATCH=             yes
                    238: #NO_CONFIGURE=         yes
                    239: #NO_BUILD=             yes
                    240: #NO_INSTALL=           yes
                    241: #NO_MTREE=             yes
                    242: #NO_PACKAGE=           yes
                    243:
                    244: # This section is only needed if man pages are distributed in compressed
                    245: # form.  Define MANCOMPRESSED and the man pages by section.  The pages
                    246: # will be uncompressed after being installed.
                    247: #
                    248: #MANCOMPRESSED=                yes
                    249: #MAN1=                 ;;;
                    250: #MAN3=                 ;;;
                    251: #MAN4=                 ;;;
                    252: #MAN5=                 ;;;
                    253: #MAN8=                 ;;;
                    254:
                    255: # Overrides for default values
                    256: #
                    257: #MAKEFILE=             ;;;
                    258: #MAKE_FLAGS=           ;;;
                    259: #MAKE_ENV=             ;;;
                    260: #SCRIPTS_ENV=          ;;;
                    261: #LDFLAGS=              ;;;
                    262: #WRKDIR=               ;;; if other than work
                    263: #WRKSRC=               ;;; if other than ${WRKDIR}/$DISTNAME
                    264:
                    265: #ALL_TARGET=           ;;;
                    266: #INSTALL_TARGET=       ;;;
                    267:
                    268: # This target may be necessary if a shared library may have been created
                    269: #
                    270: #post-install:
                    271: #      ${LDCONFIG} -m ${PREFIX}/lib
                    272:
                    273: .include &lt;bsd.port.mk>
                    274: </pre>
                    275:   <hr>
                    276:   <a href="porting.html"><img height=24 width=24 src=back.gif
                    277:    border=0 alt=Porting></a>
                    278:   <a href=mailto:www@openbsd.org>www@openbsd.org</a>
1.2     ! marc      279:   <br><small>$OpenBSD: checklist.html,v 1.1 1998/07/30 23:04:47 marc Exp $</small>
1.1       marc      280:  </body>
                    281: </html>