diff --git a/debian/metche.config b/debian/metche.config new file mode 100755 index 0000000..24e6e12 --- /dev/null +++ b/debian/metche.config @@ -0,0 +1,23 @@ +#!/bin/sh + +CONFIGFILE=/etc/metche.conf +set -e +. /usr/share/debconf/confmodule + +db_fset metche/email seen false +db_fset metche/changelog seen false +db_fset metche/backups seen false + +if [ -e $CONFIGFILE ]; then + . $CONFIGFILE || true + # Stocke les valeurs du fichier de configuration + # dans la base de données de debconf + db_set metche/email $EMAIL_ADDRESS + db_set metche/changelog $CHANGELOG_FILE + db_set metche/backups $BACKUP_DIR +fi + +db_input medium metche/email || true +db_input medium metche/changelog || true +db_input medium metche/backups || true +db_go || true diff --git a/debian/metche.postinst b/debian/metche.postinst new file mode 100644 index 0000000..30f7a2f --- /dev/null +++ b/debian/metche.postinst @@ -0,0 +1,19 @@ +#!/bin/sh + +CONFIGFILE=/etc/metche.conf +set -e +. /usr/share/debconf/confmodule + +db_get metche/email +EMAIL_ADDRESS="$RET" +db_get metche/changelog +CHANGELOG_FILE="$RET" +db_get metche/backups +BACKUP_DIR="$RET" + +cp -a -f $CONFIGFILE $CONFIGFILE.tmp +sed -e "s#^ *EMAIL_ADDRESS=.*#EMAIL_ADDRESS=\"$EMAIL_ADDRESS\"#" \ + -e "s#^ *CHANGELOG_FILE=.*#CHANGELOG_FILE=\"$CHANGELOG_FILE\"#" \ + -e "s#^ *BACKUP_DIR=.*#BACKUP_DIR=\"$BACKUP_DIR\"#" \ + < $CONFIGFILE > $CONFIGFILE.tmp +mv -f $CONFIGFILE.tmp $CONFIGFILE diff --git a/debian/metche.templates b/debian/metche.templates new file mode 100644 index 0000000..2069f10 --- /dev/null +++ b/debian/metche.templates @@ -0,0 +1,37 @@ +Template: metche/email +Type: string +Default: root@localhost +Description: Email address to which the reports will be sent. + By default, metche is run periodically by a cron job which returns + reports containing changes made to: + - the changelog files, + - the watched files, + - the list of installed debian packages. + This option indicates to which email address those reports will be + sent and typically corresponds to your collective mailing-list + address. + . + See https://poivron.org/dev/metche/ for an example. + . + Note: metche is also able to use GnuPG to encrypt the email it sends, + but does not by default. See the man page and the configuration file + for more details. + +Template: metche/changelog +Type: string +Description: Changelog file to be monitored. + Metche can monitor changelog files written by *you* and which should + comment the changes you made to the system. This option can be used + to activate the monitoring of a single changelog file. + . + Note that you can also change metche's configuration file for it to + monitor a set of changelog files stored in a changelog directory + instead of a single file. + +Template: metche/backups +Type: string +Default: /var/lib/metche +Description: Directory containing the backups. + This option corresponds to the directory in which metche will store + the backups of the watched directories. Make sure that this backup + place is at least as secured as the source.