Date: Sun, 17 Jun 2001 11:39:39 +0300 From: Peter Pentchev <roam@orbitel.bg> To: James Halstead <James_Bond_79@yahoo.com> Cc: freebsd-ports@FreeBSD.org Subject: Re: ports/28209: Update port: cups Message-ID: <20010617113939.C777@ringworld.oblivion.bg> In-Reply-To: <20010617093134.A18400@ringworld.oblivion.bg>; from roam@orbitel.bg on Sun, Jun 17, 2001 at 09:31:34AM %2B0300 References: <Pine.BSF.4.21.0106170014170.44161-100000@sobek.openirc.co.uk> <01061619305808.06764@Halstead007> <20010617093134.A18400@ringworld.oblivion.bg>
next in thread | previous in thread | raw e-mail | index | archive | help
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
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010617113939.C777>