version 1.13, 1999/04/29 22:35:29 |
version 1.14, 1999/05/02 15:33:20 |
|
|
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> |
<html> |
<html> |
<head> |
<head> |
<meta http-equiv="Content-Type" |
<meta http-equiv="Content-Type" |
|
|
<body text="#000000" bgcolor="#FFFFFF" link="#23238E"> |
<body text="#000000" bgcolor="#FFFFFF" link="#23238E"> |
<img height=30 width=141 src=images/smalltitle.gif alt="[OpenBSD]" > |
<img height=30 width=141 src=images/smalltitle.gif alt="[OpenBSD]" > |
|
|
<h2><font color=#e00000>OpenBSD Porting Checklist</font></h2> |
<h2><font color="#e00000">OpenBSD Porting Checklist</font></h2> |
|
|
I use this checklist as a reminder of things to do when creating |
I use this checklist as a reminder of things to do when creating |
new ports and when validating old ports. I don't claim this list |
new ports and when validating old ports. I don't claim this list |
is totally accurate, much less perfect, but only hope that some |
is totally accurate, much less perfect, but only hope that some |
find it useful. Direct any questions and/or comments to me at |
find it useful. Direct any questions and/or comments to me at |
<a href=mailto:marc@snafu.org>marc@snafu.org</a>. |
<a href="mailto:marc@snafu.org">marc@snafu.org</a>. |
<p> |
<p> |
<ol> |
<ol> |
<li>To avoid duplication, subscribe to the ports@openbsd.org |
<li>To avoid duplication, subscribe to the ports@openbsd.org |
|
|
<li>Create Makefile -- start with the provided Makefile template |
<li>Create Makefile -- start with the provided Makefile template |
<code>/usr/ports/Makefile.template</code>. This file can |
<code>/usr/ports/Makefile.template</code>. This file can |
be retrieved from any of the anoncvs servers or via the |
be retrieved from any of the anoncvs servers or via the |
OpenBSD cvs/web source brouser system |
OpenBSD cvs/web source browser system |
<a href="http://www.openbsd.org/cgi-bin/cvsweb/">http://www.openbsd.org/cgi-bin/cvsweb/</a>. |
<a href="http://www.openbsd.org/cgi-bin/cvsweb/">http://www.openbsd.org/cgi-bin/cvsweb/</a>. |
<p> |
<p> |
<li><code>make fetch</code><br> |
<li><code>make fetch</code><br> |
|
|
<p> |
<p> |
<li><code>make extract</code><br> |
<li><code>make extract</code><br> |
Ensures that the file can be extracted into the work directory. |
Ensures that the file can be extracted into the work directory. |
This also verifies that the checksum created in step 3 is good. |
This also verifies that the checksum created in step 4 is good. |
<p> |
<p> |
<li>Create initial patches<br> |
<li>Create initial patches<br> |
When the extract is complete cd to the work directory and read |
When the extract is complete cd to the work directory and read |
any install docs. You may need to modify the WRKSRC variable |
any install docs. You may need to modify the WRKSRC variable |
in the makefile as well as generate initial patches to configure |
in the makefile as well as generate initial patches to configure |
for openbsd. |
for OpenBSD. |
<p>Note: Patches go in the directory `patches' and are names patch-xx |
<p>Note: Patches go in the directory `patches' and are names patch-xx |
where xx should be aa, ab, ..., az, ba, bb ... zz. |
where xx should be aa, ab, ..., az, ba, bb ... zz. |
<ul> |
<ul> |
<li>only patch one source file per patchfile, please |
<li>only patch one source file per patchfile, please |
<li>use diff -u to generate patches |
<li>use diff -u to generate patches |
<li>all patches MUST be relative to ${WRKSRC} |
<li>all patches MUST be relative to ${WRKSRC} |
|
<li>add a small explaination of the patch role in the patchfile before |
|
the patch itself, and an OpenBSD CVS tag |
|
<code>$OpenBSD$</code> |
</ul> |
</ul> |
<p> |
<p> |
<li><code>make patch</code><br> |
<li><code>make patch</code><br> |
|
|
directory named scripts. This will be run before any |
directory named scripts. This will be run before any |
configuration specified by GNU_CONFIGURE or HAS_CONFIGURE is run. |
configuration specified by GNU_CONFIGURE or HAS_CONFIGURE is run. |
<p>If GNU_CONFIGURE is used you may want to run ./configure --help |
<p>If GNU_CONFIGURE is used you may want to run ./configure --help |
to see what options are available. Anything thay you may want to |
to see what options are available. Anything that you may want to |
override can be changed by adding the --option flags to the |
override can be changed by adding the --option flags to the |
CONFIGURE_ARGS parameter in the Makefile |
CONFIGURE_ARGS parameter in the Makefile |
<p> |
<p> |
|
|
<p> |
<p> |
<li><code>make configure</code><br> |
<li><code>make configure</code><br> |
Peruse the output (if any) and tweak any options in the Makefile. |
Peruse the output (if any) and tweak any options in the Makefile. |
To repeat issue the command `make clean && make configure'. |
To repeat issue the command |
<p>Note: make sure host dependent files go in /etc or /etc/<name>, but |
`<code>make clean && make configure</code>'. |
NEVER replace existing files in /etc. Best to have install place |
<p>Note: make sure host dependent files go in <code>/etc</code> or |
in /usr/local/lib/<name> and then copy to /etc or /etc/<name> only |
<code>/etc/<name></code>, but NEVER replace existing files |
the files do not exist. |
in <code>/etc</code>. Best to have install place |
|
in <code>/usr/local/lib/<name></code> and then copy to |
|
<code>/etc</code> or |
|
<code>/etc/<name></code> only if the files do not exist. |
<p>The OpenBSD file locations are: |
<p>The OpenBSD file locations are: |
|
|
<pre> |
<pre> |
|
|
system admin executables: /usr/local/sbin |
system admin executables: /usr/local/sbin |
program executables: /usr/local/libexec |
program executables: /usr/local/libexec |
libraries /usr/local/lib |
libraries /usr/local/lib |
architecture dependent data /usr/local/lib/<name> |
architecture dependent data /usr/local/lib/<name> |
installed include files: /usr/local/include or |
installed include files: /usr/local/include or |
/usr/local/include/<name> |
/usr/local/include/<name> |
single-machine data: /etc or /etc/<name> |
single-machine data: /etc or /etc/<name> |
local state: /var/run |
local state: /var/run |
GNU info files: /usr/local/info |
GNU info files: /usr/local/info |
man pages: /usr/local/man/... |
man pages: /usr/local/man/... |
read-only architecture-independent: /usr/local/share/<name> |
read-only architecture-independent: /usr/local/share/<name> |
misc documentation: /usr/local/share/doc/<name> |
misc documentation: /usr/local/share/doc/<name> |
</pre> |
</pre> |
|
|
<p> |
<p> |
|
|
<li><code>mkdir pkg; touch pkg/{DESCR,COMMENT,PLIST}</code><br> |
<li><code>mkdir pkg; touch pkg/{DESCR,COMMENT,PLIST}</code><br> |
Create dummy versions of the package files. Edit DESCR and COMMENT. |
Create dummy versions of the package files. Edit DESCR and COMMENT. |
<p>COMMENT is a <strong>SHORT</strong> one-line description of the port |
<p>COMMENT is a <strong>SHORT</strong> one-line description of the port |
(max. 60 characters). Do NOT include the |
(max. 60 characters). Do NOT include the package name (or version number |
package name (or version number of the software) in the comment. |
of the software) in the comment. Do NOT start by an uppercase letter |
|
unless semantically significant, do NOT end by a dot. |
<p>DESCR is a longer description of the port. One to a few paragraphs |
<p>DESCR is a longer description of the port. One to a few paragraphs |
concisely explaining what the port does is sufficient. |
concisely explaining what the port does is sufficient. |
<p>PLIST is kept empty at this point. |
<p>PLIST is kept empty at this point. |
|
|
should list audited potential problems, along with relevant patches, |
should list audited potential problems, along with relevant patches, |
so that another person can see at first glance what has been done. |
so that another person can see at first glance what has been done. |
Example: |
Example: |
<pre> |
|
|
|
$OpenBDS$ |
<pre> |
|
$OpenBSD$ |
|
|
${WRKDIR}/receiver.c |
${WRKDIR}/receiver.c |
call to mktemp (wrapper function do_mktemp) does seem to be correct. |
call to mktemp (wrapper function do_mktemp) does seem to be correct. |
|
|
<p> |
<p> |
<li>uninstall and reinstall; repeat until perfect.<br> |
<li>uninstall and reinstall; repeat until perfect.<br> |
<em>Perfect</em> is when everything installs and uninstalls |
<em>Perfect</em> is when everything installs and uninstalls |
in its proper location. `pkg_delete <pkg_name>' is used to |
in its proper location. `<code>pkg_delete <pkg_name></code>' is |
uninstall. `sudo make reinstall' is used to reinstall. See the |
used to uninstall. `sudo make reinstall' is used to reinstall. See the |
`pkg_create' man page for other commands that may be added to PLIST |
`<code>pkg_create</code>' man page for other commands that may be added |
to ensure all is cleaned up. After an uninstall the command |
to PLIST to ensure all is cleaned up. After an uninstall the command |
<p><code>find /usr/local -newer work/.install_started -print</code> |
<p><code>find /usr/local -newer work/.install_started -print</code> |
<p>should only list standard directory names. |
<p>should only list standard directory names. |
<p> |
<p> |
|
|
<code>pkg_add</code> The results after an add should EXACTLY |
<code>pkg_add</code> The results after an add should EXACTLY |
match the results after a `make install'. |
match the results after a `make install'. |
<p> |
<p> |
<LI>Distribute it!</BR> |
<li>Distribute it!<br> |
Since the whole point of this process |
Since the whole point of this process |
is to make your ported version of the software available to |
is to make your ported version of the software available to |
other OpenBSD users, you now need to disseminate it. |
other OpenBSD users, you now need to disseminate it. |
<UL> |
<ul> |
<LI>First, get others to test it on a variety of |
<li>First, get others to test it on a variety of |
platforms (the DEC Alpha is good because it has only static libraries |
platforms (the DEC Alpha is good because it has only static libraries |
and because sizeof int != sizeof long; Sun SPARC is good because it is |
and because sizeof int != sizeof long; Sun SPARC is good because it is |
very common and because its byte order is the reverse of i386; if you |
very common and because its byte order is the reverse of i386; if you |
developed on SPARC, of course, you'd want it tested on i386). |
developed on SPARC, of course, y ou'd want it tested on i386). |
<P>The ports@openbsd mailing list is a good place to find porting-savy |
<P>The ports@openbsd mailing list is a good place to find porting-savy |
people with different platforms! |
people with different platforms! |
<LI>Incorporate any feedback you get. Test it again on your platform. |
<li>Incorporate any feedback you get. Test it again on your platform. |
Get those who gave you feedback to test it again from your new port. |
Get those who gave you feedback to test it again from your new port. |
<LI>Finally, include it in the "ports" tree. |
<li>Finally, include it in the "ports" tree. |
If you are a developer with CVS access, check it in. |
If you are a developer with CVS access, check it in. |
We normally use "import" for a new port, |
We normally use "import" for a new port, |
rather than adding a zillion (or a dozen) files individually. |
rather than adding a zillion (or a dozen) files individually. |
|
|
files, and the normal edit->commit cycle for changes. |
files, and the normal edit->commit cycle for changes. |
<P> |
<P> |
You might use something like this: |
You might use something like this: |
<PRE> |
<pre> |
cd kaffe1 |
cd kaffe1 |
make clean # you really really don't want to check in all of work! |
make clean # you really really don't want to check in all of work! |
cvs -d cvs.openbsd.org:/cvs import -m 'kaffe port' ports/lang/kaffe1 \ |
cvs -d cvs.openbsd.org:/cvs import -m 'kaffe port' ports/lang/kaffe1 \ |
<I>YourName</I> <I>YourName_YYYY-MMM-DD</I> |
<I>YourName</I> <I>YourName_YYYY-MMM-DD</I> |
</PRE> |
</pre> |
<P>-d cvs.openbsd.org:/cvs says where cvs lives. This can be omitted if you |
<P>-d cvs.openbsd.org:/cvs says where cvs lives. This can be omitted if you |
have a CVS_ROOT environment variable defined. |
have a CVS_ROOT environment variable defined. |
<P>-m 'kaffe port' is your login message. Change it to whatever you like |
<P>-m 'kaffe port' is your login message. Change it to whatever you like |
|
|
is the 'vendor release tag'. This is as good as any. |
is the 'vendor release tag'. This is as good as any. |
<P>As a real example, here is the output of checking in the Kaffe1 port, |
<P>As a real example, here is the output of checking in the Kaffe1 port, |
which one of us did on September 8, 1998: |
which one of us did on September 8, 1998: |
<PRE> |
<pre> |
$ cd kaffe1 |
$ cd kaffe1 |
$ make clean >/dev/null |
$ make clean >/dev/null |
$ cvs import -m 'kaffe1.0(==JDK1.1) port' ports/lang/kaffe1 ian ian_1998-Sep-08 |
$ cvs import -m 'kaffe1.0(==JDK1.1) port' ports/lang/kaffe1 ian ian_1998-Sep-08 |
|
|
|
|
No conflicts created by this import |
No conflicts created by this import |
$ |
$ |
</PRE> |
</pre> |
<P>Last but not least, add a one-line entry for the new port |
<P>Last but not least, add a one-line entry for the new port |
in its parent directory's makefile, i.e., for ports/lang/kaffe1, |
in its parent directory's makefile, i.e., for ports/lang/kaffe1, |
add it to ports/lang/Makefile. |
add it to ports/lang/Makefile. |
|
|
<hr> |
<hr> |
<a href="porting.html"><img height=24 width=24 src=back.gif |
<a href="porting.html"><img height=24 width=24 src=back.gif |
border=0 alt=Porting></a> |
border=0 alt=Porting></a> |
<a href=mailto:www@openbsd.org>www@openbsd.org</a> |
<a href="mailto:www@openbsd.org">www@openbsd.org</a> |
<br><small>$OpenBSD$</small> |
<br><small>$OpenBSD$</small> |
</body> |
</body> |
</html> |
</html> |