/[gentoo-x86]/mail-filter/assp/assp-1.3.3.8-r1.ebuild
Gentoo

Contents of /mail-filter/assp/assp-1.3.3.8-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations) (download)
Tue Nov 18 16:08:57 2008 UTC (6 years, 5 months ago) by tove
Branch: MAIN
Changes since 1.1: +3 -3 lines
  New virtuals: Compress-Zlib
(Portage version: 2.2_rc14/cvs/Linux 2.6.26-tuxonice i686)

1 tove 1.2 # Copyright 1999-2008 Gentoo Foundation
2 wltjr 1.1 # Distributed under the terms of the GNU General Public License v2
3 tove 1.2 # $Header: /var/cvsroot/gentoo-x86/mail-filter/assp/assp-1.3.3.8-r1.ebuild,v 1.1 2007/10/23 21:57:11 wltjr Exp $
4 wltjr 1.1
5     inherit eutils
6    
7     DESCRIPTION="Anti-Spam SMTP Proxy written in Perl."
8     HOMEPAGE="http://assp.sourceforge.net/"
9     MY_PN=ASSP_${PV}-Install
10     SRC_URI="mirror://sourceforge/${PN}/${MY_PN}.zip"
11     LICENSE="GPL-2"
12     SLOT="0"
13    
14     KEYWORDS="~amd64 ~x86"
15    
16     IUSE="ldap spf srs"
17    
18     DEPEND="app-arch/unzip"
19    
20     RDEPEND="dev-lang/perl
21     dev-perl/Net-DNS
22     dev-perl/File-ReadBackwards
23 tove 1.2 virtual/perl-Compress-Zlib
24 wltjr 1.1 dev-perl/Email-Valid
25     dev-perl/libwww-perl
26     virtual/perl-Digest-MD5
27     virtual/perl-Time-HiRes
28     spf? ( dev-perl/Mail-SPF-Query )
29     srs? ( dev-perl/Mail-SRS )
30     ldap? ( dev-perl/perl-ldap )"
31    
32     S=${WORKDIR}/${MY_PN}/ASSP
33    
34     pkg_setup() {
35     enewgroup assp
36     enewuser assp -1 -1 /dev/null assp
37     }
38    
39     src_unpack() {
40     unpack ${A}
41     cd "${S}"
42    
43     local FILES="
44     assp.pl
45     move2num.pl
46     rebuildspamdb.pl
47     repair.pl
48     stats.sh
49     stat.pl
50     "
51     # just being safe
52     for file in ${FILES}; do
53     edos2unix ${file}
54     done
55    
56     # portable changes via sed vs patch
57     sed -i -e 's|file:files/|file:/etc/assp/|' \
58     -e 's|$base/images|/usr/share/assp/images|' \
59     -e 's|logs/maillog.txt|/var/log/assp/maillog.txt|' \
60     -e 's|PID File'\'',40,textinput,'\''pid'\''|PID File'\'',40,textinput,'\''asspd.pid'\''|' \
61     -e 's|Daemon\*\*'\'',0,checkbox,0|Daemon\*\*'\'',0,checkbox,1|' \
62     -e 's|UID\*\*'\'',20,textinput,'\'''\''|UID\*\*'\'',20,textinput,'\''assp'\''|' \
63     -e 's|GID\*\*'\'',20,textinput,'\'''\''|GID\*\*'\'',20,textinput,'\''assp'\''|' \
64     -e 's|popFileEditor'\('\\'\''pb/pbdb\.\([^\.]*\)\.db\\'\'',|popFileEditor(\\'\''/var/lib/assp/pb/pbdb.\1.db\\'\'',|g' \
65     -e 's|$base/assp.cfg|/etc/assp/assp.cfg|g' \
66     -e 's|$base/$pidfile|/var/run/assp/asspd.pid|' \
67     -e 's|mkdir "$base/$logdir",0700 if $logdir;||' \
68     -e 's|mkdir "$base/$logdir",0700;||' \
69     -e 's|$base/$logfile|$logfile|' \
70     -e 's|$base/$logdir|$logdir|' \
71     -e 's|"maillog.log"|"/var/log/assp/maillog.log"|' \
72     -e 's|-d "$base/logs" or mkdir "$base/logs",0700;||' \
73     -e 's|-d "$base/notes" or mkdir "$base/notes",0700;||' \
74     -e 's|-d "$base/docs" or mkdir "$base/docs",0777;||' \
75     -e 's|$base/$archivelogfile|$archivelogfile|' \
76     -e 's|"$base/$file",$sub,"$this|"/etc/assp/$file",$sub,"$this|' \
77     -e 's|"$base/$file",'\'''\'',"$this|"/etc/assp/$file",'\'''\'',"$this|' \
78     -e 's|my $fil=$1; $fil="$base/$fil" if $fil!~/^\\Q$base\\E/i;|my $fil=$1;|' \
79     -e 's|$fil="$base/$fil" if $fil!~/^\\Q$base\\E/i;|$fil="/etc/assp/$fil" if $fil!~/^\\/etc\\/assp\\/\|\\/var\\/lib\\/assp\\/\/i;|' \
80     -e 's|$fil="$base/$fil" if $fil!~/^((\[a-z\]:)?\[\\/\\\\\]\|\\Q$base\\E)/;||' \
81     -e 's|if ($fil !~ /^\\Q$base\\E/i) {|if ($fil !~ /^\\/usr\\/share\\/assp\\//i) {|' \
82     -e 's|$fil="$base/$fil";|$fil="/usr/share/assp/$fil";|' \
83     -e 's|Q$base\\E|Q\\/etc\\/assp\\/\\E|' \
84     -e 's|$fil="$base/$fil"|$fil="/etc/assp/$fil"|' \
85     -e 's|$base/$bf|/etc/assp/$bf|g' \
86     assp.pl || die
87    
88     # questionable stuff
89     # -e 's|$fil="$base/$fil" if $fil!~/^\\Q$base\\E/i;|$fil="/etc/assp/$fil" if $fil!~/^\\Q\\/etc\\/assp\\/\\E/i;|' \
90     # -e 's|if ($fil !~ /^\\Q$base\\E/i) {|if ($fil !~ /^\\Q\\/usr\\/share\\/assp\\/\\E/i) {|' \
91     # -e 's|split('\'' '\'', $this|split('\''$base/'\'', $this|' \
92     # -e 's|split('\'' '\'',lc|split('\''$base/'\'',lc|' \
93     # -e 's|split('\'' '\'',$pat)|split('\''$base/'\'',$pat)|' \
94    
95     # sed move2num.pl
96     sed -i -e 's|assp.cfg|/etc/assp/assp.cfg|' move2num.pl || die
97    
98     # sed rebuildspamdb.pl
99     sed -i -e 's|assp.cfg|/etc/assp/assp.cfg|' \
100     -e 's|} && "$Config{base}/$Config{logfile}" \|\| '\''maillog.txt'\'';|};|' \
101     rebuildspamdb.pl || die
102    
103     # sed stats.sh
104     sed -i -e 's|usr/local|var/log|' stats.sh || die
105    
106     # patch is against unix-format, so patch after dos2unix
107     epatch "${FILESDIR}"/base.patch
108    
109     # remove windows stuff
110     rm "${S}/addservice.pl" || die "Could not remove ${S}/addservice.pl"
111     rm -f "${S}/Win32-quickstart-guide.txt" || die "Could not remove ${S}/Win32-quickstart-guide.txt"
112     }
113    
114     src_install() {
115     # Configuration directory
116     dodir /etc/assp/notes
117    
118     insinto /etc/assp
119     # Installs files that are used by assp for black/gray lists,
120     # and domain country lookup. To be changed by admin as needed.
121     doins files/*.txt || die
122    
123     fowners assp:assp /etc/assp -R
124     fperms 770 /etc/assp /etc/assp/notes
125    
126     # Setup directories for mail to be stored for filter
127     keepdir /var/lib/assp/spam /var/lib/assp/notspam
128     keepdir /var/lib/assp/errors/spam /var/lib/assp/errors/notspam
129    
130     # Logs directory
131     keepdir /var/log/assp
132     fowners assp:assp -R /var/log/assp
133     fperms 770 /var/log/assp
134    
135     # Install the app
136     exeinto /usr/share/assp
137     doexe *.pl *.sh || die
138     insinto /usr/share/assp
139     doins -r images/ || die
140    
141     # Lock down the files/data
142     fowners assp:assp -R /usr/share/assp
143     fperms 770 /usr/share/assp
144    
145     # Data storage
146     fowners assp:assp -R /var/lib/assp
147     fperms 770 /var/lib/assp
148    
149     # PID directory
150     dodir /var/run/assp
151     keepdir /var/run/assp
152     fowners assp:assp -R /var/run/assp
153     fperms 770 /var/run/assp
154    
155     # Install the init.d script to listen
156     newinitd "${FILESDIR}/asspd.init" asspd
157    
158     dohtml *.htm
159     }
160    
161     pkg_postinst() {
162     elog
163     elog "To configure ASSP, start /etc/init.d/asspd then point"
164     elog "your browser to http://localhost:55555"
165     elog "Username: admin Password: nospam4me (CHANGE ASAP!)"
166     elog
167     elog "File permissions have been set to use assp:assp"
168     elog "with mode 770 on directories. When you configure"
169     elog "ASSP, make sure and use the user assp."
170     elog
171     elog "Don't change any path related options."
172     elog
173     elog "See the on-line docs for a complete tutorial."
174     elog "http://assp.sourceforge.net/docs.html"
175     elog
176     elog "If upgrading, please update your old config to set both"
177     elog "redre.txt and nodelay.txt path of /etc/assp. There are"
178     elog "also many new options that you should review."
179     elog
180     }

  ViewVC Help
Powered by ViewVC 1.1.20