Staging - set owner/group/mode in pkg-plist for empty directory
olli hauer
ohauer at gmx.de
Wed Mar 5 06:03:48 UTC 2014
On 2014-03-04 23:47, Hans F. Nordhaug wrote:
> * olli hauer <ohauer at 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?
>>>
>>> Regards,
>>> Hans
>>>
>>> PS! I can't test the port anymore with porttools ("port test").
>>> I always get:
>>>
>>> -------
>>> [...]
>>> ===> Building package for piwik-2.1.0
>>> Creating package /usr/ports/www/piwik/work/piwik-2.1.0.tbz
>>> Registering depends:.
>>> pkg_create: couldn't resolve path for prefix: /tmp/piwik-2.1.0: No
>>> such file or directory
>>> *** [do-package] Error code 1
>>>
>>> Stop in /usr/ports/www/piwik.
>>> *** [package] Error code 1
>>>
>>> Stop in /usr/ports/www/piwik.
>>> ===> Error running make package
>>> [...]
>>> -------
>>>
>>> Is this a known issue? I haven't upgraded to pkgng yet.
>>
>>
>> Hi Hans,
>
> Hi, Olli. You sent your reply off the list, but I guess that was a
> mistake so I'm sending this reply to the list.
>
>> I haven't used porttools once in my life, but I suspect in pkg-plist
>> you miss %D/ as path prefix for the directory and in that case pkg
>> creates the directory in your current working directory.
>
> No, that isn't the problem - several things has changed in the latest version.
>
>> 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.
--
Regards,
olli
More information about the freebsd-ports
mailing list