From owner-freebsd-ports@FreeBSD.ORG Mon May 23 13:09:12 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 64B4D106566C for ; Mon, 23 May 2011 13:09:12 +0000 (UTC) (envelope-from wxs@atarininja.org) Received: from syn.atarininja.org (syn.csh.rit.edu [129.21.49.45]) by mx1.freebsd.org (Postfix) with ESMTP id 419458FC0A for ; Mon, 23 May 2011 13:09:12 +0000 (UTC) Received: by syn.atarininja.org (Postfix, from userid 1001) id CFDEC5C3D; Mon, 23 May 2011 09:09:54 -0400 (EDT) Date: Mon, 23 May 2011 09:09:54 -0400 From: Wesley Shields To: Gerald Pfeifer Message-ID: <20110523130954.GB71868@atarininja.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: ports@FreeBSD.org, Emanuel Haupt Subject: Re: 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: Mon, 23 May 2011 13:09:12 -0000 On Sun, May 22, 2011 at 11:01:50PM +0200, Gerald Pfeifer wrote: > 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? Are these what you are looking for: http://www.freebsd.org/doc/en/books/porters-handbook/pkg-install.html http://www.freebsd.org/doc/en/books/porters-handbook/pkg-deinstall.html -- WXS