I'm creating a package which includes some default settings for users. Things that generally appear under ~/.<some-name>
or ~/.config/<app>/<some>.conf
and similar files.
In most cases, these files are installed in the skeleton directory (/etc/skel
) but those are going to be installed only in new users home directories. I'd like existing users to also get the files at the time the package gets installed.
What does the Debian standard say about that?
For a concrete example, I have a .lessfilter script that I'd like to add to my personal package so that way it gets installed on all of my machines.
So in my alex-tools.install
file I have:
scripts/.lessfilter /etc/skel
I know I can create an alex-tools.postinst
script like so (not yet tested, use with care):
#!/bin/sh -e
#
# Finish up the installation
#DEBHELPER#
# Source debconf library.
. /usr/share/debconf/confmodule
if [ "$1" = "configure" ]
then
# Install files in user folders
#
for u in /root /home/*
do
if ! test -f "${u}/.lessfilter"
then
cp /etc/skel/.lessfilter "${u}/.lessfilter"
chmod 700 "${u}/.lessfilter"
chown "${u}" "${u}/.lessfilter"
fi
done
fi
But I'm thinking that this may not be considered "legal" in Debian and there may be a cleaner way to implement such?
Is there something about this in the Debian references?