ViewVC Help
View File | Revision Log | Show Annotations | Download File | View Changeset | Root Listing
root/mports/trunk/mail/p5-Mail-SpamAssassin/files/pkg-install.in
Revision: 16349
Committed: Sun Apr 20 18:32:36 2014 UTC (10 years ago) by laffer1
File size: 2130 byte(s)
Log Message:
remove cvs2svn:cvs-rev prop

File Contents

# Content
1 #!/bin/sh
2 #
3 # $FreeBSD$
4 #
5
6 USER=%%USER%%
7 GROUP=%%GROUP%%
8 INSTALL="%%INSTALL%%"
9 PREFIX=%%PREFIX%%
10
11 if [ "$2" = "PRE-INSTALL" ];then exit; fi
12
13 if [ -z "${INSTALL}" ];then
14 echo "report this problem to scheidell@freebsd.org, $*"
15 exit 1
16 fi
17
18 if [ "$2" = "POST-INSTALL" ];then
19 ask() {
20 local question default answer
21
22 question=$1
23 default=$2
24 if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
25 read -t120 -p "${question} [${default}]? " answer
26 fi
27 echo ${answer:-${default}}
28 }
29
30 yesno() {
31 local question default answer
32
33 question=$1
34 default=$2
35 while :; do
36 answer=$(ask "${question}" "${default}")
37 case "${answer}" in
38 [Yy]*) return 0;;
39 [Nn]*) return 1;;
40 esac
41 echo "Please answer yes or no."
42 done
43 }
44
45 # Create pid directory
46
47 ${INSTALL} -d -o ${USER} -g ${GROUP} /var/run/spamd
48 ${PREFIX}/bin/spamassassin -x -L --lint
49 if [ ${?} -ne 0 ];then
50 echo "
51 *******************************************************
52 * _ _ _ _______ ______ __ _ _____ __ _ ______ *
53 * | | | |_____| |_____/ | \ | | | \ | | ____ *
54 * |__|__| | | | \_ | \_| __|__ | \_| |_____| *
55 * *
56 *******************************************************
57 * You must install rules before starting spamd! *
58 *******************************************************"
59 if [ -z "${PACKAGE_BUILDING}" -a -z "${BATCH}" ]; then
60 if yesno "Do you wish to run sa-update to fetch new rules" "N";then
61 ${PREFIX}/bin/sa-update || true
62 else
63 echo ""
64 fi
65 ${PREFIX}/bin/spamassassin -x -L --lint
66 if [ ${?} -eq 0 ] && grep '^load.*Rule2XSBody' ${PREFIX}/etc/mail/spamassassin/v320.pre > /dev/null ;then
67 if yesno "Do you wish to compile rules with re2c (will take a long time)" "N";then
68 ${PREFIX}/bin/sa-compile || true
69 fi
70 fi
71 fi
72 fi
73
74 exit 0
75 fi # post-install
76
77 exit 0