Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 08 Feb 2021 16:12:17 +0000
From:      Chris Rees <crees@bayofrum.net>
To:        Chris <portmaster@bsdforge.com>
Cc:        ports@freebsd.org
Subject:   Re: Handling directory ownership in pkg-plist
Message-ID:  <E8748249-2F44-4873-869D-27B3258A65C9@bayofrum.net>
In-Reply-To: <F9A5FE04-15C2-4216-BF00-9648ECB47175@FreeBSD.org>
References:  <c6b5e1c6-f925-6df0-862e-76ea83fd80cb@rees.space> <623897a8b8aaf941d59f39f2f32e4326@bsdforge.com> <967F2C8E-AD27-4003-A5B7-6B39D1911572@FreeBSD.org> <8932039662e23e447f019a3b98bb9b90@bsdforge.com> <B902B937-BEF0-4F21-B953-66B0B5696A3A@FreeBSD.org> <223fd53a3efdbc8f2d4879e443a3f425@bsdforge.com> <F9A5FE04-15C2-4216-BF00-9648ECB47175@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help


On 8 February 2021 08:01:22 GMT, Chris Rees <crees@FreeBSD.org> wrote:
>
>
>On 8 February 2021 01:28:06 GMT, Chris <portmaster@bsdforge.com> wrote:
>>On 2021-02-07 12:19, Chris Rees wrote:
>>> Afternoon,
>>>=20
>>> On 7 February 2021 19:05:26 GMT, Chris <portmaster@bsdforge.com>
>>wrote:
>>>> On 2021-02-07 02:18, Chris Rees wrote:
>>>>> Hi Chris,
>>>>>=20
>>>>> Thamks for the reply.
>>>>>=20
>>>>> On 7 February 2021 03:57:03 GMT, Chris <portmaster@bsdforge.com>
>>>> wrote:
>>>>>> On 2021-02-06 13:34, Chris Rees wrote:
>>>>>>> Hi all,
>>>>>>>=20
>>>>>>> Resurrecting audio/ampache-resurrect, and I have @owner
>>www/@group
>>>>>> www above
>>>>>>> all
>>>>>>> of the WWWDIR files, and they are correctly owned.  However, the
>>>>>> directories
>>>>>>> under
>>>>>>> it are all still owned by root:wheel, and if I explicitly add
>>them
>>>>>> all with
>>>>>>> @dir
>>>>>>> pkg then complains about not being able to find them.
>>>>>>>=20
>>>>>>> Would it be unacceptable to just have @exec chown -R www:www
>>>>>> %D/%%WWWDIR%%
>>>>>>> at the bottom?
>>>>>> Yes. By way of pre-install:
>>>>>> You'll probably get a complaint unless you use: ${CHOWN}
>>>>>=20
>>>>> Perhaps I was unclear- I'm referring to pkg-plist, so there is no
>>>> ${CHOWN}
>>>>> there.
>>>>>=20
>>>>> The exact proposed line is
>>>>>=20
>>>>> @postexec chown -R www:www %D/%%WWWDIR%%
>>>>>=20
>>>>> I was wondering what the 'proper' way to do this was.
>>>> I'm wondering why it's not enough to create a post-extract that
>>doesn't
>>>>=20
>>>> something
>>>> like
>>>> cd ${WRKSRC}/some/dir && ${CHOWN} -R ${WWUSER}:${WWGROUP} .
>>>> Then the ports framework would create an appropriate pkg-plist
>based
>>on
>>>> that.
>>>> A
>>>> make -DBATCH makeplist would generate your target pkg-plist.
>>>>=20
>>>> I'm paraphrasing, as I don't have your Makefile. But I've needed to
>>>> perform
>>>> tasks
>>>> like myself. Out of curiosity. What does a make -DBATCH makeplist
>>>> generate?
>>>> Does
>>>> the output provide the necessary clues to create a pkg-plist you're
>>>> interested in?
>>>=20
>>> CHOWN can't be used in the Makefile as you need root.
>>>=20
>>> make makeplist used after CHOWN does nothing different- it appears
>>not to=20
>>> notice
>>> that they have different owners.
>>But what of the pkg-plist for www/kanboard? It has the clues you need
>>for=20
>>setting the
>>pkg-plist. The ports framework will honor the perms set within it. eg;
>>@owner %%KANBOARD_USERNAME%%
>>@group %%KANBOARD_GROUPNAME%%
>>%%WWWDIR%%/.htaccess
>>%%WWWDIR%%/ChangeLog
>>%%WWWDIR%%/LICENSE
>>%%WWWDIR%%/app/.htaccess
>>%%WWWDIR%%/app/Action/Base.php
>>%%WWWDIR%%/app/Action/CommentCreation.php
>>...
>>
>>Just change the leader to the @user and @group to your desired names
>in
>>your
>>pkg-plist. Save it to your port. Done. :-)
>>>=20
>>> There is nothing documented on this that I can find, so I'll commit
>>the=20
>>> @postexec line.
>
>I need the directories also owned by www.
>
>This doesn't achieve that.
>

Solution was in fact to list it under @dir.  I guess I must have had duplic=
ate @dir lines when I did it last time, hence the errors.

Chris

--=20
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E8748249-2F44-4873-869D-27B3258A65C9>