Stuart Henderson wrote:
> On 2021/04/10 19:09, Stefan Hagen wrote:
>> Stuart Henderson wrote:
>>> Sample config usually goes in share/examples rather than under doc/.
>>
>> Thank you, attached the next try with sample config in
>> share/examples/notion.
>
> oh, I see, that's actually where it loads from, not just installed as sample?
>
> # Configuration .lua files. Overrideable, as config files are usually
> # not placed under $(PREFIX).
> -ETCDIR ?= $(PREFIX)/etc/notion
>+ETCDIR ?= $(PREFIX)/share/examples/notion
>
> I think what's wanted here is probably to get rid of that patch and set
> MAKE_FLAGS= ETCDIR=${SYSCONFDIR}/notion (used during build to tell the
> program where to look for files at runtime ) and then FAKE_FLAGS=
> ETCDIR=$(PREFIX)/share/examples/notion so fake-install copies the
> sample files there. Then use @sample in the PLIST to have pkg_add
> copy the files at install time. This is so that the user can modify the
> files if needed without causing conflicts.
I think there is no need to have the files twice on the system.
Configuration should be made by copying these files over to
$HOME/.notion and then go from there. Therefore I did not want to
pollute /etc/ with them.
I also noticed (after my last mail) that these files are used at runtime
when $HOME/.notion is not available - even when they're in the example
folder. This is not desired.
Setting ETCDIR from the port Makefile did not work as expected. I assume
${PREFIX} is evaluated early when used in FLAGS_* and not for each
phase. It was empty and did not hold the fake path in the fake phase.
I'm still setting ETCDIR via patch in the attached version. I decided to
set it to $(SHAREDIR)/etc, which will be /usr/local/share/notion/etc.
I think this is a good place for files that are used as config template
and fallback configuration.
Two more little fixes in this version.
1: I've added another patch for man/Makefile to get rid of the bash
dependency. -o pipefail is supported on OpenBSD sh, but not on linux. I
don't see were it would be of use.
-SHELL=bash -o pipefail
+SHELL=sh -o pipefail
2: I removed X11_PREFIX from the Makefile. It's set wrong in
system-autodetect.mk on first sight, but X11_LIBS and X11_INCLUDES are
properly filled by pkg-config. That's all that's needed.
Thanks for reviewing!
Best Regards,
Stefan
notion-4_0_2.tar.gz
Description: application/tar-gz
