|
Lines 85-96
Link Here
|
| 85 |
use large-domain && myconf="${myconf} --enable-large-scale" ||\ |
85 |
use large-domain && myconf="${myconf} --enable-large-scale" ||\ |
| 86 |
myconf="${myconf} --enable-domain-scale" |
86 |
myconf="${myconf} --enable-domain-scale" |
| 87 |
|
87 |
|
|
|
88 |
myconf="${myconf} --with-dspam-home=${HOMEDIR}" |
| 88 |
myconf="${myconf} --with-dspam-mode=4755" |
89 |
myconf="${myconf} --with-dspam-mode=4755" |
| 89 |
myconf="${myconf} --with-dspam-owner=dspam" |
90 |
myconf="${myconf} --with-dspam-owner=dspam" |
| 90 |
myconf="${myconf} --with-dspam-group=dspam" |
91 |
myconf="${myconf} --with-dspam-group=dspam" |
| 91 |
myconf="${myconf} --sysconfdir=${HOMEDIR}" |
92 |
myconf="${myconf} --sysconfdir=${HOMEDIR}" |
| 92 |
myconf="${myconf} --with-logdir=${LOGDIR}" |
93 |
myconf="${myconf} --with-logdir=${LOGDIR}" |
| 93 |
use virtual-users || myconf="${myconf} --with-dspam-home=${HOMEDIR}" |
94 |
use virtual-users || myconf="${myconf} --enable-homedir" |
| 94 |
|
95 |
|
| 95 |
# enables support for debugging (touch /etc/dspam/.debug to turn on) |
96 |
# enables support for debugging (touch /etc/dspam/.debug to turn on) |
| 96 |
# optional: even MORE debugging output, use with extreme caution! |
97 |
# optional: even MORE debugging output, use with extreme caution! |
|
Lines 107-113
Link Here
|
| 107 |
myconf="${myconf} --enable-daemon" |
108 |
myconf="${myconf} --enable-daemon" |
| 108 |
fi |
109 |
fi |
| 109 |
|
110 |
|
| 110 |
use virtual-users && myconf="${myconf} --enable-virtual-users-users" |
111 |
use virtual-users && myconf="${myconf} --enable-virtual-users" |
| 111 |
# an experimental feature available with MySQL and PgSQL backend |
112 |
# an experimental feature available with MySQL and PgSQL backend |
| 112 |
use neural && myconf="${myconf} --enable-neural-networking" |
113 |
use neural && myconf="${myconf} --enable-neural-networking" |
| 113 |
elif use postgres ; then |
114 |
elif use postgres ; then |
|
Lines 120-132
Link Here
|
| 120 |
myconf="${myconf} --enable-daemon" |
121 |
myconf="${myconf} --enable-daemon" |
| 121 |
fi |
122 |
fi |
| 122 |
|
123 |
|
| 123 |
use virtual-users && myconf="${myconf} --enable-virtual-users-users" |
124 |
use virtual-users && myconf="${myconf} --enable-virtual-users" |
| 124 |
# an experimental feature available with MySQL and PgSQL backend |
125 |
# an experimental feature available with MySQL and PgSQL backend |
| 125 |
use neural && myconf="${myconf} --enable-neural-networking" |
126 |
use neural && myconf="${myconf} --enable-neural-networking" |
| 126 |
elif use oci8 ; then |
127 |
elif use oci8 ; then |
| 127 |
myconf="${myconf} --with-storage-driver=ora_drv" |
128 |
myconf="${myconf} --with-storage-driver=ora_drv" |
| 128 |
myconf="${myconf} --with-oracle-home=${ORACLE_HOME}" |
129 |
myconf="${myconf} --with-oracle-home=${ORACLE_HOME}" |
| 129 |
myconf="${myconf} --enable-virtual-users-users" |
130 |
myconf="${myconf} --enable-virtual-users" |
| 130 |
|
131 |
|
| 131 |
# I am in no way a Oracle specialist. If someone knows |
132 |
# I am in no way a Oracle specialist. If someone knows |
| 132 |
# how to query the version of Oracle, then let me know. |
133 |
# how to query the version of Oracle, then let me know. |
|
Lines 135-144
Link Here
|
| 135 |
fi |
136 |
fi |
| 136 |
elif use sqlite3 ; then |
137 |
elif use sqlite3 ; then |
| 137 |
myconf="${myconf} --with-storage-driver=sqlite3_drv" |
138 |
myconf="${myconf} --with-storage-driver=sqlite3_drv" |
| 138 |
myconf="${myconf} --enable-virtual-users-users" |
139 |
myconf="${myconf} --enable-virtual-users" |
| 139 |
elif use sqlite ; then |
140 |
elif use sqlite ; then |
| 140 |
myconf="${myconf} --with-storage-driver=sqlite_drv" |
141 |
myconf="${myconf} --with-storage-driver=sqlite_drv" |
| 141 |
myconf="${myconf} --enable-virtual-users-users" |
142 |
myconf="${myconf} --enable-virtual-users" |
| 142 |
else |
143 |
else |
| 143 |
myconf="${myconf} --with-storage-driver=libdb4_drv" |
144 |
myconf="${myconf} --with-storage-driver=libdb4_drv" |
| 144 |
fi |
145 |
fi |
|
Lines 158-164
Link Here
|
| 158 |
# open up perms on /etc/mail/dspam |
159 |
# open up perms on /etc/mail/dspam |
| 159 |
diropts -m0775 -o dspam -g dspam |
160 |
diropts -m0775 -o dspam -g dspam |
| 160 |
dodir ${HOMEDIR} |
161 |
dodir ${HOMEDIR} |
| 161 |
keepdir ${HOMEDIR} |
|
|
| 162 |
|
162 |
|
| 163 |
# keeps dspam data in /var |
163 |
# keeps dspam data in /var |
| 164 |
diropts -m0775 -o dspam -g dspam |
164 |
diropts -m0775 -o dspam -g dspam |
|
Lines 168-174
Link Here
|
| 168 |
# keeps dspam log in /var/log |
168 |
# keeps dspam log in /var/log |
| 169 |
diropts -m0775 -o dspam -g dspam |
169 |
diropts -m0775 -o dspam -g dspam |
| 170 |
dodir ${LOGDIR} |
170 |
dodir ${LOGDIR} |
| 171 |
keepdir ${LOGDIR} |
171 |
insinto ${LOGDIR} |
| 172 |
touch ${T}/empty.file |
172 |
touch ${T}/empty.file |
| 173 |
newins ${T}/empty.file system.log |
173 |
newins ${T}/empty.file system.log |
| 174 |
dosym ${LOGDIR}/system.log ${HOMEDIR}/system.log |
174 |
dosym ${LOGDIR}/system.log ${HOMEDIR}/system.log |
|
Lines 177-203
Link Here
|
| 177 |
dosym ${DATADIR} ${HOMEDIR}/data |
177 |
dosym ${DATADIR} ${HOMEDIR}/data |
| 178 |
|
178 |
|
| 179 |
# make install |
179 |
# make install |
| 180 |
sed -e 's/rm -f ..mandir.\(.*\)/rm -f ${D}${mandir}\1/g' \ |
|
|
| 181 |
-e 's/ln -s ..mandir.\(.*\) ..mandir.\(.*3\)/ln -s ${mandir}\1.gz ${D}${mandir}\2.gz/g' \ |
| 182 |
-i Makefile |
| 183 |
make DESTDIR=${D} install || die |
180 |
make DESTDIR=${D} install || die |
| 184 |
chmod 4755 ${D}/usr/bin/dspam |
181 |
chmod 4755 ${D}/usr/bin/dspam |
| 185 |
chmod 4755 ${D}/usr/bin/dspam_stats |
182 |
chmod 4755 ${D}/usr/bin/dspam_stats |
| 186 |
|
183 |
|
| 187 |
# documentation |
184 |
# documentation |
| 188 |
dodoc CHANGELOG LICENSE README* RELEASE.NOTES UPGRADING |
185 |
dodoc CHANGELOG LICENSE README* RELEASE.NOTES UPGRADING |
|
|
186 |
dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz |
| 187 |
docinto doc |
| 188 |
dodoc doc/*.txt |
| 189 |
docinto gentoo |
| 189 |
dodoc ${FILESDIR}/README.postfix ${FILESDIR}/README.qmail |
190 |
dodoc ${FILESDIR}/README.postfix ${FILESDIR}/README.qmail |
| 190 |
if use mysql; then |
|
|
| 191 |
dodoc src/tools.mysql_drv/README |
| 192 |
elif use postgres ; then |
| 193 |
dodoc src/tools.pgsql_drv/README |
| 194 |
elif use oci8 ; then |
| 195 |
dodoc src/tools.ora_drv/README |
| 196 |
elif use sqlite || sqlite3 ; then |
| 197 |
dodoc src/tools.sqlite_drv/README |
| 198 |
fi |
| 199 |
doman man/dspam* |
191 |
doman man/dspam* |
| 200 |
dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz |
|
|
| 201 |
|
192 |
|
| 202 |
# build some initial configuration data |
193 |
# build some initial configuration data |
| 203 |
cp src/dspam.conf ${T}/dspam.conf |
194 |
cp src/dspam.conf ${T}/dspam.conf |
|
Lines 262-268
Link Here
|
| 262 |
-e "s:^#*\(MySQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \ |
253 |
-e "s:^#*\(MySQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \ |
| 263 |
-e "s:^#*\(MySQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \ |
254 |
-e "s:^#*\(MySQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \ |
| 264 |
-e "s:^#*\(MySQLCompress[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[5]}:gI" \ |
255 |
-e "s:^#*\(MySQLCompress[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[5]}:gI" \ |
| 265 |
${T}/dspam.conf |
256 |
-i ${T}/dspam.conf |
| 266 |
for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do |
257 |
for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do |
| 267 |
echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/mysql.data |
258 |
echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/mysql.data |
| 268 |
done |
259 |
done |
|
Lines 272-278
Link Here
|
| 272 |
newins src/tools.mysql_drv/mysql_objects-space.sql mysql_objects-space.sql |
263 |
newins src/tools.mysql_drv/mysql_objects-space.sql mysql_objects-space.sql |
| 273 |
newins src/tools.mysql_drv/mysql_objects-speed.sql mysql_objects-speed.sql |
264 |
newins src/tools.mysql_drv/mysql_objects-speed.sql mysql_objects-speed.sql |
| 274 |
newins src/tools.mysql_drv/mysql_objects-4.1.sql mysql_objects-4.1.sql |
265 |
newins src/tools.mysql_drv/mysql_objects-4.1.sql mysql_objects-4.1.sql |
| 275 |
newins src/tools.mysql_drv/virtual-users_users.sql mysql_virtual-users_users.sql |
266 |
newins src/tools.mysql_drv/virtual_users.sql mysql_virtual_users.sql |
| 276 |
newins src/tools.mysql_drv/neural.sql mysql_neural.sql |
267 |
newins src/tools.mysql_drv/neural.sql mysql_neural.sql |
| 277 |
newins src/tools.mysql_drv/purge.sql mysql_purge.sql |
268 |
newins src/tools.mysql_drv/purge.sql mysql_purge.sql |
| 278 |
newins src/tools.mysql_drv/purge-4.1.sql mysql_purge-4.1.sql |
269 |
newins src/tools.mysql_drv/purge-4.1.sql mysql_purge-4.1.sql |
|
Lines 308-314
Link Here
|
| 308 |
insopts -m644 -o dspam -g dspam |
299 |
insopts -m644 -o dspam -g dspam |
| 309 |
doins ${T}/pgsql.data |
300 |
doins ${T}/pgsql.data |
| 310 |
newins src/tools.pgsql_drv/pgsql_objects.sql pgsql_objects.sql |
301 |
newins src/tools.pgsql_drv/pgsql_objects.sql pgsql_objects.sql |
| 311 |
newins src/tools.pgsql_drv/virtual-users_users.sql pgsql_virtual-users_users.sql |
302 |
newins src/tools.pgsql_drv/virtual_users.sql pgsql_virtual_users.sql |
| 312 |
newins src/tools.pgsql_drv/purge.sql pgsql_purge.sql |
303 |
newins src/tools.pgsql_drv/purge.sql pgsql_purge.sql |
| 313 |
|
304 |
|
| 314 |
elif use oci8 ; then |
305 |
elif use oci8 ; then |
|
Lines 339-345
Link Here
|
| 339 |
insopts -m644 -o dspam -g dspam |
330 |
insopts -m644 -o dspam -g dspam |
| 340 |
doins ${T}/oracle.data |
331 |
doins ${T}/oracle.data |
| 341 |
newins src/tools.ora_drv/oral_objects.sql ora_objects.sql |
332 |
newins src/tools.ora_drv/oral_objects.sql ora_objects.sql |
| 342 |
newins src/tools.ora_drv/virtual-users_users.sql ora_virtual-users_users.sql |
333 |
newins src/tools.ora_drv/virtual_users.sql ora_virtual_users.sql |
| 343 |
newins src/tools.ora_drv/purge.sql ora_purge.sql |
334 |
newins src/tools.ora_drv/purge.sql ora_purge.sql |
| 344 |
elif use sqlite || sqlite3 ; then |
335 |
elif use sqlite || sqlite3 ; then |
| 345 |
insinto ${HOMEDIR} |
336 |
insinto ${HOMEDIR} |
|
Lines 358-364
Link Here
|
| 358 |
# -> The documentation is wrong! The files need to be in ./txt |
349 |
# -> The documentation is wrong! The files need to be in ./txt |
| 359 |
diropts -m0775 -o dspam -g dspam |
350 |
diropts -m0775 -o dspam -g dspam |
| 360 |
dodir ${HOMEDIR}/txt |
351 |
dodir ${HOMEDIR}/txt |
| 361 |
keepdir ${HOMEDIR}/txt |
|
|
| 362 |
insinto ${HOMEDIR}/txt |
352 |
insinto ${HOMEDIR}/txt |
| 363 |
insopts -m644 -o dspam -g dspam |
353 |
insopts -m644 -o dspam -g dspam |
| 364 |
doins ${S}/txt/*.txt |
354 |
doins ${S}/txt/*.txt |
|
Lines 373-379
Link Here
|
| 373 |
# logrotation scripts |
363 |
# logrotation scripts |
| 374 |
diropts -m0755 -o dspam -g dspam |
364 |
diropts -m0755 -o dspam -g dspam |
| 375 |
dodir /etc/logrotate.d |
365 |
dodir /etc/logrotate.d |
| 376 |
keepdir /etc/logrotate.d |
|
|
| 377 |
insinto /etc/logrotate.d |
366 |
insinto /etc/logrotate.d |
| 378 |
insopts -m0755 -o dspam -g dspam |
367 |
insopts -m0755 -o dspam -g dspam |
| 379 |
newins ${FILESDIR}/logrotate.dspam dspam |
368 |
newins ${FILESDIR}/logrotate.dspam dspam |
|
Lines 381-387
Link Here
|
| 381 |
# dspam cron job |
370 |
# dspam cron job |
| 382 |
diropts -m0755 -o dspam -g dspam |
371 |
diropts -m0755 -o dspam -g dspam |
| 383 |
dodir /etc/cron.daily |
372 |
dodir /etc/cron.daily |
| 384 |
keepdir /etc/cron.daily |
|
|
| 385 |
exeinto /etc/cron.daily |
373 |
exeinto /etc/cron.daily |
| 386 |
exeopts -m0755 -o dspam -g dspam |
374 |
exeopts -m0755 -o dspam -g dspam |
| 387 |
doexe ${FILESDIR}/dspam.cron |
375 |
doexe ${FILESDIR}/dspam.cron |
|
Lines 448-455
Link Here
|
| 448 |
/usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_objects-speed.sql |
436 |
/usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_objects-speed.sql |
| 449 |
fi |
437 |
fi |
| 450 |
|
438 |
|
| 451 |
einfo "Creating DSPAM MySQL database for virtual-users users" |
439 |
einfo "Creating DSPAM MySQL database for virtual users" |
| 452 |
/usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_virtual-users_users.sql |
440 |
/usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_virtual_users.sql |
| 453 |
|
441 |
|
| 454 |
if use neural ; then |
442 |
if use neural ; then |
| 455 |
/usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_neural.sql |
443 |
/usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_neural.sql |
|
Lines 476-482
Link Here
|
| 476 |
|
464 |
|
| 477 |
einfo "Creating DSPAM PostgreSQL tables" |
465 |
einfo "Creating DSPAM PostgreSQL tables" |
| 478 |
PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${HOMEDIR}/pgsql_objects.sql 1>/dev/null 2>&1 |
466 |
PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${HOMEDIR}/pgsql_objects.sql 1>/dev/null 2>&1 |
| 479 |
PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${HOMEDIR}/pgsql_virtual-users_users.sql 1>/dev/null 2>&1 |
467 |
PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${HOMEDIR}/pgsql_virtual_users.sql 1>/dev/null 2>&1 |
| 480 |
|
468 |
|
| 481 |
elif use oci8 ; then |
469 |
elif use oci8 ; then |
| 482 |
[[ -f ${HOMEDIR}/oracle.data ]] && mv -f ${HOMEDIR}/oracle.data ${HOMEDIR} |
470 |
[[ -f ${HOMEDIR}/oracle.data ]] && mv -f ${HOMEDIR}/oracle.data ${HOMEDIR} |