Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 11 Sep 2016 10:05:17 +1000
From:      Aristedes Maniatis <amaniatis@apache.org>
To:        Mathieu Arnold <mat@FreeBSD.org>, Aristedes Maniatis <amaniatis@apache.org>, FreeBSD Mailing List <freebsd-ports@freebsd.org>
Subject:   Re: ${INSTALL_DATA} problems
Message-ID:  <d874555c-861c-7812-f64d-326319c9879b@apache.org>
In-Reply-To: <35e0ace2-ad10-c103-e3d9-c106286ad28a@FreeBSD.org>
References:  <cb59dad8-c6a0-ffc1-4705-9e8a66ca2679@apache.org> <cef2af10-89ce-e443-8bde-a7eb73d7a5bf@FreeBSD.org> <557d8ed5-3e3a-6384-4b63-b4ed145e0071@apache.org> <35e0ace2-ad10-c103-e3d9-c106286ad28a@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
My apologies for not explaining in enough detail.

On 10/09/2016 10:18pm, Mathieu Arnold wrote:
> The plist can be generated automatically with "make makeplist" there is
> no way it is hard to do, or maintain.
> 
>> > I really only want one folder installed with the correct permissions, but do I need to move my chmod code into the rc.d startup script instead and tying it into the pkg install?
> If it is an empty folder, or you just want the folder itself to have the
> permissions, do:
> 
> @dir(%%owner%%,%%group%%,optional mode) the/dir

I can see how to use makeplist and to edit the results. However maintaining large lists of files can be cumbersome if you have to manually edit that list every time you upgrade. So I see you have the PLIST_SUB option in Makefile as a way to automatically simplify the plist when it is generated with makeplist.

I had also thought from my reading of the Drupal 'uses' makefile that I could use PLIST_FILE += as a way to inject additional lines into the plist when you run makeplist, but it doesn't work like that when I try it.

PLIST_FILES+=   "@owner www" \
                "@group www" \


I also note that the docs [1] indicate that COPYTREE_SHARE doesn't add files to pkg-plist, but I note that for me makeplist does generate them as I'd expect. Maybe it is my misunderstanding of what "add" means.



Anyhow, thanks for all your help. The end result of this conversation is:

1. I now know that INSTALL_DATA and COPYTREE_SHARE are two macros which are fairly particular in how they work. One can only do single files and the other requires CD to work correctly. Error messages and portlint don't help much.

2. INSTALL_DATA has switches for user and group, but they should not be used

3. If only a specific folder needs to be owned by a certain user, then it is less effort to add that to a prestart() command in the rc.d script rather than maintaining a plist which is different in one line out of a thousand from the output from makeplist. Many rc.d scripts already do that for /var/run/portname/ or /var/log/portname/ anyhow, so this is an established technique.



Cheers
Ari






[1] https://www.freebsd.org/doc/en/books/porters-handbook/install.html -> 5.15.3



-- 
-------------------------->
Aristedes Maniatis
GPG fingerprint CBFB 84B4 738D 4E87 5E5C  5EFA EF6A 7D2E 3E49 102A



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?d874555c-861c-7812-f64d-326319c9879b>