Annotation of www/checklist.html, Revision 1.6
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>
1.5 ian 218: <P>Last but not least, add a one-line entry for the new port
219: in its parent directory's makefile, i.e., for ports/lang/kaffe1,
220: add it to ports/lang/Makefile.
1.4 ian 221: <P>If you do not have CVS commit access, send mail to the ports
222: maintainers at ports@openbsd.org,
223: stating that you have a port ready to go into the tree. List the
224: name and version of the program, the platforms it's been tested on,
225: and any limitations.
226: </UL>
227: <P>
228: <LI>Maintain the port!<BR>
229: As time goes by, problems may arise, or new versions of the software
230: may be released. You should strive to keep your port up to date.
231: In other words - iterate, test, test, iterate, ...
1.1 marc 232: </ol>
1.4 ian 233: Thank you for supporting the OpenBSD "ports" process!
1.1 marc 234: <hr>
235: <a name=makefile>
236: <h2><font color=#e00000>Skeleton ports makefile</font></h2>
237: </a>
238:
239: <code>;;;</code> indicates values that must be supplied by the
240: porter. Remove extraneous comments when done.
241: <pre>
1.6 ! marc 242: # $OpenBSD: checklist.html,v 1.5 1998/09/13 23:05:26 ian Exp $
1.1 marc 243: #
244:
245: # What port/package will be created
246: #
247: DISTNAME= ;;;
248: #DIST_SUBDIR= ;;;
249: #PKGNAME= ;;;
250: CATEGORIES= ;;;
251:
252: # Reasons why the port/package shouldn't be built
253: #
254: #COMES_WITH= 2.3
255: #ONLY_FOR_ARCHS= list architectures here
256: #BROKEN= "reason"
1.3 marc 257: #RESTRICTED= "reason"
1.1 marc 258: #NO_CDROM= "reason"
1.3 marc 259: #NO_PACKAGE= "reason"
1.1 marc 260:
261: # where to send bitches about this port
262: #
263: MAINTAINER= ports@openbsd.org
264:
265: # where the source files and patches can be fetched
266: #
267: MASTER_SITES= ;;;
268: #MASTER_SITE_SUBDIR= ;;;
269: #DISTFILES= ;;;
270: #PATCH_SITES= ;;;
271: #PATCHFILES= ;;;
1.3 marc 272: #PATCH_DIST_STRIP= -p0
1.1 marc 273:
274: # How to extract the sources
275: #
276: #EXTRACT_SUFX= .tar.Z
277: #EXTRACT_CMD= ;;;
278: #EXTRACT_BEFORE_ARGS= ;;;
279: #EXTRACT_AFTER_ARGS= ;;;
280:
281: # Dependencies
282: #
283: #FETCH_DEPENDS= ;;;
284: #BUILD_DEPENDS= ;;;
285: #RUN_DEPENDS= ;;;
286: #LIB_DEPENDS= ;;;
287:
288: # Is the build automagic or is it interactive
289: #
290: #IS_INTERACTIVE= yes
291:
292: # build/configuration variables
293: #
294: #USE_GMAKE= yes
295: #USE_IMAKE= yes
296: #USE_X11= yes (assumed if USE_IMAKE is yes)
297:
298: #GNU_CONFIGURE= yes
299: #HAS_CONFIGURE= yes (assumed if GNU_CONFIGURE is yes)
300: #CONFIGURE_SCRIPT= ;;; (if other than configure)
301: #.if (${MACHINE_ARCH} != "alpha")
302: #CONFIGURE_ARGS+= --enable-shared
303: #.endif
304: #CONFIGURE_ARGS+= --enable-static
305: #CONFIGURE_ENV= ${SETENV}
306:
307:
308: # Things that we don't want to do for this port/package
309: #
310: #NO_DEPENDS= yes
311: #NO_WRKDIR= yes
312: #NO_WRKSUBDIR= yes
313: #NO_CHECKSUM= yes
314: #NO_EXTRACT= yes
315: #NO_PATCH= yes
316: #NO_CONFIGURE= yes
317: #NO_BUILD= yes
318: #NO_INSTALL= yes
319: #NO_MTREE= yes
320:
321: # This section is only needed if man pages are distributed in compressed
322: # form. Define MANCOMPRESSED and the man pages by section. The pages
323: # will be uncompressed after being installed.
324: #
325: #MANCOMPRESSED= yes
326: #MAN1= ;;;
327: #MAN3= ;;;
328: #MAN4= ;;;
329: #MAN5= ;;;
330: #MAN8= ;;;
331:
332: # Overrides for default values
333: #
334: #MAKEFILE= ;;;
335: #MAKE_FLAGS= ;;;
336: #MAKE_ENV= ;;;
337: #SCRIPTS_ENV= ;;;
338: #LDFLAGS= ;;;
339: #WRKDIR= ;;; if other than work
340: #WRKSRC= ;;; if other than ${WRKDIR}/$DISTNAME
341:
342: #ALL_TARGET= ;;;
343: #INSTALL_TARGET= ;;;
344:
345: # This target may be necessary if a shared library may have been created
346: #
347: #post-install:
348: # ${LDCONFIG} -m ${PREFIX}/lib
349:
350: .include <bsd.port.mk>
351: </pre>
352: <hr>
353: <a href="porting.html"><img height=24 width=24 src=back.gif
354: border=0 alt=Porting></a>
355: <a href=mailto:www@openbsd.org>www@openbsd.org</a>
1.6 ! marc 356: <br><small>$OpenBSD: checklist.html,v 1.5 1998/09/13 23:05:26 ian Exp $</small>
1.1 marc 357: </body>
358: </html>