Don't install files to /etc/ instead link them there
There are several files that we install to /etc/ when Debian package is installed. There some issues with this:
- These files when modified by the user and the next version of Debian package create a merge conflict which prevents freedombox package from getting upgraded.
- When a package (say apache) is removed, especially with purge, sometime the files installed by freedombox are removed due to an 'rm -rf' on the package's /etc/ path. When the package is installed back again, files installed by freedombox are missing and require re-installation of freedombox package.
- Being able to work with a clean /etc/ has some desirable advantages.
To solve this problem, we can install the file in /usr/ and link them in /etc. For example, instead of installing the file /etc/apache2/conf-available/roundcube-freedombox.conf
we would install /usr/lib/python3/dist-packages/plinth/modules/roundcube/data/etc/apache2/conf-available/roundcube-freedombox.conf
and then link the file in /etc/
to it. This can be done during package installation. Better yet, we can have a component that would install/uninstall the symlinks when app is enabled/disabled or when setup/uninstalled. Migration from existing setup to this new one should be straight forward.