/usr/ports/infrastructure/templates/Makefile.template
.
This file can be retrieved from any of the anoncvs servers or via the
OpenBSD cvs/web source browser system
http://www.openbsd.org/cgi-bin/cvsweb/.
make fetch-all
make makesum
make extract
Note: Patches go in the directory `patches' and are named patch-xx where xx should be aa, ab, ..., az, ba, bb ... zz.
$OpenBSD$
make patch
make PATCH_DEBUG=YES patch
The easiest way to re-run patches is to `make clean && make patch'. This will delete the work directory and re-extract and patch.
If GNU_CONFIGURE is used you may want to run ./configure --help to see what options are available. Anything that you may want to override can be changed by adding the --option flags to the CONFIGURE_ARGS parameter in the Makefile
SEPARATE_BUILD
GNU_CONFIGURE
can),
and may help people who mount their ports tree on several arches.
This can also spare you some effort, as you will possibly be able to
restart the cycle at configure
most of the time.
make configure
make clean && make configure
'.
Note: make sure host dependent files go in /etc
or
/etc/<name>
, but NEVER replace existing files
in /etc
. Best to have install place
in /usr/local/lib/<name>
and then copy to
/etc
or
/etc/<name>
only if the files do not exist.
The OpenBSD file locations are:
user executables: /usr/local/bin system admin executables: /usr/local/sbin program executables: /usr/local/libexec libraries /usr/local/lib architecture dependent data /usr/local/lib/<name> installed include files: /usr/local/include or /usr/local/include/<name> single-machine data: /etc or /etc/<name> local state: /var/run GNU info files: /usr/local/info man pages: /usr/local/man/... read-only architecture-independent: /usr/local/share/<name> misc documentation: /usr/local/share/doc/<name>
make
SEPARATE_BUILD
semanticsSEPARATE_BUILD
defined.
Ideally, the port should no longer modify any file in
${WRKSRC}
after make patch
.
You can check this by making sure you don't have any write access
to ${WRKSRC}
. Then you can set
SEPARATE_BUILD=concurrent
: someone can use the same
source tree to build on distinct arches simultaneously.
Otherwise, set SEPARATE_BUILD=simple
: building on
distinct arches simultaneously may meet with problems, as some
source files may be regenerated at awkward moments.
mkdir pkg; touch pkg/{DESCR,COMMENT,PLIST}
COMMENT is a SHORT one-line description of the port (max. 60 characters). Do NOT include the package name (or version number of the software) in the comment. Do NOT start with an uppercase letter unless semantically significant, do NOT end with a period.
DESCR is a longer description of the port. One to a few paragraphs concisely explaining what the port does is sufficient.
PLIST is kept empty at this point.
sudo make install
nm
, as some mistaken software strips dynamic libraries,
which may lead to weird failures later.
pkg/SECURITY
file. This file
should list audited potential problems, along with relevant patches,
so that another person can see at first glance what has been done.
Example:
$OpenBSD$ ${WRKDIR}/receiver.c call to mktemp (wrapper function do_mktemp) does seem to be correct. The server makes extensive use of strlcpy/strlcat/snprintf.
make plist
which makes the file PLIST-auto in the pkg directory. This file is a candidate packing list. Beware: the files are found by timestamp. This means it does NOT:
info/dir
file if .info files are
added. You'll have to add that by hand. Also, be sure that
the info/dir
is not part of the PLIST.
Peruse `PLIST-auto' and verify that everything was installed and that it was installed in the proper locations. Anything not installed can be added to a port Makefile `post-install' rule.
Copy `PLIST-auto' to `PLIST'
Ports that install shared libraries will need two versions of
the PLIST file. PLIST
describes the files installed on
those architectures that support shared libraries, and
PLIST.noshared
describes the files installed on
architectures that do not support shared libs. Typically,
PLIST.noshared
is a copy of PLIST
less references to any shared libraries.
pkg_delete <pkg_name>
' is
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 to ensure all is cleaned up. After an uninstall the command
find /usr/local -newer work/.install_started -print
should only list standard directory names.
make package
to create a package. To test the
package first do a pkg_delete
and then do a
pkg_add
The results after an add should EXACTLY
match the results after a `make install'.
The ports@openbsd mailing list is a good place to find porting-savy people with different platforms!
In short, import is typically used when a port is created. From that point on cvs add and cvs rm are typically used to add or remove files, and the normal edit->commit cycle for changes.
You might use something like this:
cd kaffe1 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 \ YourName YourName_YYYY-MMM-DD
-d cvs.openbsd.org:/cvs says where cvs lives. This can be omitted if you have a CVS_ROOT environment variable defined.
-m 'kaffe port' is your login message. Change it to whatever you like
ports/lang/kaffe1 is the path relative to /cvs where the port lives
YourName (replaced with your login name) is the "vendor tag". You imported it so you are the vendor.
YourName_YYYY-MMM-DD (e.g., ian_2000-Jan-01) is the 'vendor release tag'. This is as good as any.
As a real example, here is the output of checking in the Kaffe1 port, which one of us did on September 8, 1998:
$ cd kaffe1 $ make clean >/dev/null $ cvs import -m 'kaffe1.0(==JDK1.1) port' ports/lang/kaffe1 ian ian_1998-Sep-08 ian@cvs.openbsd.org's password: (not shown, obviously) I ports/lang/kaffe1/CVS I ports/lang/kaffe1/files/CVS I ports/lang/kaffe1/pkg/CVS N ports/lang/kaffe1/Makefile cvs server: Importing /cvs/ports/lang/kaffe1/files N ports/lang/kaffe1/files/md5 cvs server: Importing /cvs/ports/lang/kaffe1/pkg N ports/lang/kaffe1/pkg/COMMENT N ports/lang/kaffe1/pkg/DESCR N ports/lang/kaffe1/pkg/PLIST No conflicts created by this import $
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, add it to ports/lang/Makefile.
If you do not have CVS commit access, send mail to the ports maintainers at ports@openbsd.org, stating that you have a port ready to go into the tree. List the name and version of the program, the platforms it's been tested on, and any limitations.