# Dynamic filenames with the new staging directory system



## star99ers (Jan 30, 2015)

Hi,

I am working on updating a privately maintained port. As part of the Makefile `pre-install` target, a python whoosh index is created and installed. py-whoosh seems to use a randomly generated filename when creating its index. As such, I can't include one of the needed files in my pkg-plist.

Under the new staging system, there seems to be no way to recursively copy a directory. I also tried to use an `@exec` line to recursively copy the directory, but there seems to be no way to access the `STAGEDIR` in an `@exec`. It seems that `@exec` is only intended to operate on files after they've been installed, based on the `%F, %D, %B and %f` sequences documented at https://www.freebsd.org/doc/en_US.I.../plist-keywords.html#plist-keywords-base-exec

I ended up creating a tar file of the directory I wanted to install in the `pre-install` target, including the tar file in the pkg-plist, and the untaring the tar file with an `@exec` line in the pkg-plist. This feels like a hack though.

Please let me know if there is a way to include dynamically named files in a pkg-plist that I have missed.

Thanks!


----------



## junovitch@ (Jan 31, 2015)

Would the autoplist keyword be useful?  See /usr/ports/Mk/Uses/python.mk and probably some Python ports for examples.


> autoplist       - Automatically generates the packaging list for a port that uses distutils when defined. requires: distutils


----------

