[nycbug-talk] creating "local" ports (fwd)

Dirk Meyer dirk.meyer at dinoex.sub.org
Tue Nov 14 17:01:01 UTC 2006

Hallo Charles Sprickman,

> I'm finding that there are a number of ports that we need to patch for 
> some functionality that's unique to our business (qmail, mailfront, etc.). 
> Currently we just do "make patch" and then apply our patches.  This works, 
> but is a bit of a pain to maintain.
> Is there a way to create a "local" category?  ie: /usr/ports/LOCAL

I like to point out a very easy way:

$ mkdir /usr/ports/LOCAL
$ echo "PKGCATEGORY?=LOCAL" > /usr/ports/LOCAL/makefile.inc
$ echo "PKGNAMESUFFIX?=-local" >> /usr/ports/LOCAL/makefile.inc

Copy a port you like to change into this.
build and install it from there.
You need _no_ modifications on a port.

PKGNAMESUFFIX or PKGNAMEPREFIX can be set to make standard and
local packages coexists.

If the master ports gets updated, you habe to merge the changes.

Or you create a slave-port., which referes to the master ports in the
normal ports tree.

All base tools support this.

> We might occasionally look at the real qmail/mailfront/djbdns or other 
> ports and see if there's anything we want to pull in, but we'd most likely 
> be doing more work with merging in more of our own patches/software.

You can still add your own patches in /usr/ports/category/portname/files/

You can create in  /usr/ports/category/portname/ a Makefile.local
that defines additional steps, dependencies ... 

> Is there some mechanism that I'm missing to deal with a local category? 
> I've been googling without much luck, and I didn't see this addressed in 
> the porter's handbook.

The minium requierement is:

> -How does one handle packages that depend on say, qmail, but I now want to
> depend on local-qmail?  I know portupgrade can be tought this by setting
> an alternate pkgdep, but is there any clever way of doing this so that 
> when you're not using portupgrade the deps are adjusted?

My pkg_update tool supports this.
For each hostname there is an optional sed_file.

$ head /usr/ports/local/update/data/depends.*
==> /usr/ports/local/update/data/depends.k3.dinoex.de <==


This is an updated version of:

kind regards Dirk

- Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany
- [dirk.meyer at dinoex.sub.org],[dirk.meyer at guug.de],[dinoex at FreeBSD.org]

More information about the freebsd-ports mailing list