FreeBSD Port Tips
Tips and tricks for creating, updating and maintaining FreeBSD ports, by Mark Foster
Creating and submitting port updates
General procedure that I use to update a port named foo to version 1.2.3. Download the new tarball from the source or vendor site and put in /usr/ports/distfiles
cd /usr/ports/misc/foo make clean cd .. cp -pr foo foo.old; cd foo
Update Makefile to reflect the new version
make makesum; make; make deinstall; make reinstall clean
Assuming everything worked, generate a patch file to submit for the send-pr
cd /usr/ports/misc diff -ruN foo.old/ foo/ > /tmp/foo-1.2.3.patch send-pr -a /tmp/foo-1.2.3.patch
Use send-pr to complete the (problem) report to FreeBSD so the maintainer can review your patch and a committer can commit it to the master sources in cvs. More information about using send-pr can be found at http://www.freebsd.org/doc/en_US.ISO8859-1/articles/problem-reports/pr-writing.html
Note how -a is used above...must be careful about how you add the patch file contents into the pr, as there are likely tabs in the Makefile that must be preserved. Pasting the textual contents from a console window may have damaging results.
Updating a specific port using cvsup
Use the -i flag to cvsup to limit it to a specific port name.
cvsup -g -L2 -i portname /etc/ports-supfile
Specifying GCC version compatibility
This can be used in a port's Makefile to enforce a minimum version of GCC
USE_GCC= 3.4+
This clause can be used in a port's Makefile to indicate brokenness on a particular version of GCC.
.if ${OSVERSION} >= 700042 BROKEN= Does not compile with GCC 4.2 .endif
Maintainer vs. Committer
This email message provides a great explanation for how to create and submit updates to ports.