Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 5 Mar 2014 08:49:08 +0100
From:      "Hans F. Nordhaug" <Hans.F.Nordhaug@hiMolde.no>
To:        <freebsd-ports@freebsd.org>
Subject:   Re: Staging - set owner/group/mode in pkg-plist for empty directory
Message-ID:  <20140305074908.GA5115@hiMolde.no>
In-Reply-To: <5316BE3C.1000007@gmx.de>
References:  <20140304143052.GA22995@hiMolde.no> <5315FB56.3000601@gmx.de> <20140304224706.GA17997@hiMolde.no> <5316BE3C.1000007@gmx.de>

next in thread | previous in thread | raw e-mail | index | archive | help
* olli hauer <ohauer@gmx.de> [2014-03-05]:
> On 2014-03-04 23:47, Hans F. Nordhaug wrote:
> > * olli hauer <ohauer@gmx.de> [2014-03-04]:
> >> On 2014-03-04 15:30, Hans F. Nordhaug wrote:
> >>> Hi,
> >>>
> >>> I'm trying to add staging to the Piwik port (at the same time as
> >>> updating to the new 2.1.0 release). AFAIK it's not possible to
> >>> set owner/group/mode for a directory in pkg-plist, only for files.
> >>> Is that correct?
> >>>
> >>> Piwik comes with an empty tmp directory that needs to be writable
> >>> by the webserver. Using CHMOD naivly in the post-install target 
> >>> doesn't work.
> >>>
> >>> What is the correct work-around?

[CUT]

> >> This should work.
> >> @exec install -m 755 -o %%WWWOWN%% -g %%WWWGRP%% -d %D/%%WWWDIR%%/tmp
> >> @exec chown -R %%WWWOWN%%:%%WWWGRP%% %D/%%WWWDIR%%/tmp
> > 
> > Thx, I ended up using "@exec chown ..." at the end pkg-plist. (The empty 
> > directory is created so I don't need "@exec install".)
> >  
> >> The following patch should work for your update
> >> http://people.freebsd.org/~ohauer/diffs/piwik-2.1.0.diff
> > 
> > Thx, but I had already written the patch - I just needed the one
> > missing piece ("@exec chown ..."). I did however copy the option
> > changes you did - much clearer code. Thx!
> > 
> > Regards,
> > Hans
> 
> Hi Hans,
> 
> the creation of the empty tmp directory is required for the old pkg_create
> tool, with the new ports-mgmt/pkg tools this is not required since it can
> handle empty directories. Since you haven't upgraded to pkgng yet, you can
> test this yourself by creating a package cleanup local/www and installing
> the package.
> 
> $> cd www/piwik
> $> make clean package && make clean
> $> make deinstall
> $> rm -rf /usr/local/www/piwik
> $> pkg_add $path/to/new/piwik-2.1.0.tbz
> 
> Now check if the directory is there.

You are right - thx for taking the time to explain. But why do you
need both? Doesn't

@exec install -m 755 -o %%WWWOWN%% -g %%WWWGRP%% -d %D/%%WWWDIR%%/tmp

work for pkgng? Is the problem that it doesn't change owner/group if the 
directory is already installed/created? And why did you add

    ${MKDIR} ${STAGEDIR}${WWWDIR}/tmp

to "do-install"? I know for sure that it isn't necessary when you use 
"make install" (since the directory is created by COPYTREE_SHARE. 
In which case is it needed?

Thx, again. 

Regards,
Hans



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20140305074908.GA5115>