Annotation of www/checklist.html, Revision 1.9
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>
1.7 espie 65: <p>The easiest way to re-run patches is to `make clean && make patch'.
1.1 marc 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.
1.7 espie 80: To repeat issue the command `make clean && make configure'.
1.1 marc 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:
1.9 ! espie 86:
1.1 marc 87: <pre>
88: user executables: /usr/local/bin
89: system admin executables: /usr/local/sbin
90: program executables: /usr/local/libexec
91: libraries /usr/local/lib
92: architecture dependent data /usr/local/lib/<name>
93: installed include files: /usr/local/include or
94: /usr/local/include/<name>
95: single-machine data: /etc or /etc/<name>
96: local state: /var/run
97: GNU info files: /usr/local/info
98: man pages: /usr/local/man/...
99: read-only architecture-independent: /usr/local/share/<name>
100: misc documentation: /usr/local/share/doc/<name>
101: </pre>
1.9 ! espie 102:
1.1 marc 103: <p>
104: <li><code>make</code><br>
105: Begin a cycle of makes until the port is ready. Patch (see above)
106: clean, and make until the port is generated. Get rid of all warnings
107: if possible, especially security related warnings.
108: <p>
109: <li><code>mkdir pkg; touch pkg/{DESCR,COMMENT,PLIST}</code><br>
110: Create dummy versions of the package files. Edit DESCR and COMMENT.
1.7 espie 111: <p>COMMENT is a <strong>SHORT</strong> one-line description of the port
112: (max. 60 characters). Do NOT include the
1.1 marc 113: package name (or version number of the software) in the comment.
114: <p>DESCR is a longer description of the port. One to a few paragraphs
115: concisely explaining what the port does is sufficient.
116: <p>PLIST is kept empty at this point.
117: <p>
118: <li><code>sudo make install</code><br>
119: install the application.
120: <p>
1.9 ! espie 121: <li><strong>Check port for security holes again</strong>. This is
! 122: especially important for network and setuid programs. See
! 123: <a href="porting.html#security">our security recommendations</a>
! 124: for that. Log interesting stuff and fixes in the
! 125: <code>pkg/SECURITY</code> file. This file
! 126: should list audited potential problems, along with relevant patches,
! 127: so that another person can see at first glance what has been done.
! 128: Example:
! 129: <pre>
! 130:
! 131: $OpenBDS$
! 132:
! 133: ${WRKDIR}/receiver.c
! 134: call to mktemp (wrapper function do_mktemp) does seem to be correct.
! 135:
! 136: The server makes extensive use of strlcpy/strlcat/snprintf.
! 137:
! 138: </pre>
! 139:
1.1 marc 140: <li>Create pkg/PLIST<br>
141: After the install is complete use the developers command:
142: <p><code>make plist</code>
143: <p>which makes a the file PLIST-auto in the pkg directory. This file
144: is a candidate packing list. Beware: the files are found by
145: timestamp. This means it does NOT:
146: <ul>
147: <li>list any files installed with `tar' as their timestamp
148: will not change and thus won't be found by `find'
149: <li>update the <code>info/dir</code> file if .info files are
150: added. You'll have to add that by hand. Also, be sure that
151: the <code>info/dir</code> is not part of the PLIST.
152: <li>try to do anything special with links or symbolic links. A
153: cursory test of tar shows it does the right thing with links
154: and symbolic links so I don't see why we need to special case
155: anything in the packing list. But still...
156: </ul>
157: <p>Peruse `PLIST-auto' and verify that everything was installed and
158: that it was installed in the proper locations. Anything not installed
159: can be added to a port Makefile `post-install' rule.
160: <p>Copy `PLIST-auto' to `PLIST'
161: <p>
162: <li>uninstall and reinstall; repeat until perfect.<br>
163: <em>Perfect</em> is when everything installs and uninstalls
164: in its proper location. `pkg_delete <pkg_name>' is used to
165: uninstall. `sudo make reinstall' is used to reinstall. See the
166: `pkg_create' man page for other commands that may be added to PLIST
167: to ensure all is cleaned up. After an uninstall the command
168: <p><code>find /usr/local -newer work/.install_started -print</code>
169: <p>should only list standard directory names.
170: <p>
171: <li>Create package:<br>
172: After the port installs correctly issue the command
173: <code>make package</code> to create a package. To test the
174: package first do a <code>pkg_delete</code> and then do a
175: <code>pkg_add</code> The results after an add should EXACTLY
176: match the results after a `make install'.
1.4 ian 177: <p>
178: <LI>Distribute it!</BR>
179: Since the whole point of this process
180: is to make your ported version of the software available to
181: other OpenBSD users, you now need to disseminate it.
182: <UL>
183: <LI>First, get others to test it on a variety of
184: platforms (the DEC Alpha is good because it has only static libraries
185: and because sizeof int != sizeof long; Sun SPARC is good because it is
186: very common and because its byte order is the reverse of i386; if you
187: developed on SPARC, of course, you'd want it tested on i386).
188: <P>The ports@openbsd mailing list is a good place to find porting-savy
189: people with different platforms!
190: <LI>Incorporate any feedback you get. Test it again on your platform.
191: Get those who gave you feedback to test it again from your new port.
192: <LI>Finally, include it in the "ports" tree.
193: If you are a developer with CVS access, check it in.
194: We normally use "import" for a new port,
195: rather than adding a zillion (or a dozen) files individually.
196: Import uses "vendor branch" version numbers like 1.1.1.1, but don't worry
197: about that! :-) If you make changes to a specific file (edit, then
198: cvs commit), it will be 1.2, and that will be used.
199: <P>
200: In short, import is typically used when a port is created.
201: From that point on cvs add and cvs rm are typically used to add or remove
202: files, and the normal edit->commit cycle for changes.
203: <P>
204: You might use something like this:
205: <PRE>
206: cd kaffe1
207: make clean # you really really don't want to check in all of work!
208: cvs -d cvs.openbsd.org:/cvs import -m 'kaffe port' ports/lang/kaffe1 \
209: <I>YourName</I> <I>YourName_YYYY-MMM-DD</I>
210: </PRE>
211: <P>-d cvs.openbsd.org:/cvs says where cvs lives. This can be omitted if you
212: have a CVS_ROOT environment variable defined.
213: <P>-m 'kaffe port' is your login message. Change it to whatever you like
214: <P>ports/lang/kaffe1 is the path relative to /cvs where the port lives
215: <P><I>YourName</I> (replaced with your login name) is the "vendor tag".
216: You imported it so you are the vendor.
217: <P><I>YourName_YYYY-MMM-DD</I> (e.g., ian_2000-Jan-01)
218: is the 'vendor release tag'. This is as good as any.
219: <P>As a real example, here is the output of checking in the Kaffe1 port,
220: which one of us did on September 8, 1998:
221: <PRE>
222: $ cd kaffe1
223: $ make clean >/dev/null
224: $ cvs import -m 'kaffe1.0(==JDK1.1) port' ports/lang/kaffe1 ian ian_1998-Sep-08
225: ian@cvs.openbsd.org's password: (not shown, obviously)
226: I ports/lang/kaffe1/CVS
227: I ports/lang/kaffe1/files/CVS
228: I ports/lang/kaffe1/pkg/CVS
229: N ports/lang/kaffe1/Makefile
230: cvs server: Importing /cvs/ports/lang/kaffe1/files
231: N ports/lang/kaffe1/files/md5
232: cvs server: Importing /cvs/ports/lang/kaffe1/pkg
233: N ports/lang/kaffe1/pkg/COMMENT
234: N ports/lang/kaffe1/pkg/DESCR
235: N ports/lang/kaffe1/pkg/PLIST
236:
237: No conflicts created by this import
238: $
239: </PRE>
1.5 ian 240: <P>Last but not least, add a one-line entry for the new port
241: in its parent directory's makefile, i.e., for ports/lang/kaffe1,
242: add it to ports/lang/Makefile.
1.4 ian 243: <P>If you do not have CVS commit access, send mail to the ports
244: maintainers at ports@openbsd.org,
245: stating that you have a port ready to go into the tree. List the
246: name and version of the program, the platforms it's been tested on,
247: and any limitations.
248: </UL>
249: <P>
250: <LI>Maintain the port!<BR>
251: As time goes by, problems may arise, or new versions of the software
252: may be released. You should strive to keep your port up to date.
253: In other words - iterate, test, test, iterate, ...
1.1 marc 254: </ol>
1.4 ian 255: Thank you for supporting the OpenBSD "ports" process!
1.1 marc 256: <hr>
257: <a name=makefile>
258: <h2><font color=#e00000>Skeleton ports makefile</font></h2>
259: </a>
260:
261: <code>;;;</code> indicates values that must be supplied by the
1.8 marc 262: porter. <strong>Remove extraneous comments when done.</strong>
1.1 marc 263: <pre>
1.9 ! espie 264: # $OpenBSD: checklist.html,v 1.8 1998/12/03 06:09:17 marc Exp $
1.1 marc 265: #
266:
267: # What port/package will be created
268: #
269: DISTNAME= ;;;
270: #DIST_SUBDIR= ;;;
271: #PKGNAME= ;;;
272: CATEGORIES= ;;;
273:
274: # Reasons why the port/package shouldn't be built
275: #
276: #COMES_WITH= 2.3
277: #ONLY_FOR_ARCHS= list architectures here
278: #BROKEN= "reason"
1.8 marc 279: #NO_CDROM= "reason"
1.3 marc 280: #RESTRICTED= "reason"
1.8 marc 281: #MIRROR_DISTFILE= no
1.1 marc 282:
283: # where to send bitches about this port
284: #
285: MAINTAINER= ports@openbsd.org
286:
287: # where the source files and patches can be fetched
288: #
289: MASTER_SITES= ;;;
290: #MASTER_SITE_SUBDIR= ;;;
291: #DISTFILES= ;;;
292: #PATCH_SITES= ;;;
293: #PATCHFILES= ;;;
1.3 marc 294: #PATCH_DIST_STRIP= -p0
1.1 marc 295: #EXTRACT_SUFX= .tar.Z
296: #EXTRACT_CMD= ;;;
297: #EXTRACT_BEFORE_ARGS= ;;;
298: #EXTRACT_AFTER_ARGS= ;;;
299:
300: # Dependencies
301: #
302: #FETCH_DEPENDS= ;;;
303: #BUILD_DEPENDS= ;;;
304: #RUN_DEPENDS= ;;;
305: #LIB_DEPENDS= ;;;
306:
307: # Is the build automagic or is it interactive
308: #
309: #IS_INTERACTIVE= yes
310:
311: # build/configuration variables
312: #
313: #USE_GMAKE= yes
314: #USE_IMAKE= yes
315: #USE_X11= yes (assumed if USE_IMAKE is yes)
1.8 marc 316: #USE_AUTOCONF= yes
317: #GNU_CONFIGURE= yes (assumed if USE_AUTOCONF is yes)
1.1 marc 318: #HAS_CONFIGURE= yes (assumed if GNU_CONFIGURE is yes)
319: #CONFIGURE_SCRIPT= ;;; (if other than configure)
320: #.if (${MACHINE_ARCH} != "alpha")
321: #CONFIGURE_ARGS+= --enable-shared
322: #.endif
323: #CONFIGURE_ARGS+= --enable-static
1.8 marc 324: #CONFIGURE_ENV= ;;;
1.1 marc 325:
326: # Things that we don't want to do for this port/package
327: #
328: #NO_DEPENDS= yes
329: #NO_WRKDIR= yes
330: #NO_WRKSUBDIR= yes
331: #NO_CHECKSUM= yes
332: #NO_EXTRACT= yes
333: #NO_PATCH= yes
334: #NO_CONFIGURE= yes
335: #NO_BUILD= yes
336: #NO_INSTALL= yes
337: #NO_MTREE= yes
1.8 marc 338: #NO_PACKAGE= yes
339: #NO_PKG_REGISTER= yes
1.1 marc 340:
341: # This section is only needed if man pages are distributed in compressed
342: # form. Define MANCOMPRESSED and the man pages by section. The pages
343: # will be uncompressed after being installed.
344: #
345: #MANCOMPRESSED= yes
346: #MAN1= ;;;
347: #MAN3= ;;;
348: #MAN4= ;;;
349: #MAN5= ;;;
350: #MAN8= ;;;
351:
352: # Overrides for default values
353: #
354: #MAKEFILE= ;;;
355: #MAKE_FLAGS= ;;;
356: #MAKE_ENV= ;;;
357: #SCRIPTS_ENV= ;;;
358: #LDFLAGS= ;;;
359: #WRKDIR= ;;; if other than work
360: #WRKSRC= ;;; if other than ${WRKDIR}/$DISTNAME
361:
362: #ALL_TARGET= ;;;
363: #INSTALL_TARGET= ;;;
364:
365: # This target may be necessary if a shared library may have been created
366: #
367: #post-install:
368: # ${LDCONFIG} -m ${PREFIX}/lib
369:
370: .include <bsd.port.mk>
371: </pre>
372: <hr>
373: <a href="porting.html"><img height=24 width=24 src=back.gif
374: border=0 alt=Porting></a>
375: <a href=mailto:www@openbsd.org>www@openbsd.org</a>
1.9 ! espie 376: <br><small>$OpenBSD: checklist.html,v 1.8 1998/12/03 06:09:17 marc Exp $</small>
1.1 marc 377: </body>
378: </html>