This allows end-user to change permissions on log directory based on their preferences or security concerns and they won't be reset on upgrade.
Created attachment 246535 [details] Create/delete logs directory using hooks
This is probably better solved by creating the directory in the rc.d script and leaving it out of the package entirely. That said, instead of adding installation and deinstallation scripts, you should at least do something like adding @preexec mkdir -p %%LOGDIR%% @postunexec rmdir %%LOGDIR%% 2>/dev/null || true to pkg-plist. I have asked on the ports IRC channel for the proper way to do this and will report back if there is a better solution.
Created attachment 248955 [details] [PATCH] Create/delete directories using hooks Updated with given recommendations, thanks
Created attachment 248956 [details] [PATCH] Create/delete directories using hooks Fixed wrong lines folding