From owner-freebsd-ports@FreeBSD.ORG Sun May 22 21:28:30 2011 Return-Path: Delivered-To: ports@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8EE6A1065676 for ; Sun, 22 May 2011 21:28:30 +0000 (UTC) (envelope-from gerald@pfeifer.com) Received: from relay00.pair.com (relay00.pair.com [209.68.5.9]) by mx1.freebsd.org (Postfix) with SMTP id 31A7F8FC16 for ; Sun, 22 May 2011 21:28:30 +0000 (UTC) Received: (qmail 84517 invoked from network); 22 May 2011 21:01:49 -0000 Received: from 91.186.144.116 (HELO ?192.168.0.130?) (91.186.144.116) by relay00.pair.com with SMTP; 22 May 2011 21:01:49 -0000 X-pair-Authenticated: 91.186.144.116 Date: Sun, 22 May 2011 23:01:50 +0200 (CEST) From: Gerald Pfeifer To: ports@FreeBSD.org Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Cc: Emanuel Haupt Subject: How to best run a script post installation _and_ deinstallation? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 May 2011 21:28:30 -0000 Trying to implement the final steps in addressing PR 155568: "bsd.gcc.mk: 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 181a182,186 > 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? Gerald