Annotation of www/checklist.html, Revision 1.14
1.14 ! rohee 1: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
1.1 marc 2: <html>
3: <head>
4: <meta http-equiv="Content-Type"
5: content="text/html; charset=iso-8859-1">
6: <meta name="resource-type"
7: content="document">
8: <meta name="description"
1.3 marc 9: CONTENT="How to make an OpenBSD port; porting checklist">
1.1 marc 10: <meta name="keywords"
11: content="openbsd,ports">
12: <meta name="distribution"
13: content="global">
14: <meta name="copyright"
15: content="This document copyright 1998 by the OpenBSD project">
1.3 marc 16: <title>OpenBSD Porting Checklist</title>
1.1 marc 17: <link rev="made" HREF="mailto:www@openbsd.org">
18: </head>
19: <body text="#000000" bgcolor="#FFFFFF" link="#23238E">
20: <img height=30 width=141 src=images/smalltitle.gif alt="[OpenBSD]" >
21:
1.14 ! rohee 22: <h2><font color="#e00000">OpenBSD Porting Checklist</font></h2>
1.1 marc 23:
24: I use this checklist as a reminder of things to do when creating
25: new ports and when validating old ports. I don't claim this list
26: is totally accurate, much less perfect, but only hope that some
1.3 marc 27: find it useful. Direct any questions and/or comments to me at
1.14 ! rohee 28: <a href="mailto:marc@snafu.org">marc@snafu.org</a>.
1.1 marc 29: <p>
30: <ol>
1.4 ian 31: <li>To avoid duplication, subscribe to the ports@openbsd.org
32: mailing list - somebody may be already working on the same port as you.
33: <p>
1.11 marc 34: <li>Create Makefile -- start with the provided Makefile template
35: <code>/usr/ports/Makefile.template</code>. This file can
36: be retrieved from any of the anoncvs servers or via the
1.14 ! rohee 37: OpenBSD cvs/web source browser system
1.11 marc 38: <a href="http://www.openbsd.org/cgi-bin/cvsweb/">http://www.openbsd.org/cgi-bin/cvsweb/</a>.
1.1 marc 39: <p>
40: <li><code>make fetch</code><br>
41: This verifies that the master site, distname, and extract suffix are
42: correct.
43: <p>
44: <li><code>make makesum</code><br>
45: This creates the files directory and the md5 checksum for the
46: fetched files.
47: <p>
48: <li><code>make extract</code><br>
49: Ensures that the file can be extracted into the work directory.
1.14 ! rohee 50: This also verifies that the checksum created in step 4 is good.
1.1 marc 51: <p>
52: <li>Create initial patches<br>
53: When the extract is complete cd to the work directory and read
54: any install docs. You may need to modify the WRKSRC variable
55: in the makefile as well as generate initial patches to configure
1.14 ! rohee 56: for OpenBSD.
1.1 marc 57: <p>Note: Patches go in the directory `patches' and are names patch-xx
58: where xx should be aa, ab, ..., az, ba, bb ... zz.
59: <ul>
60: <li>only patch one source file per patchfile, please
61: <li>use diff -u to generate patches
62: <li>all patches MUST be relative to ${WRKSRC}
1.14 ! rohee 63: <li>add a small explaination of the patch role in the patchfile before
! 64: the patch itself, and an OpenBSD CVS tag
! 65: <code>$OpenBSD$</code>
1.1 marc 66: </ul>
67: <p>
68: <li><code>make patch</code><br>
69: this will apply patches to the extracted sources. If you want
70: to see the output use the command:
71: <p><code>make PATCH_DEBUG=YES patch</code>
1.7 espie 72: <p>The easiest way to re-run patches is to `make clean && make patch'.
1.1 marc 73: This will delete the work directory and re-extract and patch.
74: <p>
75: <li>add configuration options to Makefile and/or create configuration
76: script.<br>
77: You can add a port configuration script named `configure' to a
78: directory named scripts. This will be run before any
79: configuration specified by GNU_CONFIGURE or HAS_CONFIGURE is run.
80: <p>If GNU_CONFIGURE is used you may want to run ./configure --help
1.14 ! rohee 81: to see what options are available. Anything that you may want to
1.1 marc 82: override can be changed by adding the --option flags to the
83: CONFIGURE_ARGS parameter in the Makefile
84: <p>
1.12 espie 85: <li>try setting <code>SEPARATE_BUILD</code><br>
86: If the port can build with object files outside its source tree,
87: this is cleaner (many programs using <code>GNU_CONFIGURE</code> can),
88: and may help people who mount their ports tree on several arches.
89: This can also spare you some effort, as you will possibly be able to
90: restart the cycle at <code>configure</code> most of the time.
91: <p>
1.1 marc 92: <li><code>make configure</code><br>
93: Peruse the output (if any) and tweak any options in the Makefile.
1.14 ! rohee 94: To repeat issue the command
! 95: `<code>make clean && make configure</code>'.
! 96: <p>Note: make sure host dependent files go in <code>/etc</code> or
! 97: <code>/etc/<name></code>, but NEVER replace existing files
! 98: in <code>/etc</code>. Best to have install place
! 99: in <code>/usr/local/lib/<name></code> and then copy to
! 100: <code>/etc</code> or
! 101: <code>/etc/<name></code> only if the files do not exist.
1.1 marc 102: <p>The OpenBSD file locations are:
1.9 espie 103:
1.1 marc 104: <pre>
105: user executables: /usr/local/bin
106: system admin executables: /usr/local/sbin
107: program executables: /usr/local/libexec
108: libraries /usr/local/lib
1.14 ! rohee 109: architecture dependent data /usr/local/lib/<name>
1.1 marc 110: installed include files: /usr/local/include or
1.14 ! rohee 111: /usr/local/include/<name>
! 112: single-machine data: /etc or /etc/<name>
1.1 marc 113: local state: /var/run
114: GNU info files: /usr/local/info
115: man pages: /usr/local/man/...
1.14 ! rohee 116: read-only architecture-independent: /usr/local/share/<name>
! 117: misc documentation: /usr/local/share/doc/<name>
1.1 marc 118: </pre>
1.9 espie 119:
1.1 marc 120: <p>
121: <li><code>make</code><br>
122: Begin a cycle of makes until the port is ready. Patch (see above)
123: clean, and make until the port is generated. Get rid of all warnings
124: if possible, especially security related warnings.
125: <p>
1.12 espie 126: <li>Control <code>SEPARATE_BUILD</code> semantics<br>
127: You have to do this only if the port builds with
128: <code>SEPARATE_BUILD</code> defined.
129: Ideally, the port should no longer modify any file in
130: <code>${WRKSRC}</code> after <code>make patch</code>.
131: You can check this by making sure you don't have any write access
132: to <code>${WRKSRC}</code>. Then you can set
133: <code>SEPARATE_BUILD=concurrent</code>: someone can use the same
134: source tree to build on distinct arches simultaneously.
135: Otherwise, set <code>SEPARATE_BUILD=simple</code>: building on
136: distinct arches simultaneously may meet with problems, as some
137: source files may be regenerated at awkward moments.
138: <p>
1.1 marc 139: <li><code>mkdir pkg; touch pkg/{DESCR,COMMENT,PLIST}</code><br>
140: Create dummy versions of the package files. Edit DESCR and COMMENT.
1.7 espie 141: <p>COMMENT is a <strong>SHORT</strong> one-line description of the port
1.14 ! rohee 142: (max. 60 characters). Do NOT include the package name (or version number
! 143: of the software) in the comment. Do NOT start by an uppercase letter
! 144: unless semantically significant, do NOT end by a dot.
1.1 marc 145: <p>DESCR is a longer description of the port. One to a few paragraphs
146: concisely explaining what the port does is sufficient.
147: <p>PLIST is kept empty at this point.
148: <p>
149: <li><code>sudo make install</code><br>
150: install the application.
151: <p>
1.9 espie 152: <li><strong>Check port for security holes again</strong>. This is
153: especially important for network and setuid programs. See
154: <a href="porting.html#security">our security recommendations</a>
155: for that. Log interesting stuff and fixes in the
156: <code>pkg/SECURITY</code> file. This file
157: should list audited potential problems, along with relevant patches,
158: so that another person can see at first glance what has been done.
159: Example:
160:
1.14 ! rohee 161: <pre>
! 162: $OpenBSD$
1.9 espie 163:
164: ${WRKDIR}/receiver.c
165: call to mktemp (wrapper function do_mktemp) does seem to be correct.
166:
167: The server makes extensive use of strlcpy/strlcat/snprintf.
168:
169: </pre>
170:
1.1 marc 171: <li>Create pkg/PLIST<br>
172: After the install is complete use the developers command:
173: <p><code>make plist</code>
174: <p>which makes a the file PLIST-auto in the pkg directory. This file
175: is a candidate packing list. Beware: the files are found by
176: timestamp. This means it does NOT:
177: <ul>
178: <li>list any files installed with `tar' as their timestamp
179: will not change and thus won't be found by `find'
180: <li>update the <code>info/dir</code> file if .info files are
181: added. You'll have to add that by hand. Also, be sure that
182: the <code>info/dir</code> is not part of the PLIST.
183: <li>try to do anything special with links or symbolic links. A
184: cursory test of tar shows it does the right thing with links
185: and symbolic links so I don't see why we need to special case
186: anything in the packing list. But still...
187: </ul>
188: <p>Peruse `PLIST-auto' and verify that everything was installed and
189: that it was installed in the proper locations. Anything not installed
190: can be added to a port Makefile `post-install' rule.
191: <p>Copy `PLIST-auto' to `PLIST'
1.10 marc 192: <p>Ports that install shared libraries will need two versions of
193: the PLIST file. <code>PLIST</code> describes the files installed on
194: those architectures that support shared libraries, and
1.13 wvdputte 195: <code>PLIST.noshared</code> describes the files installed on
1.10 marc 196: architectures that do not support shared libs. Typically,
197: <code>PLIST.noshared</code> is a copy of <code>PLIST</code>
198: less references to any shared libraries.
1.1 marc 199: <p>
200: <li>uninstall and reinstall; repeat until perfect.<br>
201: <em>Perfect</em> is when everything installs and uninstalls
1.14 ! rohee 202: in its proper location. `<code>pkg_delete <pkg_name></code>' is
! 203: used to uninstall. `sudo make reinstall' is used to reinstall. See the
! 204: `<code>pkg_create</code>' man page for other commands that may be added
! 205: to PLIST to ensure all is cleaned up. After an uninstall the command
1.1 marc 206: <p><code>find /usr/local -newer work/.install_started -print</code>
207: <p>should only list standard directory names.
208: <p>
209: <li>Create package:<br>
210: After the port installs correctly issue the command
211: <code>make package</code> to create a package. To test the
212: package first do a <code>pkg_delete</code> and then do a
213: <code>pkg_add</code> The results after an add should EXACTLY
214: match the results after a `make install'.
1.4 ian 215: <p>
1.14 ! rohee 216: <li>Distribute it!<br>
1.4 ian 217: Since the whole point of this process
218: is to make your ported version of the software available to
219: other OpenBSD users, you now need to disseminate it.
1.14 ! rohee 220: <ul>
! 221: <li>First, get others to test it on a variety of
! 222: platforms (the DEC Alpha is good because it has only static libraries
1.4 ian 223: and because sizeof int != sizeof long; Sun SPARC is good because it is
224: very common and because its byte order is the reverse of i386; if you
1.14 ! rohee 225: developed on SPARC, of course, y ou'd want it tested on i386).
1.4 ian 226: <P>The ports@openbsd mailing list is a good place to find porting-savy
227: people with different platforms!
1.14 ! rohee 228: <li>Incorporate any feedback you get. Test it again on your platform.
1.4 ian 229: Get those who gave you feedback to test it again from your new port.
1.14 ! rohee 230: <li>Finally, include it in the "ports" tree.
1.4 ian 231: If you are a developer with CVS access, check it in.
232: We normally use "import" for a new port,
233: rather than adding a zillion (or a dozen) files individually.
234: Import uses "vendor branch" version numbers like 1.1.1.1, but don't worry
235: about that! :-) If you make changes to a specific file (edit, then
236: cvs commit), it will be 1.2, and that will be used.
237: <P>
238: In short, import is typically used when a port is created.
239: From that point on cvs add and cvs rm are typically used to add or remove
240: files, and the normal edit->commit cycle for changes.
241: <P>
242: You might use something like this:
1.14 ! rohee 243: <pre>
1.4 ian 244: cd kaffe1
245: make clean # you really really don't want to check in all of work!
246: cvs -d cvs.openbsd.org:/cvs import -m 'kaffe port' ports/lang/kaffe1 \
247: <I>YourName</I> <I>YourName_YYYY-MMM-DD</I>
1.14 ! rohee 248: </pre>
1.4 ian 249: <P>-d cvs.openbsd.org:/cvs says where cvs lives. This can be omitted if you
250: have a CVS_ROOT environment variable defined.
251: <P>-m 'kaffe port' is your login message. Change it to whatever you like
252: <P>ports/lang/kaffe1 is the path relative to /cvs where the port lives
253: <P><I>YourName</I> (replaced with your login name) is the "vendor tag".
254: You imported it so you are the vendor.
255: <P><I>YourName_YYYY-MMM-DD</I> (e.g., ian_2000-Jan-01)
256: is the 'vendor release tag'. This is as good as any.
257: <P>As a real example, here is the output of checking in the Kaffe1 port,
258: which one of us did on September 8, 1998:
1.14 ! rohee 259: <pre>
1.4 ian 260: $ cd kaffe1
261: $ make clean >/dev/null
262: $ cvs import -m 'kaffe1.0(==JDK1.1) port' ports/lang/kaffe1 ian ian_1998-Sep-08
263: ian@cvs.openbsd.org's password: (not shown, obviously)
264: I ports/lang/kaffe1/CVS
265: I ports/lang/kaffe1/files/CVS
266: I ports/lang/kaffe1/pkg/CVS
267: N ports/lang/kaffe1/Makefile
268: cvs server: Importing /cvs/ports/lang/kaffe1/files
269: N ports/lang/kaffe1/files/md5
270: cvs server: Importing /cvs/ports/lang/kaffe1/pkg
271: N ports/lang/kaffe1/pkg/COMMENT
272: N ports/lang/kaffe1/pkg/DESCR
273: N ports/lang/kaffe1/pkg/PLIST
274:
275: No conflicts created by this import
276: $
1.14 ! rohee 277: </pre>
1.5 ian 278: <P>Last but not least, add a one-line entry for the new port
279: in its parent directory's makefile, i.e., for ports/lang/kaffe1,
280: add it to ports/lang/Makefile.
1.4 ian 281: <P>If you do not have CVS commit access, send mail to the ports
282: maintainers at ports@openbsd.org,
283: stating that you have a port ready to go into the tree. List the
284: name and version of the program, the platforms it's been tested on,
285: and any limitations.
286: </UL>
287: <P>
288: <LI>Maintain the port!<BR>
289: As time goes by, problems may arise, or new versions of the software
290: may be released. You should strive to keep your port up to date.
291: In other words - iterate, test, test, iterate, ...
1.1 marc 292: </ol>
1.4 ian 293: Thank you for supporting the OpenBSD "ports" process!
1.1 marc 294: <hr>
295: <a href="porting.html"><img height=24 width=24 src=back.gif
296: border=0 alt=Porting></a>
1.14 ! rohee 297: <a href="mailto:www@openbsd.org">www@openbsd.org</a>
! 298: <br><small>$OpenBSD: checklist.html,v 1.13 1999/04/29 22:35:29 wvdputte Exp $</small>
1.1 marc 299: </body>
300: </html>