From owner-freebsd-ports Sun Jun 17 1:41:20 2001 Delivered-To: freebsd-ports@freebsd.org Received: from ringworld.nanolink.com (diskworld.nanolink.com [195.24.48.189]) by hub.freebsd.org (Postfix) with SMTP id 1E79E37B403 for ; Sun, 17 Jun 2001 01:41:07 -0700 (PDT) (envelope-from roam@orbitel.bg) Received: (qmail 1118 invoked by uid 1000); 17 Jun 2001 08:39:39 -0000 Date: Sun, 17 Jun 2001 11:39:39 +0300 From: Peter Pentchev To: James Halstead Cc: freebsd-ports@FreeBSD.org Subject: Re: ports/28209: Update port: cups Message-ID: <20010617113939.C777@ringworld.oblivion.bg> Mail-Followup-To: James Halstead , freebsd-ports@FreeBSD.org References: <01061619305808.06764@Halstead007> <20010617093134.A18400@ringworld.oblivion.bg> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20010617093134.A18400@ringworld.oblivion.bg>; from roam@orbitel.bg on Sun, Jun 17, 2001 at 09:31:34AM +0300 Sender: owner-freebsd-ports@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org On Sun, Jun 17, 2001 at 09:31:34AM +0300, Peter Pentchev wrote: > On Sat, Jun 16, 2001 at 07:30:58PM -0400, James Halstead wrote: > > > > As a side note is there a way to have the port create empty directories it > > needs. this program likes to fail or just not work in weird ways when > > directories it needs do not exist. (/var/spool/cups, /var/spool/cups/tmp, > > /usr/local/etc/cups/certs all come to mind as directories that weren't > > created and caused problems). > > ${MKDIR} ${PREFIX}/wherever in the post-install target, and add the new > directory with a @dirrm to the pkg-plist file (or @unexec rm -rf dir, > if there's a chance that it might not be empty at port deinstall time, > and its contents need not be preserved). OK, this was a hasty and incomplete answer. Here's the longer version. To create the directory upon port installation, add a ${MKDIR} dirname in the post-install target of the Makefile. To remove the directory upon deinstall, you have to add things to the packing list. There are three cases: 1. The directory is under ${PREFIX} and it is supposed to be empty after removing all the other files mentioned in the packing list: @dirrm dirname (relative to ${PREFIX}) 2. The directory is not under ${PREFIX}, or there might be some files left over that are NOT supposed to be removed if the uninstall is part of an upgrade (e.g. mail/printer queue, webserver data, etc..) @unexec rmdir fulldirname || true 3. The directory is not under ${PREFIX}, or there might be some files left over that ARE supposed to be removed (e.g. a temporary cache directory) @unexec rm -rf fulldirname || true (the || true isn't really needed..) Hope that clears things up a bit :) G'luck, Peter -- No language can express every thought unambiguously, least of all this one. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-ports" in the body of the message