Annotation of www/checklist.html, Revision 1.3
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>
30: <li>Create Makefile -- start with this skeleton
31: <a href="#makefile">makefile</a>.
32: <p>
33: <li><code>make fetch</code><br>
34: This verifies that the master site, distname, and extract suffix are
35: correct.
36: <p>
37: <li><code>make makesum</code><br>
38: This creates the files directory and the md5 checksum for the
39: fetched files.
40: <p>
41: <li><code>make extract</code><br>
42: Ensures that the file can be extracted into the work directory.
43: This also verifies that the checksum created in step 3 is good.
44: <p>
45: <li>Create initial patches<br>
46: When the extract is complete cd to the work directory and read
47: any install docs. You may need to modify the WRKSRC variable
48: in the makefile as well as generate initial patches to configure
49: for openbsd.
50: <p>Note: Patches go in the directory `patches' and are names patch-xx
51: where xx should be aa, ab, ..., az, ba, bb ... zz.
52: <ul>
53: <li>only patch one source file per patchfile, please
54: <li>use diff -u to generate patches
55: <li>all patches MUST be relative to ${WRKSRC}
56: </ul>
57: <p>
58: <li><code>make patch</code><br>
59: this will apply patches to the extracted sources. If you want
60: to see the output use the command:
61: <p><code>make PATCH_DEBUG=YES patch</code>
62: <p>The easiest way to re-run patches is to `make clean && make patch'.
63: This will delete the work directory and re-extract and patch.
64: <p>
65: <li>add configuration options to Makefile and/or create configuration
66: script.<br>
67: You can add a port configuration script named `configure' to a
68: directory named scripts. This will be run before any
69: configuration specified by GNU_CONFIGURE or HAS_CONFIGURE is run.
70: <p>If GNU_CONFIGURE is used you may want to run ./configure --help
71: to see what options are available. Anything thay you may want to
72: override can be changed by adding the --option flags to the
73: CONFIGURE_ARGS parameter in the Makefile
74: <p>
75: <li><code>make configure</code><br>
76: Peruse the output (if any) and tweak any options in the Makefile.
77: To repeat issue the command `make clean && make configure'.
78: <p>Note: make sure host dependent files go in /etc or /etc/<name>, but
79: NEVER replace existing files in /etc. Best to have install place
80: in /usr/local/lib/<name> and then copy to /etc or /etc/<name> only
81: the files do not exist.
82: <p>The OpenBSD file locations are:
83: <pre>
84: user executables: /usr/local/bin
85: system admin executables: /usr/local/sbin
86: program executables: /usr/local/libexec
87: libraries /usr/local/lib
88: architecture dependent data /usr/local/lib/<name>
89: installed include files: /usr/local/include or
90: /usr/local/include/<name>
91: single-machine data: /etc or /etc/<name>
92: local state: /var/run
93: GNU info files: /usr/local/info
94: man pages: /usr/local/man/...
95: read-only architecture-independent: /usr/local/share/<name>
96: misc documentation: /usr/local/share/doc/<name>
97: </pre>
98: <p>
99: <li><code>make</code><br>
100: Begin a cycle of makes until the port is ready. Patch (see above)
101: clean, and make until the port is generated. Get rid of all warnings
102: if possible, especially security related warnings.
103: <p>
104: <li><code>mkdir pkg; touch pkg/{DESCR,COMMENT,PLIST}</code><br>
105: Create dummy versions of the package files. Edit DESCR and COMMENT.
106: <p>COMMENT is the one-line description of the port. Do NOT include the
107: package name (or version number of the software) in the comment.
108: <p>DESCR is a longer description of the port. One to a few paragraphs
109: concisely explaining what the port does is sufficient.
110: <p>PLIST is kept empty at this point.
111: <p>
112: <li><code>sudo make install</code><br>
113: install the application.
114: <p>
115: <li>Create pkg/PLIST<br>
116: After the install is complete use the developers command:
117: <p><code>make plist</code>
118: <p>which makes a the file PLIST-auto in the pkg directory. This file
119: is a candidate packing list. Beware: the files are found by
120: timestamp. This means it does NOT:
121: <ul>
122: <li>list any files installed with `tar' as their timestamp
123: will not change and thus won't be found by `find'
124: <li>update the <code>info/dir</code> file if .info files are
125: added. You'll have to add that by hand. Also, be sure that
126: the <code>info/dir</code> is not part of the PLIST.
127: <li>try to do anything special with links or symbolic links. A
128: cursory test of tar shows it does the right thing with links
129: and symbolic links so I don't see why we need to special case
130: anything in the packing list. But still...
131: </ul>
132: <p>Peruse `PLIST-auto' and verify that everything was installed and
133: that it was installed in the proper locations. Anything not installed
134: can be added to a port Makefile `post-install' rule.
135: <p>Copy `PLIST-auto' to `PLIST'
136: <p>
137: <li>uninstall and reinstall; repeat until perfect.<br>
138: <em>Perfect</em> is when everything installs and uninstalls
139: in its proper location. `pkg_delete <pkg_name>' is used to
140: uninstall. `sudo make reinstall' is used to reinstall. See the
141: `pkg_create' man page for other commands that may be added to PLIST
142: to ensure all is cleaned up. After an uninstall the command
143: <p><code>find /usr/local -newer work/.install_started -print</code>
144: <p>should only list standard directory names.
145: <p>
146: <li>Create package:<br>
147: After the port installs correctly issue the command
148: <code>make package</code> to create a package. To test the
149: package first do a <code>pkg_delete</code> and then do a
150: <code>pkg_add</code> The results after an add should EXACTLY
151: match the results after a `make install'.
152: </ol>
153: <hr>
154: <a name=makefile>
155: <h2><font color=#e00000>Skeleton ports makefile</font></h2>
156: </a>
157:
158: <code>;;;</code> indicates values that must be supplied by the
159: porter. Remove extraneous comments when done.
160: <pre>
161: # OpenBSD makefile for: ;;;
162: # Version required: ;;;
163: # Date created: ;;;
164: # Whom: you@your.domain
165: #
1.3 ! marc 166: # $OpenBSD: checklist.html,v 1.2 1998/08/01 00:27:34 marc Exp $
1.1 marc 167: #
168:
169: # What port/package will be created
170: #
171: DISTNAME= ;;;
172: #DIST_SUBDIR= ;;;
173: #PKGNAME= ;;;
174: CATEGORIES= ;;;
175:
176: # Reasons why the port/package shouldn't be built
177: #
178: #COMES_WITH= 2.3
179: #ONLY_FOR_ARCHS= list architectures here
180: #BROKEN= "reason"
1.3 ! marc 181: #RESTRICTED= "reason"
1.1 marc 182: #NO_CDROM= "reason"
1.3 ! marc 183: #NO_PACKAGE= "reason"
1.1 marc 184:
185: # where to send bitches about this port
186: #
187: MAINTAINER= ports@openbsd.org
188:
189: # where the source files and patches can be fetched
190: #
191: MASTER_SITES= ;;;
192: #MASTER_SITE_SUBDIR= ;;;
193: #DISTFILES= ;;;
194: #PATCH_SITES= ;;;
195: #PATCHFILES= ;;;
1.3 ! marc 196: #PATCH_DIST_STRIP= -p0
1.1 marc 197:
198: # How to extract the sources
199: #
200: #EXTRACT_SUFX= .tar.Z
201: #EXTRACT_CMD= ;;;
202: #EXTRACT_BEFORE_ARGS= ;;;
203: #EXTRACT_AFTER_ARGS= ;;;
204:
205: # Dependencies
206: #
207: #FETCH_DEPENDS= ;;;
208: #BUILD_DEPENDS= ;;;
209: #RUN_DEPENDS= ;;;
210: #LIB_DEPENDS= ;;;
211:
212: # Is the build automagic or is it interactive
213: #
214: #IS_INTERACTIVE= yes
215:
216: # build/configuration variables
217: #
218: #USE_GMAKE= yes
219: #USE_IMAKE= yes
220: #USE_X11= yes (assumed if USE_IMAKE is yes)
221:
222: #GNU_CONFIGURE= yes
223: #HAS_CONFIGURE= yes (assumed if GNU_CONFIGURE is yes)
224: #CONFIGURE_SCRIPT= ;;; (if other than configure)
225: #.if (${MACHINE_ARCH} != "alpha")
226: #CONFIGURE_ARGS+= --enable-shared
227: #.endif
228: #CONFIGURE_ARGS+= --enable-static
229: #CONFIGURE_ENV= ${SETENV}
230:
231:
232: # Things that we don't want to do for this port/package
233: #
234: #NO_DEPENDS= yes
235: #NO_WRKDIR= yes
236: #NO_WRKSUBDIR= yes
237: #NO_CHECKSUM= yes
238: #NO_EXTRACT= yes
239: #NO_PATCH= yes
240: #NO_CONFIGURE= yes
241: #NO_BUILD= yes
242: #NO_INSTALL= yes
243: #NO_MTREE= yes
244:
245: # This section is only needed if man pages are distributed in compressed
246: # form. Define MANCOMPRESSED and the man pages by section. The pages
247: # will be uncompressed after being installed.
248: #
249: #MANCOMPRESSED= yes
250: #MAN1= ;;;
251: #MAN3= ;;;
252: #MAN4= ;;;
253: #MAN5= ;;;
254: #MAN8= ;;;
255:
256: # Overrides for default values
257: #
258: #MAKEFILE= ;;;
259: #MAKE_FLAGS= ;;;
260: #MAKE_ENV= ;;;
261: #SCRIPTS_ENV= ;;;
262: #LDFLAGS= ;;;
263: #WRKDIR= ;;; if other than work
264: #WRKSRC= ;;; if other than ${WRKDIR}/$DISTNAME
265:
266: #ALL_TARGET= ;;;
267: #INSTALL_TARGET= ;;;
268:
269: # This target may be necessary if a shared library may have been created
270: #
271: #post-install:
272: # ${LDCONFIG} -m ${PREFIX}/lib
273:
274: .include <bsd.port.mk>
275: </pre>
276: <hr>
277: <a href="porting.html"><img height=24 width=24 src=back.gif
278: border=0 alt=Porting></a>
279: <a href=mailto:www@openbsd.org>www@openbsd.org</a>
1.3 ! marc 280: <br><small>$OpenBSD: checklist.html,v 1.2 1998/08/01 00:27:34 marc Exp $</small>
1.1 marc 281: </body>
282: </html>