I realise this question is as old as the hills...
What you're proposing isn't possible with Apt (or RPM, or numerous other package types) - and so cpack can't provide the facilities either.
The reasoning being that the package is supposed to describe the things it will install into the system - and most critically, the things it'll remove if the package is uninstalled, or if a subsequent version of it no longer include files in the older version. You can understand that this wouldn't be possible if a config file could alter the way the package landed on the system because after install the config could change, making the on-going maintenance of files impossible.
What you're asking for is somewhat "non standard" for a package, and somewhat problematic for running systems. Instead, you have a number of options...
- Make a package for each installation variant you expect
- Make a single package, and then use a post-install Bash script to do all the path creation/adjustments you need
- Use a package to "centrally" put files in place, and then use Configuration Management (Ansible, Puppet, Chef etc) to do the remaining work.
Personally, I'd recommend option 3. Option 1 is a lot of work, Option 2 is "messy" in so much as the administrator will be left with a load of files and directories which aren't owned by any package, making uninstall difficult. It also encourages the creation of a handful of Bash scripts which are hard to maintain and most likely won't do what they're supposed to in all the places your package gets deployed.
The Third option leaves the sysadmin in control, and they'll have the knowledge of what's on their system, what to remove if they need to, etc.