pkg-static: duplicate file listing

While working on a port I have found a problem of duplicate entries for documentation files with warning message as in the title.
In my port, docs are installed conditionally, based on the DOCS option, so I have this in Makefile:
Code:
OPTIONS_DEFINE= DOCS
The example doc file, file.txt, is properly installed in work/stage/usr/local/share/doc/file.txt and make makeplist generates a single entry for that file, for pkg-plist:
Code:
%%PORTDOCS%%%%DOCSDIR%%/file.txt
What is interesting is that at later steps, work/.PLIST.mktmp contains TWO entries:
Code:
share/doc/file.txt
/usr/local/share/doc/file.txt
and the command make package prints:
Code:
pkg-static: duplicate file listing: /usr/local/share/doc/file.txt, ignoring
Ultimately, file.txt does not install in its destination after make install.
Is there anything obvious that I might be missing?
 
Problem solved - apart from the entries listed above I also had (this is a leftover from a broken port) this:
Code:
PORTDOCS= *
According to the handbook, these are *alternative* mechanisms, so apparently they are responsible for the conflicting entries in the processed plist. I have removed this glob entry from the Makefile and stayed with the idea of using separate entry for each installed file (they are generated by make makeplist anyway, and at least I can review what goes there). Now the port works properly.
 
Back
Top