From: Dinko Korunic Date: Mon, 17 Sep 2007 16:17:05 +0000 (+0000) Subject: r3: - oops, add missing debconf stuff X-Git-Tag: v3.3.1-1~27 X-Git-Url: http://ftp.carnet.hr/carnet-debian/scm?a=commitdiff_plain;h=70cbfe14d11389dd025ba68a3d825927a2bb7932;p=spamassassin-cn.git r3: - oops, add missing debconf stuff --- diff --git a/debian/config b/debian/config new file mode 100755 index 0000000..21335d6 --- /dev/null +++ b/debian/config @@ -0,0 +1,75 @@ +#!/bin/sh + +set -e + +# load Debconf +. /usr/share/debconf/confmodule +db_version 2.0 + +confdir="/etc/spamassassin" + +if [ -s $confdir/local.cf ]; then + # check if user had use_bayes already + db_get spamassassin-cn/usebayes || true + if [ -z "$RET" ]; then + usebayes=$(grep -e '^use_bayes ' $confdir/local.cf | cut -d ' ' -f2-) + if [ "x$usebayes" = "x1" ]; then + db_set spamassassin-cn/usebayes "true" + elif [ "x$usebayes" = "x0" ]; then + db_set spamassassin-cn/usebayes "false" + fi + fi + + # check if user had use_dcc already + db_get spamassassin-cn/usedcc || true + if [ -z "$RET" ]; then + usedcc=$(grep -e '^use_dcc ' $confdir/local.cf | cut -d ' ' -f2-) + if [ "x$usedcc" = "x1" ]; then + db_set spamassassin-cn/usedcc "true" + elif [ "x$usedcc" = "x0" ]; then + db_set spamassassin-cn/usedcc "false" + fi + fi + + # check if user had use_razor2 already + db_get spamassassin-cn/userazor2 || true + if [ -z "$RET" ]; then + userazor2=$(grep -e '^use_razor2 ' $confdir/local.cf | cut -d ' ' -f2-) + if [ "x$userazor2" = "x1" ]; then + db_set spamassassin-cn/userazor2 "true" + elif [ "x$userazor2" = "x0" ]; then + db_set spamassassin-cn/userazor2 "false" + fi + fi +fi + +# do we have amavisd-new +db_get spamassassin-cn/runservice || true +if [ -z "$RET" ]; then + if dpkg -l amavisd-new | grep -q '^.i'; then + db_set spamassassin-cn/runservice "false" || true + fi +fi + +db_go || true + +db_input medium spamassassin-cn/usebayes || true +db_input medium spamassassin-cn/userazor2 || true +db_input medium spamassassin-cn/usedcc || true +db_input high spamassassin-cn/runservice || true + +db_go || true + +db_get spamassassin-cn/runservice +if [ "$RET" = "true" ]; then + db_input high spamassassin-cn/runasuser || true +fi + +db_go || true + +# dh_installdebconf will replace this with shell code automatically +# generated by other debhelper scripts. + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules index 9256324..38c4f93 100755 --- a/debian/rules +++ b/debian/rules @@ -45,7 +45,7 @@ binary-indep: build install dh_installexamples dh_install # dh_installmenu -# dh_installdebconf + dh_installdebconf # dh_installlogrotate # dh_installemacsen # dh_installcatalogs diff --git a/debian/templates b/debian/templates new file mode 100644 index 0000000..f23063b --- /dev/null +++ b/debian/templates @@ -0,0 +1,49 @@ +Template: spamassassin-cn/usebayes +Type: boolean +Default: false +Description: Zelite li Bayesian klasifikator: + SpamAssassin moze koristiti naivni Bayesian klasifikator poste. + Receni statisticki filtar predstavlja dodatni vid zastite od + spama, medjutim podrazumijeva intenzivno inicijalno i kasnije + redovno hranjenje spama i hama u sustav koristeci sa-learn + naredbu. Da bi receni filtar poceo raditi, nuzno je nahraniti + barem 1000 spam i 1000 ham e-mailova. + +Template: spamassassin-cn/userazor2 +Type: boolean +Default: true +Description: Zelite li koristiti Razor2: + SpamAssassin moze koristiti Vipul Razor2 mrezu. Recena je + komercijalna mreza zatvorenog koda, namijenjena distribuiranom + klasificiranju i filtriranju spama. Receno predstavlja + komplementarnu tehniku standardnom statickom filtriranju. + +Template: spamassassin-cn/usedcc +Type: boolean +Default: true +Description: Zelite li koristiti DCC: + SpamAssassin moze koristiti DCC (Distributed Checksum + Clearinghouse) mrezu. Recena je distribuirana mreza namijenjena + klasificiranju i filtriranju spama. Receno predstavlja + komplementarnu tehniku standardnom statickom filtriranju. + +Template: spamassassin-cn/runservice +Type: boolean +Default: false +Description: Zelite li imati spamd servis: + SpamAssassin moze biti uvijek aktivan kao spamd servis. U + slucaju da imate vec centralno aktivan Amavis, spamd je + nepotreban buduci da se SpamAssassin koristi interno unutar + Amavis servisa. Koristenje spamd ne utice i ne ubrzava rad + Amavis servisa. + +Template: spamassassin-cn/runasuser +Type: select +Choices: non-root, root +Default: non-root +Description: Zelite li spamd pod ovlastima: + SpamAssassin spamd servis nije nuzno pokretati pod ovlastima + privilegiranog korisnika (root). Ako na sistemu nema korisnika + koji koriste SpamAssassin iz komadne linije, bolje ga je ne + pokretati pod root ovlastima, vec pod neprivilegiranim + korisnikom (non-root).