How to best run a script post installation _and_ deinstallation?

Gerald Pfeifer gerald at
Sun May 22 21:28:30 UTC 2011

Trying to implement the final steps in addressing PR 155568: " 
Fixing dependency not to pick ccache stubs" which I have been working on
with Emanuel, I'd like to invoke a script after a port/package has been
installed and again after it has been deinstalled.

The naive approach below works for installation:

Index: Makefile
< post-install:
> post-install: ccache-update
> post-deinstall ccache-update:
> 	@if [ -x ${PREFIX}/bin/ccache-update-links ]; then \
> 	    ${PREFIX}/bin/ccache-update-links -v; \
> 	fi

It does not cover de-installation which raises two questions:

 1. Why don't we have a post-deinstall target?

 2. How is the task best accomplished?


More information about the freebsd-ports mailing list