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