On 2021/07/12 00:43, Stefan Hagen wrote: > Stuart Henderson wrote: > > 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 took another attempt to actually get your proposal to work. And after > an hour of fighting with PREFIX and DESTDIR it finally started working. > > It looks like this now: > > MAKE_FLAGS= ETCDIR=$(SYSCONFDIR)/notion > FAKE_FLAGS= ETCDIR=$(DESTDIR)$(PREFIX)/share/examples/notion
That looks pretty standard; please s/DESTDIR/WRKINST/ for the variable which is normally used in ports > And then later: > > post-install: > $(INSTALL_DATA_DIR) $(DESTDIR)$(SYSCONFDIR)/notion > $(INSTALL_DATA) $(PREFIX)/share/examples/notion/*.lua \ > $(DESTDIR)$(SYSCONFDIR)/notion/ > > PREFIX suddenly includes DESTDIR here, which threw me off. > > PLIST has @sample /etc/notion/* entries. > > Everything seems to work as expected. > > Updated port attached. > > Best Regards, > Stefan This isn't doing what you want, @sample refers to the previous installed file, i.e. share/notion/welcome.txt @sample file1 @sample file2 @sample file3 @sample file4 copies welcome.txt to file1, file2, file3, file4. So yours need to be interleaved rather than in a block at the end.