Annotation of www/checklist.html, Revision 1.10
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'
1.10 ! marc 161: <p>Ports that install shared libraries will need two versions of
! 162: the PLIST file. <code>PLIST</code> describes the files installed on
! 163: those architectures that support shared libraries, and
! 164: <code>PLIST.noshared</nocode> describes the files installed on
! 165: architectures that do not support shared libs. Typically,
! 166: <code>PLIST.noshared</code> is a copy of <code>PLIST</code>
! 167: less references to any shared libraries.
1.1 marc 168: <p>
169: <li>uninstall and reinstall; repeat until perfect.<br>
170: <em>Perfect</em> is when everything installs and uninstalls
171: in its proper location. `pkg_delete <pkg_name>' is used to
172: uninstall. `sudo make reinstall' is used to reinstall. See the
173: `pkg_create' man page for other commands that may be added to PLIST
174: to ensure all is cleaned up. After an uninstall the command
175: <p><code>find /usr/local -newer work/.install_started -print</code>
176: <p>should only list standard directory names.
177: <p>
178: <li>Create package:<br>
179: After the port installs correctly issue the command
180: <code>make package</code> to create a package. To test the
181: package first do a <code>pkg_delete</code> and then do a
182: <code>pkg_add</code> The results after an add should EXACTLY
183: match the results after a `make install'.
1.4 ian 184: <p>
185: <LI>Distribute it!</BR>
186: Since the whole point of this process
187: is to make your ported version of the software available to
188: other OpenBSD users, you now need to disseminate it.
189: <UL>
190: <LI>First, get others to test it on a variety of
191: platforms (the DEC Alpha is good because it has only static libraries
192: and because sizeof int != sizeof long; Sun SPARC is good because it is
193: very common and because its byte order is the reverse of i386; if you
194: developed on SPARC, of course, you'd want it tested on i386).
195: <P>The ports@openbsd mailing list is a good place to find porting-savy
196: people with different platforms!
197: <LI>Incorporate any feedback you get. Test it again on your platform.
198: Get those who gave you feedback to test it again from your new port.
199: <LI>Finally, include it in the "ports" tree.
200: If you are a developer with CVS access, check it in.
201: We normally use "import" for a new port,
202: rather than adding a zillion (or a dozen) files individually.
203: Import uses "vendor branch" version numbers like 1.1.1.1, but don't worry
204: about that! :-) If you make changes to a specific file (edit, then
205: cvs commit), it will be 1.2, and that will be used.
206: <P>
207: In short, import is typically used when a port is created.
208: From that point on cvs add and cvs rm are typically used to add or remove
209: files, and the normal edit->commit cycle for changes.
210: <P>
211: You might use something like this:
212: <PRE>
213: cd kaffe1
214: make clean # you really really don't want to check in all of work!
215: cvs -d cvs.openbsd.org:/cvs import -m 'kaffe port' ports/lang/kaffe1 \
216: <I>YourName</I> <I>YourName_YYYY-MMM-DD</I>
217: </PRE>
218: <P>-d cvs.openbsd.org:/cvs says where cvs lives. This can be omitted if you
219: have a CVS_ROOT environment variable defined.
220: <P>-m 'kaffe port' is your login message. Change it to whatever you like
221: <P>ports/lang/kaffe1 is the path relative to /cvs where the port lives
222: <P><I>YourName</I> (replaced with your login name) is the "vendor tag".
223: You imported it so you are the vendor.
224: <P><I>YourName_YYYY-MMM-DD</I> (e.g., ian_2000-Jan-01)
225: is the 'vendor release tag'. This is as good as any.
226: <P>As a real example, here is the output of checking in the Kaffe1 port,
227: which one of us did on September 8, 1998:
228: <PRE>
229: $ cd kaffe1
230: $ make clean >/dev/null
231: $ cvs import -m 'kaffe1.0(==JDK1.1) port' ports/lang/kaffe1 ian ian_1998-Sep-08
232: ian@cvs.openbsd.org's password: (not shown, obviously)
233: I ports/lang/kaffe1/CVS
234: I ports/lang/kaffe1/files/CVS
235: I ports/lang/kaffe1/pkg/CVS
236: N ports/lang/kaffe1/Makefile
237: cvs server: Importing /cvs/ports/lang/kaffe1/files
238: N ports/lang/kaffe1/files/md5
239: cvs server: Importing /cvs/ports/lang/kaffe1/pkg
240: N ports/lang/kaffe1/pkg/COMMENT
241: N ports/lang/kaffe1/pkg/DESCR
242: N ports/lang/kaffe1/pkg/PLIST
243:
244: No conflicts created by this import
245: $
246: </PRE>
1.5 ian 247: <P>Last but not least, add a one-line entry for the new port
248: in its parent directory's makefile, i.e., for ports/lang/kaffe1,
249: add it to ports/lang/Makefile.
1.4 ian 250: <P>If you do not have CVS commit access, send mail to the ports
251: maintainers at ports@openbsd.org,
252: stating that you have a port ready to go into the tree. List the
253: name and version of the program, the platforms it's been tested on,
254: and any limitations.
255: </UL>
256: <P>
257: <LI>Maintain the port!<BR>
258: As time goes by, problems may arise, or new versions of the software
259: may be released. You should strive to keep your port up to date.
260: In other words - iterate, test, test, iterate, ...
1.1 marc 261: </ol>
1.4 ian 262: Thank you for supporting the OpenBSD "ports" process!
1.1 marc 263: <hr>
264: <a name=makefile>
265: <h2><font color=#e00000>Skeleton ports makefile</font></h2>
266: </a>
267:
268: <code>;;;</code> indicates values that must be supplied by the
1.8 marc 269: porter. <strong>Remove extraneous comments when done.</strong>
1.1 marc 270: <pre>
1.10 ! marc 271: # $OpenBSD: checklist.html,v 1.9 1998/12/21 23:30:59 espie Exp $
1.1 marc 272: #
273:
274: # What port/package will be created
275: #
276: DISTNAME= ;;;
277: #DIST_SUBDIR= ;;;
278: #PKGNAME= ;;;
279: CATEGORIES= ;;;
280:
281: # Reasons why the port/package shouldn't be built
282: #
283: #COMES_WITH= 2.3
284: #ONLY_FOR_ARCHS= list architectures here
285: #BROKEN= "reason"
1.8 marc 286: #NO_CDROM= "reason"
1.3 marc 287: #RESTRICTED= "reason"
1.8 marc 288: #MIRROR_DISTFILE= no
1.1 marc 289:
290: # where to send bitches about this port
291: #
292: MAINTAINER= ports@openbsd.org
293:
294: # where the source files and patches can be fetched
295: #
296: MASTER_SITES= ;;;
297: #MASTER_SITE_SUBDIR= ;;;
298: #DISTFILES= ;;;
299: #PATCH_SITES= ;;;
300: #PATCHFILES= ;;;
1.3 marc 301: #PATCH_DIST_STRIP= -p0
1.1 marc 302: #EXTRACT_SUFX= .tar.Z
303: #EXTRACT_CMD= ;;;
304: #EXTRACT_BEFORE_ARGS= ;;;
305: #EXTRACT_AFTER_ARGS= ;;;
306:
307: # Dependencies
308: #
309: #FETCH_DEPENDS= ;;;
310: #BUILD_DEPENDS= ;;;
311: #RUN_DEPENDS= ;;;
312: #LIB_DEPENDS= ;;;
313:
314: # Is the build automagic or is it interactive
315: #
316: #IS_INTERACTIVE= yes
317:
318: # build/configuration variables
319: #
1.10 ! marc 320: #USE_EGCC= yes
! 321: #USE_EGXX= yes
1.1 marc 322: #USE_GMAKE= yes
323: #USE_IMAKE= yes
324: #USE_X11= yes (assumed if USE_IMAKE is yes)
1.8 marc 325: #USE_AUTOCONF= yes
326: #GNU_CONFIGURE= yes (assumed if USE_AUTOCONF is yes)
1.1 marc 327: #HAS_CONFIGURE= yes (assumed if GNU_CONFIGURE is yes)
328: #CONFIGURE_SCRIPT= ;;; (if other than configure)
1.10 ! marc 329: #.if !defined(NO_SHARED_LIBS)
1.1 marc 330: #CONFIGURE_ARGS+= --enable-shared
331: #.endif
332: #CONFIGURE_ARGS+= --enable-static
1.8 marc 333: #CONFIGURE_ENV= ;;;
1.1 marc 334:
335: # Things that we don't want to do for this port/package
336: #
337: #NO_DEPENDS= yes
338: #NO_WRKDIR= yes
339: #NO_WRKSUBDIR= yes
340: #NO_CHECKSUM= yes
341: #NO_EXTRACT= yes
342: #NO_PATCH= yes
343: #NO_CONFIGURE= yes
344: #NO_BUILD= yes
345: #NO_INSTALL= yes
346: #NO_MTREE= yes
1.8 marc 347: #NO_PACKAGE= yes
348: #NO_PKG_REGISTER= yes
1.1 marc 349:
350: # This section is only needed if man pages are distributed in compressed
351: # form. Define MANCOMPRESSED and the man pages by section. The pages
352: # will be uncompressed after being installed.
353: #
354: #MANCOMPRESSED= yes
355: #MAN1= ;;;
356: #MAN3= ;;;
357: #MAN4= ;;;
358: #MAN5= ;;;
359: #MAN8= ;;;
360:
361: # Overrides for default values
362: #
363: #MAKEFILE= ;;;
364: #MAKE_FLAGS= ;;;
365: #MAKE_ENV= ;;;
366: #SCRIPTS_ENV= ;;;
367: #LDFLAGS= ;;;
368: #WRKDIR= ;;; if other than work
369: #WRKSRC= ;;; if other than ${WRKDIR}/$DISTNAME
370:
371: #ALL_TARGET= ;;;
372: #INSTALL_TARGET= ;;;
373:
374: # This target may be necessary if a shared library may have been created
375: #
376: #post-install:
377: # ${LDCONFIG} -m ${PREFIX}/lib
378:
379: .include <bsd.port.mk>
380: </pre>
381: <hr>
382: <a href="porting.html"><img height=24 width=24 src=back.gif
383: border=0 alt=Porting></a>
384: <a href=mailto:www@openbsd.org>www@openbsd.org</a>
1.10 ! marc 385: <br><small>$OpenBSD: checklist.html,v 1.9 1998/12/21 23:30:59 espie Exp $</small>
1.1 marc 386: </body>
387: </html>