Annotation of www/porttest.html, Revision 1.17
1.1 couderc 1: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2:
3: <html>
4: <head>
1.15 couderc 5: <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
6: <meta name="resource-type" content="document">
7: <meta name="description" content="The OpenBSD Port Testing Guide">
8: <meta name="keywords" content="openbsd,ports, test">
9: <meta name="distribution" content="global">
10: <meta name="copyright" content="copyright 2002-2003 by OpenBSD.">
1.6 couderc 11: <title>OpenBSD Port Testing Guide</title>
1.1 couderc 12: </head>
13:
14: <body text="#000000" bgcolor="#FFFFFF" link="#23238E">
15: <a href="index.html"><img alt="[OpenBSD]" height="30" width="141" src=
16: "images/smalltitle.gif" border="0"></a>
17:
1.6 couderc 18: <h2><font color="#e00000">Port Testing Guide</font></h2>
1.1 couderc 19: <hr>
20:
21: <h2><font color="#0000e0">Index</font></h2>
22:
23: <ul>
24: <li><a href="#Introduction">Introduction</a></li>
25:
26: <li><a href="#How">How</a></li>
27:
28: <li><a href="#First">First step</a></li>
29:
30: <li><a href="#Testing">Testing</a></li>
31:
32: <li><a href="#Commenting">Commenting</a></li>
33:
34: <li><a href="#More">More testing</a></li>
35: </ul>
36: <hr>
37:
38: <h2><a name="Introduction"><font color=
39: "#0000e0">Introduction</font></a></h2>
40:
41: <p>The <a href="ports.html">ports tree</a> is an huge piece of work that
1.8 avsm 42: permits OpenBSD users to use third-party programs without wasting time
43: patching, configuring and installing each one individually. This work
1.9 avsm 44: is done by a group of volunteers who spend their time porting and testing
45: applications across the range of OpenBSD platforms. Many people think
46: that they cannot help this process because they do not have enough
47: knowledge; this is false because they can help porters work better and
48: faster.</p>
1.1 couderc 49:
50: <h2><a name="How"><font color="#0000e0">How</font></a></h2>
51:
1.8 avsm 52: <p>Testing submitted updates or new ports which are posted on the
1.6 couderc 53: <a href="mail.html">ports mailing list</a>. By doing this
1.3 couderc 54: you reduce the latency of commits and also increase the number of ports to
55: be committed (many ports are not committed because of lack of testing!).</p>
1.1 couderc 56:
57: <h2><a name="First"><font color="#0000e0">First step</font></a></h2>
58:
1.8 avsm 59: <p>The ports tree is developed against
60: <a href="plus.html">OpenBSD-current</a>; there is no guarantee that
61: new ports will work correctly on the other branches. This also means
62: you should upgrade your system and ports tree to -current
63: (instructions on how to do this can be found at the
1.12 jufi 64: <a href="anoncvs.html">anoncvs</a> page and in the
65: <a href="faq/upgrade-minifaq.html">FAQ</a>).
1.8 avsm 66: It is also recommended that you subscribe to the ports and ports-changes
1.12 jufi 67: <a href="mail.html">mailing-lists</a>. This way you will be notified
1.8 avsm 68: about new or updated ports and about changes in the ports tree.</p>
1.7 couderc 69:
1.1 couderc 70: <h2><a name="Testing"><font color="#0000e0">Testing</font></a></h2>
71:
1.8 avsm 72: <p>There are two types of submissions on the mailing-lists; new ports
73: and updates. New ports are generally posted as tarball attachments
74: or urls. A good idea is to extract them into the
75: <tt>/usr/ports/mystuff/</tt> directory and test from there.
76: Updates are generally a diff against the -current ports tree, so it is best
77: to copy the port to <tt>mystuff/</tt> and apply the diff to prevent tree
1.7 couderc 78: breakage.</p>
1.1 couderc 79:
1.7 couderc 80: <p>Step-by-step building is needed to verify that every target, see
1.6 couderc 81: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=ports&sektion=7&">
1.7 couderc 82: ports(7)</a>, is achieved correctly :</p>
1.1 couderc 83:
84: <ul>
1.8 avsm 85: <li><i>fetch</i>
86: <ul>
1.14 couderc 87: <li>Needed to verify that distfile(s) are correctly downloaded. Try
88: to test all of the <tt>MASTER_SITES</tt> specified to make sure they
89: are all valid sources.</li>
1.10 couderc 90: </ul>
91:
92: <li><i>checksum</i>
93: <ul>
1.14 couderc 94: <li>Verify that downloaded distfiles match the checksums recorded
95: in the <tt>distinfo</tt> file.</li>
1.10 couderc 96: </ul>
1.8 avsm 97:
98: <li><i>extract</i>
1.14 couderc 99: <ul><li>Each of the distfiles should install any dependent programs
100: (such as bzip2) beforehand.</li></ul>
1.8 avsm 101:
102: <li><i>patch</i>
103: <ul>
104: <li>Patches should apply cleanly without any warnings.
105: <li>There shouldn't be any <tt>.orig</tt> files left behind in the
106: <tt>patches/</tt> directory.
1.14 couderc 107: <li>Another common mistake is to include RCS tags in a patch; this
108: will break when the port is checked into the repository and the RCS
109: tag expanded.
1.8 avsm 110: </ul>
111:
112: <li><i>configure</i>
113: <ul>
114: <li>Check that configure scripts correctly detect features
115: on your platform.
116: <li>GNU libtool is notorious for undesired 'features' on OpenBSD,
117: so check that the port is using a recent version which creates
118: correct libraries on your architecture.
119: <li>The configure script should not detect stray applications already
120: installed on your system without explicit dependencies being
121: set in the port.
122: </ul>
123:
124: <li><i>build</i>
125: <ul>
126: <li>Check for build errors and suspicious warnings.
127: <li>Warnings about <a href=
1.6 couderc 128: "http://www.openbsd.org/cgi-bin/man.cgi?query=tmpnam&sektion=3&">
1.8 avsm 129: tmpnam(3)</a> issues should be resolved by using
1.14 couderc 130: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=mkstemp&sektion=3&">
131: mkstemp(3)</a>.</li>
132: <li>Try to set the <tt>SEPARATE_BUILD</tt> variable to 'concurrent'
133: and test if the build still works.
1.8 avsm 134: <li>Make sure dependencies on GNU make are really necessary.
135: </ul>
136:
1.14 couderc 137: <li><i>regress</i>
138: <ul>
139: <li>Check for errors (empty tests means okay).
140: </ul>
141:
142:
1.8 avsm 143: <li><i>fake</i>
144: <ul>
145: <li>This target installs the application into a fake working
146: directory, to ensure that all files can be easily packaged up
147: without affecting the base system.
148: <li>The port should <b>never</b> install files outside of the
149: fake directory (such as into <tt>/usr/local</tt>).
150: <li>GNU libtool occasionally has trouble relinking libraries
151: during the fake process on some architectures.
152: </ul>
153:
154: <li><i>package</i>
155: <ul>
156: <li>Package creation can break if pkg/PLIST* and/or
157: pkg/PFRAG* are wrong.</li>
158: </ul>
159:
160: <li><i>install</i>
161: <ul>
162: <li>Packages should install all of the files from their packaging
163: lists successfully and with the correct permissions. Be especially
164: careful of files with the setuid bits set.
165: <li>Make sure that the package <tt>INSTALL</tt> script works
166: correctly, and does not overwrite any files in <tt>/etc</tt>.
167: </ul>
168:
169: <li><i>deinstall</i>
170: <ul>
171: <li>This should remove all files installed by the package, except
172: those in <tt>/etc</tt>.
173: <li>Make sure that the <tt>DEINSTALL</tt> script works as expected.
174: </ul>
1.1 couderc 175: </ul>
176:
1.11 avsm 177: <p>Remaining <tt>pkg/</tt> files like DESCR and MESSAGE should be checked
178: for grammar and typos. Paragraphs should be formatted using
179: <a href="http://www.openbsd.org/cgi-bin/man.cgi?query=fmt&sektion=1&format=html">fmt(1)</a> and wrapped at 70 characters.</p>
1.1 couderc 180:
181: <h2><a name="Commenting"><font color="#0000e0">Commenting</font></a></h2>
182:
183: <p>At the end of the test comes the really important thing : comments.
1.7 couderc 184: Even if the port is working fine comments must be done. If we have ten
1.3 couderc 185: posts where people say that the port runs fine under different architectures
1.7 couderc 186: then the commit is done faster. If it does not work then some information
187: must be given.
188: There are tools that can help in this task, like <a href=
1.1 couderc 189: "http://www.openbsd.org/cgi-bin/cvsweb/ports/infrastructure/build/portslogger">
1.14 couderc 190: portslogger</a> which is like an "intelligent tee" that redirects output
191: into a log file.</p>
1.1 couderc 192:
193: <p>Example :<br>
194: </p>
195:
196: <div style="margin-left: 2em">
1.11 avsm 197: <table border="0" cellpadding="3" width="90%">
1.1 couderc 198: <tr>
199: <td nowrap bgcolor="#EEEEEE">
200: <pre>
1.16 sturm 201: # make install 2>&1 | /usr/ports/infrastructure/build/portslogger .
1.1 couderc 202: </pre>
203: </td>
204: </tr>
205: </table>
206: </div>
207: <br>
208: <br>
209:
210:
1.3 couderc 211: <p>This will redirect the output into a log file located in the current
1.1 couderc 212: directory.</p>
213:
214: <h2><a name="More"><font color="#0000e0">More testing</font></a></h2>
215:
1.7 couderc 216: <p>Check the port Makefile for typos, incorrect links, useless or
1.11 avsm 217: missing variables, correct licensing and categories.
1.7 couderc 218: For those who are more skilled other targets can be tested like
1.11 avsm 219: <i>lib-depends-check</i>, examining patches, as well as providing
220: diffs to correct bugs, add flavors, or other enhancements.</p>
221: <p>These diffs should be done with the <tt>-uNr --exclude=CVS</tt> options.
222: <tt>cvs diff -uN</tt> can also be used to generate patches against
223: the CVS repository.</p>
1.17 ! jufi 224: <hr>
! 225: <a href="index.html"><img src="back.gif" height="24" width="24" alt="OpenBSD" border="0"></a>
! 226: <a href="mailto:www@openbsd.org">www@openbsd.org</a><br>
! 227: <small>
! 228: $OpenBSD: porttest.html,v 1.16 2003/03/13 19:55:46 sturm Exp $
! 229: </small>
! 230: </body>
1.1 couderc 231: </html>