[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do you have any use for a new porter?



On Thu, 2 Dec 1999, Daniel Hartmeier wrote:

> How can I help?

any way you can!

verifying ports is helpful, and pretty easy. whenever you install a port,
make sure you build a package as well to verify, like so:

	cd /usr/ports/whatever/foo
	make
	make install		(installs port - watch carefully!)
	make package		(builds .tgz package from installed port)
	make deinstall		(deinstalls port)
	pkg_add -v foo-1.0.tgz	(installs package)
	pkg_delete -v foo-1.0	(deinstalls package - verifying PLIST)
	pkg_add -v foo-1.0.tgz	(reinstalls package, so you can use it!)

other good things to do - help audit the packages for security holes,
notify package maintainers when new releases of the software they're
tracking comes out, etc. you can also try bringing over FreeBSD ports and
trying to build them - they usually work okay, but may require some
porting as well (porting a port!). i find a lot of their port patches 
reference OS-specific compiler defines (#ifdef FreeBSD), this is wrong.

to build a port from scratch, see http://www.openbsd.org/porting.html and
especially /usr/ports/infrastructure/mk/bsd.port.mk

here's the sequence i generally use when creating a port from scratch:

cd /usr/ports/whatever
mkdir foo
cd foo
mkdir pkg files patches
cp /usr/ports/whatever/bar/Makefile .	(starting Makefile)
emacs Makefile	(edit Makefile with proper PKGNAME, DISTNAME or DISTFILES,
		 MASTER_SITES, CATEGORY, MAINTAINER, etc.)
make fetch	(get srcs)
make makesum	(generate files/md5 checksums)
make extract	(extract into WRKSRC - may need to change it, or set
		 NO_WRKSUBDIR)
cd work/foo-1.0
cp foo.c foo.c.orig
emacs foo.c		(modify srcs if needed for the port)
diff -u foo.c.orig foo.c > ../../patches/patch-aa	(save those mods
							 as patches)
[etc. - hack more files]
cd ../..
make clean	(wipe WRKSRC)
make		(see how far you get with your current setup)

if all goes well here, fix up the install stuff, make sure it honors
PREFIX (many people choose something OTHER than /usr/local), and generate
a pkg/PLIST (this is usually done by hand, or by doing something like

make PREFIX=/tmp/foo install
cd /tmp/foo
find . -type f -print | cut -c3- | sort > /tmp/PLIST
find . -type d -print | cut -c3- | sed 's/^/@dirrm /g' | tail +2 | \
	sort -r >> /tmp/PLIST
[edit /tmp/PLIST manually to make sure things are kosher]

finishing touches - add pkg/COMMENT, pkg/DESCR, and pkg/SECURITY, if
you've audited the code at all.

that's just how i do it, other ppl may do it differently...

-d.

---
http://www.monkey.org/~dugsong/