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

Annotation of www/checklist.html, Revision 1.4

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"
1.3       marc        8:        CONTENT="How to make an OpenBSD port; porting checklist">
1.1       marc        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">
1.3       marc       15:   <title>OpenBSD Porting Checklist</title>
1.1       marc       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:
1.3       marc       21:   <h2><font color=#e00000>OpenBSD Porting Checklist</font></h2>
1.1       marc       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
1.3       marc       26:   find it useful. Direct any questions and/or comments to me at
1.1       marc       27:   <a href=mailto:marc@snafu.org>marc@snafu.org</a>.
                     28:   <p>
                     29:   <ol>
1.4     ! ian        30:    <li>To avoid duplication, subscribe to the ports@openbsd.org
        !            31:    mailing list - somebody may be already working on the same port as you.
        !            32:    <p>
1.1       marc       33:    <li>Create Makefile -- start with this skeleton
                     34:        <a href="#makefile">makefile</a>.
                     35:    <p>
                     36:    <li><code>make fetch</code><br>
                     37:        This verifies that the master site, distname, and extract suffix are
                     38:        correct.
                     39:    <p>
                     40:    <li><code>make makesum</code><br>
                     41:        This creates the files directory and the md5 checksum for the
                     42:        fetched files.
                     43:    <p>
                     44:    <li><code>make extract</code><br>
                     45:        Ensures that the file can be extracted into the work directory.
                     46:        This also verifies that the checksum created in step 3 is good.
                     47:    <p>
                     48:    <li>Create initial patches<br>
                     49:        When the extract is complete cd to the work directory and read
                     50:        any install docs.  You may need to modify the WRKSRC variable
                     51:        in the makefile as well as generate initial patches to configure
                     52:        for openbsd.
                     53:     <p>Note: Patches go in the directory `patches' and are names patch-xx
                     54:        where xx should be aa, ab, ..., az, ba, bb ... zz.
                     55:        <ul>
                     56:        <li>only patch one source file per patchfile, please
                     57:        <li>use diff -u to generate patches
                     58:        <li>all patches MUST be relative to ${WRKSRC}
                     59:        </ul>
                     60:    <p>
                     61:    <li><code>make patch</code><br>
                     62:        this will apply patches to the extracted sources.  If you want
                     63:        to see the output use the command:
                     64:     <p><code>make PATCH_DEBUG=YES patch</code>
                     65:     <p>The easiest way to re-run patches is to `make clean && make patch'.
                     66:        This will delete the work directory and re-extract and patch.
                     67:    <p>
                     68:    <li>add configuration options to Makefile and/or create configuration
                     69:        script.<br>
                     70:        You can add a port configuration script named `configure' to a
                     71:        directory named scripts.  This will be run before any
                     72:        configuration specified by GNU_CONFIGURE or HAS_CONFIGURE is run.
                     73:     <p>If GNU_CONFIGURE is used you may want to run ./configure --help
                     74:        to see what options are available.  Anything thay you may want to
                     75:        override can be changed by adding the --option flags to the
                     76:        CONFIGURE_ARGS parameter in the Makefile
                     77:    <p>
                     78:    <li><code>make configure</code><br>
                     79:        Peruse the output (if any) and tweak any options in the Makefile.
                     80:        To repeat issue the command `make clean && make configure'.
                     81:     <p>Note: make sure host dependent files go in /etc or /etc/<name>, but
                     82:        NEVER replace existing files in /etc.  Best to have install place
                     83:        in /usr/local/lib/<name> and then copy to /etc or /etc/<name> only
                     84:        the files do not exist.
                     85:     <p>The OpenBSD file locations are:
                     86:        <pre>
                     87:    user executables:                   /usr/local/bin
                     88:    system admin executables:           /usr/local/sbin
                     89:    program executables:                        /usr/local/libexec
                     90:    libraries                           /usr/local/lib
                     91:    architecture dependent data         /usr/local/lib/<name>
                     92:    installed include files:            /usr/local/include or
                     93:                                        /usr/local/include/<name>
                     94:    single-machine data:                        /etc or /etc/<name>
                     95:    local state:                                /var/run
                     96:    GNU info files:                     /usr/local/info
                     97:    man pages:                          /usr/local/man/...
                     98:    read-only architecture-independent: /usr/local/share/<name>
                     99:    misc documentation:                 /usr/local/share/doc/<name>
                    100:        </pre>
                    101:    <p>
                    102:    <li><code>make</code><br>
                    103:        Begin a cycle of makes until the port is ready.  Patch (see above)
                    104:        clean, and make until the port is generated.  Get rid of all warnings
                    105:        if possible, especially security related warnings.
                    106:    <p>
                    107:    <li><code>mkdir pkg; touch pkg/{DESCR,COMMENT,PLIST}</code><br>
                    108:         Create dummy versions of the package files.  Edit DESCR and COMMENT.
                    109:      <p>COMMENT is the one-line description of the port. Do NOT include the
                    110:         package name (or version number of the software) in the comment.
                    111:      <p>DESCR is a longer description of the port. One to a few paragraphs
                    112:         concisely explaining what the port does is sufficient.
                    113:      <p>PLIST is kept empty at this point.
                    114:    <p>
                    115:    <li><code>sudo make install</code><br>
                    116:        install the application.
                    117:    <p>
                    118:    <li>Create pkg/PLIST<br>
                    119:        After the install is complete use the developers command:
                    120:     <p><code>make plist</code>
                    121:     <p>which makes a the file PLIST-auto in the pkg directory.  This file
                    122:        is a candidate packing list.  Beware: the files are found by
                    123:        timestamp.  This means it does NOT:
                    124:        <ul>
                    125:         <li>list any files installed with `tar' as their timestamp
                    126:             will not change and thus won't be found by `find'
                    127:        <li>update the <code>info/dir</code> file if .info files are
                    128:            added.  You'll have to add that by hand.  Also, be sure that
                    129:            the <code>info/dir</code> is not part of the PLIST.
                    130:        <li>try to do anything special with links or symbolic links.  A
                    131:            cursory test of tar shows it does the right thing with links
                    132:            and symbolic links so I don't see why we need to special case
                    133:            anything in the packing list.  But still...
                    134:        </ul>
                    135:      <p>Peruse `PLIST-auto' and verify that everything was installed and
                    136:         that it was installed in the proper locations.  Anything not installed
                    137:        can be added to a port Makefile `post-install' rule.
                    138:      <p>Copy `PLIST-auto' to `PLIST'
                    139:    <p>
                    140:    <li>uninstall and reinstall; repeat until perfect.<br>
                    141:        <em>Perfect</em> is when everything installs and uninstalls
                    142:        in its proper location.  `pkg_delete <pkg_name>' is used to
                    143:        uninstall.  `sudo make reinstall' is used to reinstall.  See the
                    144:        `pkg_create' man page for other commands that may be added to PLIST
                    145:        to ensure all is cleaned up.  After an uninstall the command
                    146:        <p><code>find /usr/local -newer work/.install_started -print</code>
                    147:        <p>should only list standard directory names.
                    148:    <p>
                    149:    <li>Create package:<br>
                    150:        After the port installs correctly issue the command
                    151:        <code>make package</code> to create a package.  To test the
                    152:        package first do a <code>pkg_delete</code> and then do a
                    153:        <code>pkg_add</code>   The results after an add should EXACTLY
                    154:        match the results after a `make install'.
1.4     ! ian       155:    <p>
        !           156:        <LI>Distribute it!</BR>
        !           157:        Since the whole point of this process
        !           158:        is to make your ported version of the software available to
        !           159:        other OpenBSD users, you now need to disseminate it.
        !           160:        <UL>
        !           161:                <LI>First, get others to test it on a variety of
        !           162:                platforms (the DEC Alpha is good because it has only static libraries
        !           163:                and because sizeof int != sizeof long; Sun SPARC is good because it is
        !           164:                very common and because its byte order is the reverse of i386; if you
        !           165:                developed on SPARC, of course, you'd want it tested on i386).
        !           166:                <P>The ports@openbsd mailing list is a good place to find porting-savy
        !           167:                people with different platforms!
        !           168:                <LI>Incorporate any feedback you get. Test it again on your platform.
        !           169:                Get those who gave you feedback to test it again from your new port.
        !           170:                <LI>Finally, include it in the "ports" tree.
        !           171:                If you are a developer with CVS access, check it in.
        !           172:                We normally use "import" for a new port,
        !           173:                rather than adding a zillion (or a dozen) files individually.
        !           174:                Import uses "vendor branch" version numbers like 1.1.1.1, but don't worry
        !           175:                about that! :-) If you make changes to a specific file (edit, then
        !           176:                cvs commit), it will be 1.2, and that will be used.
        !           177:                <P>
        !           178:                In short, import is typically used when a port is created.
        !           179:                From that point on cvs add and cvs rm are typically used to add or remove
        !           180:                files, and the normal edit->commit cycle for changes.
        !           181:                <P>
        !           182:                You might use something like this:
        !           183:                <PRE>
        !           184: cd kaffe1
        !           185: make clean     # you really really don't want to check in all of work!
        !           186: cvs -d cvs.openbsd.org:/cvs import -m 'kaffe port' ports/lang/kaffe1 \
        !           187:        <I>YourName</I> <I>YourName_YYYY-MMM-DD</I>
        !           188:                </PRE>
        !           189:                <P>-d cvs.openbsd.org:/cvs says where cvs lives. This can be omitted if you
        !           190:                have a CVS_ROOT environment variable defined.
        !           191:                <P>-m 'kaffe port' is your login message.  Change it to whatever you like
        !           192:                <P>ports/lang/kaffe1 is the path relative to /cvs where the port lives
        !           193:                <P><I>YourName</I> (replaced with your login name) is the "vendor tag".
        !           194:                You imported it so you are the vendor.
        !           195:                <P><I>YourName_YYYY-MMM-DD</I> (e.g., ian_2000-Jan-01)
        !           196:                is the 'vendor release tag'.  This is as good as any.
        !           197:                <P>As a real example, here is the output of checking in the Kaffe1 port,
        !           198:                which one of us did on September 8, 1998:
        !           199:                <PRE>
        !           200: $ cd kaffe1
        !           201: $ make clean >/dev/null
        !           202: $ cvs import -m 'kaffe1.0(==JDK1.1) port' ports/lang/kaffe1 ian ian_1998-Sep-08
        !           203: ian@cvs.openbsd.org's password: (not shown, obviously)
        !           204: I ports/lang/kaffe1/CVS
        !           205: I ports/lang/kaffe1/files/CVS
        !           206: I ports/lang/kaffe1/pkg/CVS
        !           207: N ports/lang/kaffe1/Makefile
        !           208: cvs server: Importing /cvs/ports/lang/kaffe1/files
        !           209: N ports/lang/kaffe1/files/md5
        !           210: cvs server: Importing /cvs/ports/lang/kaffe1/pkg
        !           211: N ports/lang/kaffe1/pkg/COMMENT
        !           212: N ports/lang/kaffe1/pkg/DESCR
        !           213: N ports/lang/kaffe1/pkg/PLIST
        !           214:
        !           215: No conflicts created by this import
        !           216: $
        !           217:                </PRE>
        !           218:                <P>If you do not have CVS commit access, send mail to the ports
        !           219:                maintainers at ports@openbsd.org,
        !           220:                stating that you have a port ready to go into the tree. List the
        !           221:                name and version of the program, the platforms it's been tested on,
        !           222:                and any limitations.
        !           223:        </UL>
        !           224:   <P>
        !           225:   <LI>Maintain the port!<BR>
        !           226:   As time goes by, problems may arise, or new versions of the software
        !           227:   may be released. You should strive to keep your port up to date.
        !           228:   In other words - iterate, test, test, iterate, ...
1.1       marc      229:   </ol>
1.4     ! ian       230:   Thank you for supporting the OpenBSD "ports" process!
1.1       marc      231:   <hr>
                    232:   <a name=makefile>
                    233:   <h2><font color=#e00000>Skeleton ports makefile</font></h2>
                    234:   </a>
                    235:
                    236:   <code>;;;</code> indicates values that must be supplied by the
                    237:    porter.  Remove extraneous comments when done.
                    238: <pre>
                    239: # OpenBSD makefile for:        ;;;
                    240: # Version required:    ;;;
                    241: # Date created:                ;;;
                    242: # Whom:                        you@your.domain
                    243: #
1.4     ! ian       244: # $OpenBSD: checklist.html,v 1.3 1998/08/16 00:16:31 marc Exp $
1.1       marc      245: #
                    246:
                    247: # What port/package will be created
                    248: #
                    249: DISTNAME=              ;;;
                    250: #DIST_SUBDIR=          ;;;
                    251: #PKGNAME=              ;;;
                    252: CATEGORIES=            ;;;
                    253:
                    254: # Reasons why the port/package shouldn't be built
                    255: #
                    256: #COMES_WITH=           2.3
                    257: #ONLY_FOR_ARCHS=       list architectures here
                    258: #BROKEN=               "reason"
1.3       marc      259: #RESTRICTED=           "reason"
1.1       marc      260: #NO_CDROM=             "reason"
1.3       marc      261: #NO_PACKAGE=           "reason"
1.1       marc      262:
                    263: # where to send bitches about this port
                    264: #
                    265: MAINTAINER=            ports@openbsd.org
                    266:
                    267: # where the source files and patches can be fetched
                    268: #
                    269: MASTER_SITES=          ;;;
                    270: #MASTER_SITE_SUBDIR=   ;;;
                    271: #DISTFILES=            ;;;
                    272: #PATCH_SITES=          ;;;
                    273: #PATCHFILES=           ;;;
1.3       marc      274: #PATCH_DIST_STRIP=     -p0
1.1       marc      275:
                    276: # How to extract the sources
                    277: #
                    278: #EXTRACT_SUFX=         .tar.Z
                    279: #EXTRACT_CMD=          ;;;
                    280: #EXTRACT_BEFORE_ARGS=  ;;;
                    281: #EXTRACT_AFTER_ARGS=   ;;;
                    282:
                    283: # Dependencies
                    284: #
                    285: #FETCH_DEPENDS=                ;;;
                    286: #BUILD_DEPENDS=                ;;;
                    287: #RUN_DEPENDS=          ;;;
                    288: #LIB_DEPENDS=          ;;;
                    289:
                    290: # Is the build automagic or is it interactive
                    291: #
                    292: #IS_INTERACTIVE=       yes
                    293:
                    294: # build/configuration variables
                    295: #
                    296: #USE_GMAKE=            yes
                    297: #USE_IMAKE=            yes
                    298: #USE_X11=              yes (assumed if USE_IMAKE is yes)
                    299:
                    300: #GNU_CONFIGURE=                yes
                    301: #HAS_CONFIGURE=                yes (assumed if GNU_CONFIGURE is yes)
                    302: #CONFIGURE_SCRIPT=     ;;; (if other than configure)
                    303: #.if (${MACHINE_ARCH} != "alpha")
                    304: #CONFIGURE_ARGS+=      --enable-shared
                    305: #.endif
                    306: #CONFIGURE_ARGS+=      --enable-static
                    307: #CONFIGURE_ENV=                ${SETENV}
                    308:
                    309:
                    310: # Things that we don't want to do for this port/package
                    311: #
                    312: #NO_DEPENDS=           yes
                    313: #NO_WRKDIR=            yes
                    314: #NO_WRKSUBDIR=         yes
                    315: #NO_CHECKSUM=          yes
                    316: #NO_EXTRACT=           yes
                    317: #NO_PATCH=             yes
                    318: #NO_CONFIGURE=         yes
                    319: #NO_BUILD=             yes
                    320: #NO_INSTALL=           yes
                    321: #NO_MTREE=             yes
                    322:
                    323: # This section is only needed if man pages are distributed in compressed
                    324: # form.  Define MANCOMPRESSED and the man pages by section.  The pages
                    325: # will be uncompressed after being installed.
                    326: #
                    327: #MANCOMPRESSED=                yes
                    328: #MAN1=                 ;;;
                    329: #MAN3=                 ;;;
                    330: #MAN4=                 ;;;
                    331: #MAN5=                 ;;;
                    332: #MAN8=                 ;;;
                    333:
                    334: # Overrides for default values
                    335: #
                    336: #MAKEFILE=             ;;;
                    337: #MAKE_FLAGS=           ;;;
                    338: #MAKE_ENV=             ;;;
                    339: #SCRIPTS_ENV=          ;;;
                    340: #LDFLAGS=              ;;;
                    341: #WRKDIR=               ;;; if other than work
                    342: #WRKSRC=               ;;; if other than ${WRKDIR}/$DISTNAME
                    343:
                    344: #ALL_TARGET=           ;;;
                    345: #INSTALL_TARGET=       ;;;
                    346:
                    347: # This target may be necessary if a shared library may have been created
                    348: #
                    349: #post-install:
                    350: #      ${LDCONFIG} -m ${PREFIX}/lib
                    351:
                    352: .include &lt;bsd.port.mk>
                    353: </pre>
                    354:   <hr>
                    355:   <a href="porting.html"><img height=24 width=24 src=back.gif
                    356:    border=0 alt=Porting></a>
                    357:   <a href=mailto:www@openbsd.org>www@openbsd.org</a>
1.4     ! ian       358:   <br><small>$OpenBSD: checklist.html,v 1.3 1998/08/16 00:16:31 marc Exp $</small>
1.1       marc      359:  </body>
                    360: </html>