Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 14 Nov 2006 17:27:30 +0100
From:      dirk.meyer@dinoex.sub.org (Dirk Meyer)
To:        freebsd-ports@freebsd.org
Subject:   Re: [nycbug-talk] creating "local" ports (fwd)
Message-ID:  <k4krBo7Aog@dmeyer.dinoex.sub.org>
References:  <Pine.OSX.4.61.0611031519500.4567@dyn-160-39-250-49.dyn.columbia.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
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.

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

b)
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:
/usr/ports/LOCAL/makefile.inc:PKGCATEGORY=LOCAL


> -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 <==
s=www/lynx$=www/lynx-ssl=
s|lang/gcc34|local/gcc34-objc|
s|lang/gcc33|local/gcc33-objc|


See:
http://people.freebsd.org/~dinoex/batch/README
http://people.freebsd.org/~dinoex/batch/pkg_update

This is an updated version of:
http://2004.eurobsdcon.org/talks.html?tx_ptspeechupload_pi1[showUid]=27
http://2004.eurobsdcon.org/uploads/media/EBSD04_27.pdf

kind regards Dirk

- Dirk Meyer, Im Grund 4, 34317 Habichtswald, Germany
- [dirk.meyer@dinoex.sub.org],[dirk.meyer@guug.de],[dinoex@FreeBSD.org]
http://people.freebsd.org/~dinoex/errorlogs/



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?k4krBo7Aog>