Best practices for managing tweaked ports

Mel fbsd.questions at rachie.is-a-geek.net
Thu Feb 7 22:12:28 UTC 2008


Hi,

On Tuesday 05 February 2008 13:05:12 Michaël Grünewald wrote:

> I am seeking for a word in advice in how to automatically tweak some
> applications, possibly making packages for them.
>
>

> The current solution is: I have a post install shell script that plugs
> my files into appropriate location. This works but there is two
> drawbacks:

You're almost there:
- Create a file Makefile.local in the port you need a post-install shell 
script executed with contents:
PKGINSTALL=/path/to/mycustomizations.sh

This will then be packaged in packages as well.
See pkg_create(1) and in particular -i option, as well as grep 
_LATE_PKG_ARGS /usr/ports/Mk/bsd.port.mk

If you wanna do it cleaner, may want to wrap that in:
.if !defined(PKGINSTALL) && !exists(${PKGDIR}/pkg-install)
...
.else
error:
	echo "Omg they killed kenny"
	/usr/bin/false
.endif

So that it errors out, if the port starts providing a post-install script.
-- 
Mel


More information about the freebsd-questions mailing list