summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlin Năstac <mrness@gentoo.org>2006-10-29 09:55:59 +0000
committerAlin Năstac <mrness@gentoo.org>2006-10-29 09:55:59 +0000
commitc9026dd0d4abec41ddf301091e7e6ce7bca0cd70 (patch)
treea2c192e80977c28c318b31b2de9b9720becad2f3 /mail-filter
parentAdd myself as maintainer. Version bump, with most Debian patches applied (#13... (diff)
downloadgentoo-2-c9026dd0d4abec41ddf301091e7e6ce7bca0cd70.tar.gz
gentoo-2-c9026dd0d4abec41ddf301091e7e6ce7bca0cd70.tar.bz2
gentoo-2-c9026dd0d4abec41ddf301091e7e6ce7bca0cd70.zip
Add myself as maintainer. Version bump, with most Debian patches applied (#135917). Fix dspam executable permissions (#128024). Remove obsolete versions.
(Portage version: 2.1.1) (Signed Manifest commit)
Diffstat (limited to 'mail-filter')
-rw-r--r--mail-filter/dspam/Manifest107
-rw-r--r--mail-filter/dspam/dspam-3.2.7.ebuild382
-rw-r--r--mail-filter/dspam/dspam-3.4.9.ebuild518
-rw-r--r--mail-filter/dspam/dspam-3.6.0.ebuild491
-rw-r--r--mail-filter/dspam/dspam-3.6.1.ebuild481
-rw-r--r--mail-filter/dspam/dspam-3.6.2.ebuild481
-rw-r--r--mail-filter/dspam/dspam-3.6.3.ebuild481
-rw-r--r--mail-filter/dspam/dspam-3.6.4.ebuild474
-rw-r--r--mail-filter/dspam/dspam-3.6.5.ebuild487
-rw-r--r--mail-filter/dspam/files/crontab.db43
-rw-r--r--mail-filter/dspam/files/crontab.mysql4
-rw-r--r--mail-filter/dspam/files/digest-dspam-3.2.71
-rw-r--r--mail-filter/dspam/files/digest-dspam-3.4.94
-rw-r--r--mail-filter/dspam/files/digest-dspam-3.6.04
-rw-r--r--mail-filter/dspam/files/digest-dspam-3.6.14
-rw-r--r--mail-filter/dspam/files/digest-dspam-3.6.24
-rw-r--r--mail-filter/dspam/files/digest-dspam-3.6.34
-rw-r--r--mail-filter/dspam/files/digest-dspam-3.6.46
-rw-r--r--mail-filter/dspam/files/digest-dspam-3.6.56
19 files changed, 27 insertions, 3915 deletions
diff --git a/mail-filter/dspam/Manifest b/mail-filter/dspam/Manifest
index af0994582163..c7b8cc0a65f0 100644
--- a/mail-filter/dspam/Manifest
+++ b/mail-filter/dspam/Manifest
@@ -1,3 +1,6 @@
+-----BEGIN PGP SIGNED MESSAGE-----
+Hash: SHA1
+
AUX README.postfix 309 RMD160 34f35ffa4e393ba1791cef2800bc8b4d4f49df5b SHA1 c004a3e7d54dfdd6fae8a654e44d0b9240935739 SHA256 e0928cf2d734e79419c30a4ee829962351ef5a1247ed1d1ddf3b58410e14828b
MD5 c12a54112c6fec3530a7b1a368d04ac8 files/README.postfix 309
RMD160 34f35ffa4e393ba1791cef2800bc8b4d4f49df5b files/README.postfix 309
@@ -6,14 +9,6 @@ AUX README.qmail 2317 RMD160 ebdd90be77441540848caf39b6fcde3d332b2b93 SHA1 081b2
MD5 e0469b961385fda4305602dc2519d319 files/README.qmail 2317
RMD160 ebdd90be77441540848caf39b6fcde3d332b2b93 files/README.qmail 2317
SHA256 c70a32eb183401f3d36b8e13c1e298875692b8a9d3f34151ae42b172dd6f064a files/README.qmail 2317
-AUX crontab.db4 196 RMD160 f1f9b7df67029b81d185cadf531c6310b1a90fb1 SHA1 8d706e926947b32d339c9217efd245c2ed7a71d8 SHA256 d10ae01b52ac1710ebefe44f54d05bde315a1d59e58bb5d106d728babff3f36a
-MD5 cd1bdb75fd86304f9453741a910cb8a2 files/crontab.db4 196
-RMD160 f1f9b7df67029b81d185cadf531c6310b1a90fb1 files/crontab.db4 196
-SHA256 d10ae01b52ac1710ebefe44f54d05bde315a1d59e58bb5d106d728babff3f36a files/crontab.db4 196
-AUX crontab.mysql 118 RMD160 9948beccbe686a23e32b06c569dbc3701a1abd6e SHA1 cb5b50e2f35dc52b3bfff7d9a72f9e22a7cbdfbd SHA256 e6ae345c6be2fc9e741e9f83a1b0399b2a6b362a062a9fe94ff01861d300cee4
-MD5 f2f86e8f7ab440c8537f40fa18a0ee43 files/crontab.mysql 118
-RMD160 9948beccbe686a23e32b06c569dbc3701a1abd6e files/crontab.mysql 118
-SHA256 e6ae345c6be2fc9e741e9f83a1b0399b2a6b362a062a9fe94ff01861d300cee4 files/crontab.mysql 118
AUX dspam.cron 4365 RMD160 480ee9f38e938e326d8027a3ea9278627104f4ac SHA1 4647273e98d0895f74e8bed9b868e164afa475bb SHA256 4c5e354832d89e8de6fdd1666c68cad66cd93f65ba53b7c3badf409a613c70f1
MD5 c587b15b04392911dd203bb84b410fc1 files/dspam.cron 4365
RMD160 480ee9f38e938e326d8027a3ea9278627104f4ac files/dspam.cron 4365
@@ -26,84 +21,36 @@ AUX logrotate.dspam 156 RMD160 256f2607b275336f944b0882591366c39b53daf7 SHA1 280
MD5 2163ca41de383f09f4d754e2d35cb158 files/logrotate.dspam 156
RMD160 256f2607b275336f944b0882591366c39b53daf7 files/logrotate.dspam 156
SHA256 75e04139e564ad55011ee77b8245dc5cdefbb6d56ca451feab5861ab907d614e files/logrotate.dspam 156
-DIST dspam-3.2.7.tar.gz 621245
-DIST dspam-3.4.9.tar.gz 701069
-DIST dspam-3.6.0.tar.gz 732042
-DIST dspam-3.6.1.tar.gz 739389
-DIST dspam-3.6.2.tar.gz 740001
-DIST dspam-3.6.3.tar.gz 740097
-DIST dspam-3.6.4.tar.gz 743664 RMD160 fcd431205e3fd737cfdfb90b695ba7c84bbb27d5 SHA1 bc11d8c1584175de9cdeed7ed20e11c2a49bf53a SHA256 bdb10acbff97483db8ef7aafee8ba2e9113f6b7d5fc76cf569334b32937ca304
-DIST dspam-3.6.5.tar.gz 747196 RMD160 363217410de515f15baaa0a864ee23617ae8f6c2 SHA1 031d3fbeb1fb0d8008dcc1cf7589d4d955e7f933 SHA256 d8033773840f51cad27466b018e26c5232990f576108af79f6aa910bc2556fda
DIST dspam-3.6.6.tar.gz 725502 RMD160 2416908398e7e8e6a180e97dbebd4f9aee6088d7 SHA1 6113966122597c277d51b7f27539b899c3dcf847 SHA256 af9b9429ee3b69c5d1fe8e8891f21c8640ca572f6244a794835646301ce84e91
+DIST dspam-3.6.8-patches-20061029.tar.gz 4708 RMD160 18a0eaf66614327911c15fb11814116b4a589625 SHA1 0b5b286c0b6131dbda9de030a9f61333f32dc47a SHA256 0a99b2d4c0a43a955517058de5ecffcb15a3f6dc1dfb5f676616e097b719bc19
+DIST dspam-3.6.8.tar.gz 743275 RMD160 93a70db14070cb61bd2ef1b0ca55a18be1dbfd7b SHA1 e8c413882eadf1e02837e4a2ffcfc98b801eded1 SHA256 88c7b41fb81e90ba8a260885a1d14bce39f2ef4a06cc2c6b8bfa0b99ba1aec34
DIST dspam_sa_trainer.tar.gz 1230 RMD160 c3d0fca7169d23ecf9d44c850ee255b42d97d818 SHA1 71a002f26a888bdfe47759cf1f780cd6478dacac SHA256 8fb6b1ebe592acf00a028737ef8e174544af166768b987d29048b2319bc5a215
-EBUILD dspam-3.2.7.ebuild 15522 RMD160 23a4c5f7b2bc6e3678ac7ac2f52b082b6b0c78ff SHA1 44898e114b325a55d07256553e40c5187bd2ce5a SHA256 fd4058d2906f69dfedca2503f4ddbb9fee9188d2bde6bc65ec4ddd71821e9b9c
-MD5 d67e6503fcd6df5a6b7875c95c3d082a dspam-3.2.7.ebuild 15522
-RMD160 23a4c5f7b2bc6e3678ac7ac2f52b082b6b0c78ff dspam-3.2.7.ebuild 15522
-SHA256 fd4058d2906f69dfedca2503f4ddbb9fee9188d2bde6bc65ec4ddd71821e9b9c dspam-3.2.7.ebuild 15522
-EBUILD dspam-3.4.9.ebuild 19643 RMD160 2ed5893c13fb9ff727bc092ae6ac6b550f4f340c SHA1 ee6860168d6e2454afd4c03b347acc43b0aaa247 SHA256 2c31f1e96d682d85f4ec64c748a385aa6d64541adc293300c031b531dcfffcba
-MD5 1357c22572c375162a93d9be034d53cd dspam-3.4.9.ebuild 19643
-RMD160 2ed5893c13fb9ff727bc092ae6ac6b550f4f340c dspam-3.4.9.ebuild 19643
-SHA256 2c31f1e96d682d85f4ec64c748a385aa6d64541adc293300c031b531dcfffcba dspam-3.4.9.ebuild 19643
-EBUILD dspam-3.6.0.ebuild 18417 RMD160 23e253a75d5c26ce2739583013f900bd5e999aa6 SHA1 3f6c22f5e2472e142e8b7c247e9fda70fe1987b4 SHA256 1bb0dd4ff675eabf6255d0ab385335691d2428701a037f979da79196bcca1a84
-MD5 e117e7b4c6a7b15bd24832c416c106f3 dspam-3.6.0.ebuild 18417
-RMD160 23e253a75d5c26ce2739583013f900bd5e999aa6 dspam-3.6.0.ebuild 18417
-SHA256 1bb0dd4ff675eabf6255d0ab385335691d2428701a037f979da79196bcca1a84 dspam-3.6.0.ebuild 18417
-EBUILD dspam-3.6.1.ebuild 18243 RMD160 16e0cea71d783d6acf1200390d6c5a7882c3c2ba SHA1 7919cc90e714094e9478e66df65d2d117d6ddb25 SHA256 d01a6acfddfbd0b767297818192a69db3c5a24cc4ad0e415518690e65f62a18c
-MD5 64c1c2f016fbf8a85f9877ef6a757618 dspam-3.6.1.ebuild 18243
-RMD160 16e0cea71d783d6acf1200390d6c5a7882c3c2ba dspam-3.6.1.ebuild 18243
-SHA256 d01a6acfddfbd0b767297818192a69db3c5a24cc4ad0e415518690e65f62a18c dspam-3.6.1.ebuild 18243
-EBUILD dspam-3.6.2.ebuild 18243 RMD160 8b8a4dba999c8164a30715f5da0ffc58dbb89a14 SHA1 d103be24c4bdecb0c005ea6e27b2f82d38a3ccbc SHA256 25ffa4a2359ca1ec1bfe6bff1990e4d16c0d075c82924e200096f2da17bbc423
-MD5 16f46fe5b2ee6a9deb4e8cd7fd7254c1 dspam-3.6.2.ebuild 18243
-RMD160 8b8a4dba999c8164a30715f5da0ffc58dbb89a14 dspam-3.6.2.ebuild 18243
-SHA256 25ffa4a2359ca1ec1bfe6bff1990e4d16c0d075c82924e200096f2da17bbc423 dspam-3.6.2.ebuild 18243
-EBUILD dspam-3.6.3.ebuild 18245 RMD160 0a60874b910029b0c6998aaa51a469977493fd62 SHA1 9ecedc80a2938b7e8660dfc7d32d9c13f853b5d4 SHA256 8f153964373e03e1c54fefcbd570382b3a0a205ce36d63cea7acde48866ae4ce
-MD5 5ba2779930edea12864163bc70f3b161 dspam-3.6.3.ebuild 18245
-RMD160 0a60874b910029b0c6998aaa51a469977493fd62 dspam-3.6.3.ebuild 18245
-SHA256 8f153964373e03e1c54fefcbd570382b3a0a205ce36d63cea7acde48866ae4ce dspam-3.6.3.ebuild 18245
-EBUILD dspam-3.6.4.ebuild 17922 RMD160 b711630c2e1011bdf2b679c061caabd45b0b510d SHA1 3687fcf5ce5de96234f2356a6c8243cbee13a3dd SHA256 f78495bb845b3f25491c980154b96ef011ce035fa04264c4db526b25d8351430
-MD5 a93b879b8b6bd6b07807e0f96efa9cff dspam-3.6.4.ebuild 17922
-RMD160 b711630c2e1011bdf2b679c061caabd45b0b510d dspam-3.6.4.ebuild 17922
-SHA256 f78495bb845b3f25491c980154b96ef011ce035fa04264c4db526b25d8351430 dspam-3.6.4.ebuild 17922
-EBUILD dspam-3.6.5.ebuild 18106 RMD160 a147f776b23e86a0508c82cffd629280f716debc SHA1 3e863ccb8631bc5c1587a60b391272fc88ea2484 SHA256 37bd3a06bd725a2c3d9b4aa4578209df3c29a6bc8e482d6b4773dc8c2a301423
-MD5 a91baaaa7453f6770e4bbd23a555e31d dspam-3.6.5.ebuild 18106
-RMD160 a147f776b23e86a0508c82cffd629280f716debc dspam-3.6.5.ebuild 18106
-SHA256 37bd3a06bd725a2c3d9b4aa4578209df3c29a6bc8e482d6b4773dc8c2a301423 dspam-3.6.5.ebuild 18106
EBUILD dspam-3.6.6.ebuild 18443 RMD160 bd532f01a3c311b4e0e2745a77b571c4c4c5f164 SHA1 c973fa7a0a86f64eb9da6438cf4fc6e18b3cbf51 SHA256 127c1b4a37774f89c30f2cab79a9a1db7965e06dc652ae6391005e458a0166ee
MD5 4f0ac34154c870fc968a83f75da6aed1 dspam-3.6.6.ebuild 18443
RMD160 bd532f01a3c311b4e0e2745a77b571c4c4c5f164 dspam-3.6.6.ebuild 18443
SHA256 127c1b4a37774f89c30f2cab79a9a1db7965e06dc652ae6391005e458a0166ee dspam-3.6.6.ebuild 18443
-MISC ChangeLog 13315 RMD160 db5572ef2636431ac086d9e2f69f682d21cc3dff SHA1 97c555b0b3e64117639bcce55a8d4d9ef92834aa SHA256 1f7db5cc919465fc62489b57f7b6eb7eac0d9e9f5ee2123440d276d1af8f0808
-MD5 84ce5c9cddaab462a995404cdafa3075 ChangeLog 13315
-RMD160 db5572ef2636431ac086d9e2f69f682d21cc3dff ChangeLog 13315
-SHA256 1f7db5cc919465fc62489b57f7b6eb7eac0d9e9f5ee2123440d276d1af8f0808 ChangeLog 13315
-MISC metadata.xml 308 RMD160 e00f0ac6e9ed220c85106ef5b3f3f10c2ae7367e SHA1 e9dc7ddf99267bec249b7d0912c85edbd049415c SHA256 22e22f11e18ee12d274bff94c5d12acb02acd5a823fb2e5ebe0d0da609e3507e
-MD5 dbfbe5a3bbe3347938107f5f5bd2197e metadata.xml 308
-RMD160 e00f0ac6e9ed220c85106ef5b3f3f10c2ae7367e metadata.xml 308
-SHA256 22e22f11e18ee12d274bff94c5d12acb02acd5a823fb2e5ebe0d0da609e3507e metadata.xml 308
-MD5 7735956f416bd58bfcbeee99af43bea0 files/digest-dspam-3.2.7 63
-RMD160 ce7960915bff3c533ccffc2698ab6a2a44e63623 files/digest-dspam-3.2.7 63
-SHA256 f30a88498275e3e0f401a373c3fd8f0e7f6669cf1eac9f06a7a6addbbe1be1d5 files/digest-dspam-3.2.7 63
-MD5 ee0c1728b9970396b2dc3e6ad9f19814 files/digest-dspam-3.4.9 307
-RMD160 0987f5426405af6ba7f388aeabcfb5ca414193f5 files/digest-dspam-3.4.9 307
-SHA256 fad58959ad86132800ed6553f326cc062977ee2cf131e7c2396d4c4f88134f71 files/digest-dspam-3.4.9 307
-MD5 5d26a02c843bba0970293036316f69f9 files/digest-dspam-3.6.0 307
-RMD160 f6e28a5357414e64aa8138459a51409637cb6f71 files/digest-dspam-3.6.0 307
-SHA256 5f2ae10e662c8d1a5e15ffda06a1838738429826e18c3e60174ea8ce8edddadf files/digest-dspam-3.6.0 307
-MD5 c3827b663184fad6c386e88ad9bc6022 files/digest-dspam-3.6.1 307
-RMD160 abc146b44aa85ae5746450078a1f5642609115f5 files/digest-dspam-3.6.1 307
-SHA256 0bc2a58c23efdcb04d25384543f8f4f7741249d74961a11bbe99fbb4705f32a6 files/digest-dspam-3.6.1 307
-MD5 d607a64e184f4f66e5e99c85c33377f3 files/digest-dspam-3.6.2 307
-RMD160 fa8fee7f1c51d8dfc8c218b99c1cf51587f7ed67 files/digest-dspam-3.6.2 307
-SHA256 5d7ffc888b0470d5248e1bc5f9fee964e0bb70df6a98b8b87d9327ff48361148 files/digest-dspam-3.6.2 307
-MD5 fc5fd9593dd3de524487ad2631681afb files/digest-dspam-3.6.3 307
-RMD160 9fd1beb7cbfb9c56ffc6e76eb0662dbd0b31d7e0 files/digest-dspam-3.6.3 307
-SHA256 f5d0cae0eac4d5c18af96901e4d9dadc7def244c3845d28e5e8813b4c5d976bf files/digest-dspam-3.6.3 307
-MD5 7581683a18b328f3fa07b2904787e0bd files/digest-dspam-3.6.4 479
-RMD160 9ef62154897f5cdcd28c2ab1f04ccad9f19b8967 files/digest-dspam-3.6.4 479
-SHA256 af3f77afae9380d52f6f7910135aad0fda7b9c080b6ce9f88919abee9247d421 files/digest-dspam-3.6.4 479
-MD5 9b229c1d1f7fa7be228708ed9fa207ca files/digest-dspam-3.6.5 479
-RMD160 10e827a6f0086d3c3a23b4bcd320531b970ec81b files/digest-dspam-3.6.5 479
-SHA256 238cd33e9ba52ee7b6acca73c12febcb30a5e33479a4b15ab9bc597ce901e9ea files/digest-dspam-3.6.5 479
+EBUILD dspam-3.6.8.ebuild 15885 RMD160 e908060b3c624d1a835d565eb3310d148b1dbe4d SHA1 5161bfd3aa147037ea5b16a577c56aa4e0546a6c SHA256 1d3dc715768ec80fb19af77b1b48cdc3399cd8651fff4a5805999d3f2f1c2e45
+MD5 e10bff34d0dd9cb8de670251d6c59d8e dspam-3.6.8.ebuild 15885
+RMD160 e908060b3c624d1a835d565eb3310d148b1dbe4d dspam-3.6.8.ebuild 15885
+SHA256 1d3dc715768ec80fb19af77b1b48cdc3399cd8651fff4a5805999d3f2f1c2e45 dspam-3.6.8.ebuild 15885
+MISC ChangeLog 13805 RMD160 e84cb42895a11262cbeeae3cc86026095830633c SHA1 7923ddb5e5a50e43dec7fc73311dbb2690dd286d SHA256 a34c0d4f29f71c4b5ffcedb7bc43a2fc86a87ff59ece892d848b52ed081440ef
+MD5 43e699446a7ee2c39bf41d1e8ae8cfde ChangeLog 13805
+RMD160 e84cb42895a11262cbeeae3cc86026095830633c ChangeLog 13805
+SHA256 a34c0d4f29f71c4b5ffcedb7bc43a2fc86a87ff59ece892d848b52ed081440ef ChangeLog 13805
+MISC metadata.xml 397 RMD160 1d897be7c5d2f12f25490fa6ece53d7dacbe1427 SHA1 5d77bb1cd119d2ff52d65d9256dff9dca7ebcf6f SHA256 19348733b588bec627f76b297a101b21bc9ae7021a2f55fe12240b1dfa176a77
+MD5 91827a3d521f4dd3c43a9a062a052e7c metadata.xml 397
+RMD160 1d897be7c5d2f12f25490fa6ece53d7dacbe1427 metadata.xml 397
+SHA256 19348733b588bec627f76b297a101b21bc9ae7021a2f55fe12240b1dfa176a77 metadata.xml 397
MD5 7af3180e32cd59d6be1665812e5900a5 files/digest-dspam-3.6.6 479
RMD160 d37fce937cfec8e8c86d94bf14cf34c9f7fd14d3 files/digest-dspam-3.6.6 479
SHA256 4019ae3c73affe51f0da1bcae2d8c7fbf7e70975c066b09a9b2b1ec89f5be575 files/digest-dspam-3.6.6 479
+MD5 f6c72f4cb4280567df3f0314ee5bd80e files/digest-dspam-3.6.8 759
+RMD160 54ffa216d408f063d593a72de352d5962d98d0fe files/digest-dspam-3.6.8 759
+SHA256 e85b534fc684da80b301dc86903ea7377128d8e835b57fad99d6ed706f74b0dc files/digest-dspam-3.6.8 759
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.4.5 (GNU/Linux)
+
+iD8DBQFFRHqq3sf9c6kjmR8RAsG4AKC5PkwQcMXmBmSVkLv0u8TVsrE0ZgCgmGVM
+IlP7ec836fX6/xtNE5cxtzg=
+=1XUm
+-----END PGP SIGNATURE-----
diff --git a/mail-filter/dspam/dspam-3.2.7.ebuild b/mail-filter/dspam/dspam-3.2.7.ebuild
deleted file mode 100644
index 23b48e51fa91..000000000000
--- a/mail-filter/dspam/dspam-3.2.7.ebuild
+++ /dev/null
@@ -1,382 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.2.7.ebuild,v 1.5 2006/01/08 17:29:50 rl03 Exp $
-
-inherit eutils
-
-DESCRIPTION="A statistical-algorithmic hybrid anti-spam filter"
-SRC_URI="http://dspam.nuclearelephant.com/sources/${P}.tar.gz"
-HOMEPAGE="http://dspam.nuclearelephant.com/"
-LICENSE="GPL-2"
-
-IUSE="cyrus debug exim mysql maildrop neural oci8 postgres procmail sqlite large-domain"
-DEPEND="exim? ( >=mail-mta/exim-4.34 )
- mysql? ( >=dev-db/mysql-3.23 ) || ( >=sys-libs/db-4.0 )
- sqlite? ( <dev-db/sqlite-3 )
- maildrop? ( ( >=mail-filter/maildrop-1.5.3 ) || ( >=mail-mta/courier-0.46 ) )
- postgres? ( >=dev-db/postgresql-7.4.3 )
- procmail? ( >=mail-filter/procmail-3.22 )
- x86? ( cyrus? ( >=net-mail/cyrus-imapd-2.1.15 ) )
- "
-RDEPEND="sys-process/cronbase
- app-admin/logrotate"
-KEYWORDS="~x86 ~ppc ~alpha"
-SLOT="0"
-
-# some FHS-like structure
-HOMEDIR="/etc/mail/dspam"
-DATADIR="/var/spool/dspam"
-LOGDIR="/var/log/dspam"
-
-pkg_setup() {
- if (use mysql && use postgres) || \
- (use mysql && use oci8) || \
- (use mysql && use sqlite) || \
- (use postgres && use oci8) || \
- (use postgres && use sqlite) || \
- (use sqlite && use oci8); then
- echo
- ewarn "You have two of either \"mysql\", \"postgres\", \"oci8\" or \"sqlite\" in your USE flags."
- ewarn "Will default to MySQL as your dspam database backend."
- ewarn "If you want to build with Postgres/Oracle/SQLite support; hit Control-C now."
- ewarn "Change your USE flag -mysql and emerge again."
- echo
- has_version ">=sys-apps/portage-2.0.50" && (
- einfo "It would be best practice to add the set of USE flags that you use for this"
- einfo "package to the file: /etc/portage/package.use. Example:"
- einfo "\`echo \"net-mail/dspam -mysql postgres -oci8 -sqlite\" >> /etc/portage/package.use\`"
- einfo "to build dspam with Postgres database as your dspam backend."
- )
- echo
- ewarn "Waiting 30 seconds before starting..."
- ewarn "(Control-C to abort)..."
- epause 30
- fi
- id dspam 2>/dev/null || enewgroup dspam 26
- id dspam 2>/dev/null || enewuser dspam 26 /bin/bash ${HOMEDIR} dspam
-}
-
-src_compile() {
- local myconf
-
- # these are the default settings
- myconf="${myconf} --with-signature-life=14"
- myconf="${myconf} --enable-broken-return-codes"
- myconf="${myconf} --enable-experimental"
- myconf="${myconf} --enable-long-username"
- myconf="${myconf} --enable-robinson"
- #myconf="${myconf} --enable-chi-square"
- #myconf="${myconf} --enable-robinson-pvalues"
- #myconf="${myconf} --enable-broken-mta"
- use large-domain && myconf="${myconf} --enable-large-scale" || myconf="${myconf} --enable-domain-scale"
-
- myconf="${myconf} --with-dspam-mode=4755"
- myconf="${myconf} --with-dspam-owner=dspam"
- myconf="${myconf} --with-dspam-group=dspam"
- myconf="${myconf} --with-dspam-home=${HOMEDIR} --sysconfdir=${HOMEDIR}"
- myconf="${myconf} --with-logdir=${LOGDIR}"
-
- # enables support for debugging (touch /etc/dspam/.debug to turn on)
- # optional: even MORE debugging output, use with extreme caution!
- use debug && myconf="${myconf} --enable-debug --enable-verbose-debug"
-
- # select storage driver
- if use mysql; then
- myconf="${myconf} --with-storage-driver=mysql_drv"
- myconf="${myconf} --with-mysql-includes=/usr/include/mysql"
- myconf="${myconf} --with-mysql-libraries=/usr/lib/mysql"
- myconf="${myconf} --with-client-compression"
- myconf="${myconf} --enable-virtual-users"
- myconf="${myconf} --enable-preferences-extension"
-
- # an experimental feature available with MySQL and PgSQL backend
- if use neural ; then
- myconf="${myconf} --enable-neural-networking"
- fi
- elif use postgres ; then
- myconf="${myconf} --with-storage-driver=pgsql_drv"
- myconf="${myconf} --with-pgsql-includes=/usr/include/postgresql"
- myconf="${myconf} --with-pgsql-libraries=/usr/lib/postgresql"
- myconf="${myconf} --enable-virtual-users"
- myconf="${myconf} --enable-preferences-extension"
-
- # an experimental feature available with MySQL and PgSQL backend
- if use neural ; then
- myconf="${myconf} --enable-neural-networking"
- fi
- elif use oci8 ; then
- myconf="${myconf} --with-storage-driver=ora_drv"
- myconf="${myconf} --with-oracle-home=${ORACLE_HOME}"
- myconf="${myconf} --enable-virtual-users"
- myconf="${myconf} --enable-preferences-extension"
-
- # I am in no way a Oracle specialist. If someone knows
- # how to query the version of Oracle, then let me know.
- if (expr ${ORACLE_HOME/*\/} : 10 1>/dev/null 2>&1)
- then
- --with-oracle-version=MAJOR
- myconf="${myconf} --with-oracle-version=10"
- fi
- elif use sqlite ; then
- myconf="${myconf} --with-storage-driver=sqlite_drv"
- myconf="${myconf} --enable-virtual-users"
-
- else
- myconf="${myconf} --with-storage-driver=libdb4_drv"
- fi
-
- econf ${myconf} || die
- emake || die
-
-}
-
-src_install () {
- # open up perms on /etc/mail/dspam
- diropts -m0775 -o dspam -g dspam
- dodir ${HOMEDIR}
- keepdir ${HOMEDIR}
-
- # keeps dspam data in /var
- dodir ${DATADIR}
- keepdir ${DATADIR}
-
- # keeps dspam log in /var/log
- dodir ${LOGDIR}
- keepdir ${LOGDIR}
- # ${HOMEDIR}/data is a symlink to ${DATADIR}
- dosym ${DATADIR} ${HOMEDIR}/data
-
- # make install
- sed -e 's/rm -f ..mandir.\(.*\)/rm -f ${D}${mandir}\1/g' \
- -e 's/ln -s ..mandir.\(.*\) ..mandir.\(.*3\)/ln -s ${mandir}\1.gz ${D}${mandir}\2.gz/g' \
- -i Makefile
- make DESTDIR=${D} install || die
- chmod 4755 ${D}/usr/bin/dspam
-
- # documentation
- dodoc CHANGELOG LICENSE README* RELEASE.NOTES
- dodoc ${FILESDIR}/README.postfix ${FILESDIR}/README.qmail
- if use mysql; then
- dodoc tools.mysql_drv/README
- elif use postgres ; then
- dodoc tools.pgsql_drv/README
- elif use oci8 ; then
- dodoc tools.ora_drv/README
- elif use sqlite ; then
- dodoc tools.sqlite_drv/README
- fi
- doman man/dspam*
-
- # build some initial configuration data
- # Copy existing dspam.conf
- [ -f ${HOMEDIR}/dspam.conf ] && cp ${HOMEDIR}/dspam.conf ${T}/dspam.conf
- # If no existing dspam.conf
- if [ ! -f ${HOMEDIR}/dspam.conf ]; then
- cp ${D}${HOMEDIR}/dspam.conf ${T}/dspam.conf
- if use cyrus; then
- echo "UntrustedDeliveryAgent /usr/lib/cyrus/deliver %u" >> ${T}/dspam.conf
- dosed 's:/usr/bin/procmail:/usr/lib/cyrus/deliver %u:g' ${T}/dspam.conf
- elif use exim; then
- echo "UntrustedDeliveryAgent /usr/sbin/exim -oMr spam-scanned %u" >> ${T}/dspam.conf
- dosed 's:/usr/bin/procmail:/usr/sbin/exim -oMr spam-scanned %u:g' ${T}/dspam.conf
- elif use maildrop; then
- echo "UntrustedDeliveryAgent /usr/bin/maildrop -d %u" >> ${T}/dspam.conf
- dosed 's:/usr/bin/procmail:/usr/bin/maildrop -d %u:g' ${T}/dspam.conf
- elif use procmail; then
- echo "UntrustedDeliveryAgent /usr/bin/procmail" >> ${T}/dspam.conf
- else
- echo "UntrustedDeliveryAgent /usr/sbin/sendmail" >> ${T}/dspam.conf
- sed 's:/usr/bin/procmail:/usr/sbin/sendmail:g' ${T}/dspam.conf
- fi
- fi
-
- local PASSWORD="${RANDOM}${RANDOM}${RANDOM}${RANDOM}"
-
- # database related configuration and scripts
- insinto ${HOMEDIR}
- insopts -m644 -o dspam -g dspam
- if use mysql; then
-
- if [ -f ${HOMEDIR}/mysql.data ]; then
- # Use an existing password
- PASSWORD="$(tail -n 2 ${HOMEDIR}/mysql.data | head -n 1 )"
- else
- # Create the mysql.data file
- echo "MySQLServer /var/run/mysqld/mysqld.sock" >> ${T}/mysql.data
- echo "MySQLPort" >> ${T}/mysql.data
- echo "MySQLUser dspam" >> ${T}/mysql.data
- echo "MySQLPass ${PASSWORD}" >> ${T}/mysql.data
- echo "MySQLDb dspam" >> ${T}/mysql.data
- echo "MySQLCompress true" >> ${T}/mysql.data
- [ -z "`grep '^MySQL' ${D}/${HOMEDIR}/dspam.conf`" ] && cat ${T}/mysql.data >> ${T}/dspam.conf
- sed -e 's/^MySQL[A-Za-z]* *//g' -i ${T}/mysql.data
- doins ${T}/mysql.data
- fi
-
- newins tools.mysql_drv/mysql_objects-space.sql mysql_objects-space.sql
- newins tools.mysql_drv/mysql_objects-speed.sql mysql_objects-speed.sql
- newins tools.mysql_drv/mysql_objects-4.1.sql mysql_objects-4.1.sql
- newins tools.mysql_drv/virtual_users.sql mysql_virtual_users.sql
- newins tools.mysql_drv/neural.sql mysql_neural.sql
- newins tools.mysql_drv/purge.sql mysql_purge.sql
- newins tools.mysql_drv/purge-4.1.sql mysql_purge-4.1.sql
- newins ${FILESDIR}/upgrade.sql mysql_upgrade.sql
- elif use postgres ; then
- if [ -f ${HOMEDIR}/pgsql.data ]; then
- # Use an existing password
- PASSWORD="$(tail -n 2 ${HOMEDIR}/pgsql.data | head -n 1 )"
- else
- # Create the pgsql.data file
- echo "PgSQLServer 127.0.0.1" >> ${T}/pgsql.data
- echo "PgSQLPort 5432" >> ${T}/pgsql.data
- echo "PgSQLUser dspam" >> ${T}/pgsql.data
- echo "PgSQLPass ${PASSWORD}" >> ${T}/pgsql.data
- echo "PgSQLDb dspam" >> ${T}/pgsql.data
- [ -z "`grep '^PgSQL' ${D}/${HOMEDIR}/dspam.conf`" ] && cat ${T}/pgsql.data >> ${T}/dspam.conf
- sed -e 's/^PgSQL[A-Za-z]* *//g' -i ${T}/pgsql.data
- doins ${T}/pgsql.data
- fi
-
- newins tools.pgsql_drv/pgsql_objects.sql pgsql_objects.sql
- newins tools.pgsql_drv/virtual_users.sql pgsql_virtual_users.sql
- newins tools.pgsql_drv/purge.sql pgsql_purge.sql
-
- elif use oci8 ; then
- if [ -f ${HOMEDIR}/oracle.data ]; then
- # Use an existing password
- PASSWORD="$(tail -n 2 ${HOMEDIR}/oracle.data | head -n 1 )"
- else
- # Create the pgsql.data file
- echo "OraServer (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=PROD)))" >>${T}/oracle.data
- echo "OraUser dspam" >>${T}/oracle.data
- echo "OraPass ${PASSWORD}" >>${T}/oracle.data
- echo "OraSchema dspam" >>${T}/oracle.data
- [ -z "`grep '^Ora' ${D}/${HOMEDIR}/dspam.conf`" ] && cat ${T}/oracle.data >> ${T}/dspam.conf
- sed -e 's/^Ora[A-Za-z]* *//g' -i ${T}/oracle.data
- doins ${T}/oracle.data
- fi
-
- newins tools.ora_drv/oral_objects.sql ora_objects.sql
- newins tools.ora_drv/virtual_users.sql ora_virtual_users.sql
- newins tools.ora_drv/purge.sql ora_purge.sql
- elif use sqlite ; then
- newins tools.sqlite_drv/purge.sql sqlite_purge.sql
- fi
- insinto ${HOMEDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/dspam.conf
-
- # installs the logrotation scripts to the logrotate.d directory
- dodir /etc/logrotate.d
- keepdir /etc/logrotate.d
- insinto /etc/logrotate.d
- newins ${FILESDIR}/logrotate.dspam dspam
-
- # installs the cron job to the cron directory
- dodir /etc/cron.daily
- keepdir /etc/cron.daily
- exeinto /etc/cron.daily
- exeopts -m0755 -o dspam -g dspam
- doexe ${FILESDIR}/dspam.cron
-
- # dspam enviroment
- echo -ne "CONFIG_PROTECT_MASK=\"${HOMEDIR}\"\n\n" > ${T}/40dspam
- doenvd ${T}/40dspam || die
-}
-
-pkg_postinst() {
- if use mysql || use postgres; then
- einfo "To setup dspam to run out-of-the-box on your system with a mysql or pgsql database, run:"
- einfo "emerge --config ${PF}"
- fi
- if use exim ; then
- echo
- einfo "To use dspam in conjunction with your exim system, you should read the README"
- fi
-}
-
-pkg_config () {
- if use mysql ; then
- [[ -f ${HOMEDIR}/mysql.data ]] && mv -f ${HOMEDIR}/mysql.data ${HOMEDIR}
- DSPAM_MySQL_USER="$(head -n 3 ${HOMEDIR}/mysql.data|tail -n 1)"
- DSPAM_MySQL_PWD="$(head -n 4 ${HOMEDIR}/mysql.data|tail -n 1)"
- DSPAM_MySQL_DB="$(head -n 5 ${HOMEDIR}/mysql.data|tail -n 1)"
-
- ewarn "When prompted for a password, please enter your MySQL root password"
- ewarn ""
-
- einfo "Creating DSPAM MySQL database \"${DSPAM_MySQL_DB}\""
- /usr/bin/mysqladmin -u root -p create ${DSPAM_MySQL_DB}
-
- einfo "Creating DSPAM MySQL tables for data objects"
- einfo " Please select what kind of object database you like to use."
- einfo " [1] Space optimized database"
- einfo " [2] Speed optimized database"
- einfo
- while true
- do
- read -n 1 -s -p " Press 1 or 2 on the keyboard to select database" DSPAM_MySQL_DB_Type
- [[ "${DSPAM_MySQL_DB_Type}" == "1" || "${DSPAM_MySQL_DB_Type}" == "2" ]] && break
- done
-
- if [ "${DSPAM_MySQL_DB_Type}" == "1" ]
- then
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_objects-space.sql
- else
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_objects-speed.sql
- fi
-
- einfo "Creating DSPAM MySQL database for virtual users"
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_virtual_users.sql
-
- if use neural ; then
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_neural.sql
- fi
-
- einfo "Creating DSPAM MySQL user \"${DSPAM_MySQL_USER}\""
- /usr/bin/mysql -u root -p -e "GRANT SELECT,INSERT,UPDATE,DELETE ON ${DSPAM_MySQL_DB}.* TO ${DSPAM_MySQL_USER}@localhost IDENTIFIED BY '${DSPAM_MySQL_PWD}';FLUSH PRIVILEGES;" -D mysql
- elif use postgres ; then
- [[ -f ${HOMEDIR}/pgsql.data ]] && mv -f ${HOMEDIR}/pgsql.data ${HOMEDIR}
- DSPAM_PgSQL_USER="$(head -n 3 ${HOMEDIR}/pgsql.data|tail -n 1)"
- DSPAM_PgSQL_PWD="$(head -n 4 ${HOMEDIR}/pgsql.data|tail -n 1)"
- DSPAM_PgSQL_DB="$(head -n 5 ${HOMEDIR}/pgsql.data|tail -n 1)"
-
- ewarn "When prompted for a password, please enter your PgSQL postgres password"
- ewarn ""
-
- einfo "Creating DSPAM PostgreSQL user \"${DSPAM_PgSQL_USER}\""
- /usr/bin/psql -d template1 -U postgres -c "CREATE USER ${DSPAM_PgSQL_USER} WITH PASSWORD '${DSPAM_PgSQL_PWD}' NOCREATEDB NOCREATEUSER;" 1>/dev/null 2>&1
-
- einfo "Creating DSPAM PostgreSQL database \"${DSPAM_PgSQL_DB}\""
- /usr/bin/psql -d template1 -U postgres -c "CREATE DATABASE ${DSPAM_PgSQL_DB};" 1>/dev/null 2>&1
-
- einfo "Getting DSPAM PostgreSQL userid for \"${DSPAM_PgSQL_USER}\""
- DSPAM_PgSQL_USERID=$(/usr/bin/psql -d ${DSPAM_PgSQL_DB} -U postgres -t -c "SELECT usesysid FROM pg_user WHERE usename='${DSPAM_PgSQL_USER}';" | head -n1 | sed "s/^[ ]*\([^ ]*\).*/\1/g")
- einfo " UserID: ${DSPAM_PgSQL_USERID}"
-
- einfo "Getting DSPAM PostgreSQL databaseid for \"${DSPAM_PgSQL_DB}\""
- DSPAM_PgSQL_DBID=$(/usr/bin/psql -d ${DSPAM_PgSQL_DB} -U postgres -t -c "SELECT datdba FROM pg_database WHERE datname='${DSPAM_PgSQL_DB}';" | head -n1 | sed "s/^[ ]*\([^ ]*\).*/\1/g")
- einfo " DBID: ${DSPAM_PgSQL_DBID}"
-
- einfo "Changing owner of DSPAM PostgreSQL database \"${DSPAM_PgSQL_DB}\" to \"${DSPAM_PgSQL_USER}\""
- /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U postgres -c "UPDATE pg_database SET datdba=${DSPAM_PgSQL_USERID} WHERE datname='${DSPAM_PgSQL_DB}';" 1>/dev/null 2>&1
-
- einfo "Creating DSPAM PostgreSQL tables"
- 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
- 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
-
- einfo "Grant privileges to DSPAM PostgreSQL objects to \"${DSPAM_PgSQL_USER}\""
- for foo in $(/usr/bin/psql -t -d ${DSPAM_PgSQL_DB} -U postgres -c "SELECT tablename FROM pg_tables WHERE tablename LIKE 'dspam\%';")
- do
- /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U postgres -c "GRANT ALL PRIVILEGES ON TABLE ${foo} TO ${DSPAM_PgSQL_USER};" 1>/dev/null 2>&1
- done
- /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U postgres -c "GRANT ALL PRIVILEGES ON DATABASE ${DSPAM_PgSQL_DB} TO ${DSPAM_PgSQL_USER};" 1>/dev/null 2>&1
- /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U postgres -c "GRANT ALL PRIVILEGES ON SCHEMA public TO ${DSPAM_PgSQL_USER};" 1>/dev/null 2>&1
- elif use oci8 ; then
- [[ -f ${HOMEDIR}/oracle.data ]] && mv -f ${HOMEDIR}/oracle.data ${HOMEDIR}
- elif use sqlite ; then
- einfo "sqlite_drv will automatically create the necessary database"
- einfo "objects for each user upon first use of DSPAM by that user."
- fi
-
-}
diff --git a/mail-filter/dspam/dspam-3.4.9.ebuild b/mail-filter/dspam/dspam-3.4.9.ebuild
deleted file mode 100644
index 588c3c38634c..000000000000
--- a/mail-filter/dspam/dspam-3.4.9.ebuild
+++ /dev/null
@@ -1,518 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.4.9.ebuild,v 1.5 2006/01/08 17:29:50 rl03 Exp $
-
-inherit eutils
-
-DESCRIPTION="A statistical-algorithmic hybrid anti-spam filter"
-SRC_URI="http://dspam.nuclearelephant.com/sources/${P}.tar.gz
- http://dspam.nuclearelephant.com/sources/extras/dspam_sa_trainer.tar.gz"
-HOMEPAGE="http://dspam.nuclearelephant.com/"
-LICENSE="GPL-2"
-
-IUSE="cyrus debug exim mysql maildrop neural oci8 postgres procmail sqlite sqlite3 large-domain logrotate virtual-users"
-DEPEND="exim? ( >=mail-mta/exim-4.34 )
- mysql? ( >=dev-db/mysql-3.23 ) || ( >=sys-libs/db-4.0 )
- maildrop? ( >=mail-filter/maildrop-1.5.3 )
- sqlite? ( <dev-db/sqlite-3 )
- sqlite3? ( >=dev-db/sqlite-3 )
- postgres? ( >=dev-db/postgresql-7.4.3 )
- procmail? ( >=mail-filter/procmail-3.22 )
- x86? ( cyrus? ( >=net-mail/cyrus-imapd-2.1.15 ) )
- >=sys-libs/db-4.0
- "
-RDEPEND="sys-process/cronbase
- logrotate? ( app-admin/logrotate )"
-KEYWORDS="~x86 ~ppc ~alpha ~amd64"
-SLOT="0"
-
-# some FHS-like structure
-HOMEDIR="/etc/mail/dspam"
-DATADIR="/var/spool/dspam"
-LOGDIR="/var/log/dspam"
-
-pkg_setup() {
- local multiple_dbs="0"
- local supported_dbs="mysql postgres oci8 sqlite sqlite3"
- for foo in ${supported_dbs}; do
- if use ${foo}; then
- let multiple_dbs="((multiple_dbs + 1 ))"
- einfo " ${foo} database support in your USE flags."
- fi
- done
- if [ "${multiple_dbs}" -ge "2" ]; then
- echo
- ewarn "You have multiple database backends active in your USE flags."
- ewarn "Will default to MySQL as your dspam database backend."
- ewarn "If you want to build with another database backend; hit Control-C now."
- ewarn "Change your USE flag -mysql and emerge again."
- echo
- has_version ">=sys-apps/portage-2.0.50" && (
- einfo "It would be best practice to add the set of USE flags that you use for this"
- einfo "package to the file: /etc/portage/package.use. Example:"
- einfo "\`echo \"mail-filter/dspam -mysql postgres -oci8 -sqlite\" >> /etc/portage/package.use\`"
- einfo "to build dspam with Postgres database as your dspam backend."
- )
- echo
- ewarn "Waiting 30 seconds before starting..."
- ewarn "(Control-C to abort)..."
- epause 30
- elif [ "${multiple_dbs}" -eq "0" ]; then
- echo
- ewarn "You did not select any SQL based database backend. DSPAM will use"
- ewarn "Berkeley DB for storing data. If you don't want that, then enable"
- ewarn "one of the following USE flags:"
- ewarn "${supported_dbs}"
- echo
- ewarn "Waiting 30 seconds before starting..."
- ewarn "(Control-C to abort)..."
- epause 30
- fi
- has_version ">sys-kernel/linux-headers-2.6" || (
- einfo "To use the new DSPAM deamon mode, you need to emerge"
- einfo ">sys-kernel/linux-headers-2.6 and rebuild glibc to support NPTL"
- echo
- ewarn "Waiting 30 seconds before starting..."
- ewarn "(Control-C to abort)..."
- epause 30
- )
- id dspam 2>/dev/null || enewgroup dspam 26
- id dspam 2>/dev/null || enewuser dspam 26 /bin/bash ${HOMEDIR} dspam
-}
-
-src_compile() {
- local myconf
-
- myconf="${myconf} --enable-long-username"
- use large-domain && myconf="${myconf} --enable-large-scale" ||\
- myconf="${myconf} --enable-domain-scale"
-
- myconf="${myconf} --with-dspam-home=${HOMEDIR}"
- myconf="${myconf} --with-dspam-mode=4755"
- myconf="${myconf} --with-dspam-owner=dspam"
- myconf="${myconf} --with-dspam-group=dspam"
- myconf="${myconf} --sysconfdir=${HOMEDIR}"
- myconf="${myconf} --with-logdir=${LOGDIR}"
- use virtual-users || myconf="${myconf} --enable-homedir"
-
- # enables support for debugging (touch /etc/dspam/.debug to turn on)
- # optional: even MORE debugging output, use with extreme caution!
- use debug && myconf="${myconf} --enable-debug --enable-verbose-debug"
-
- # select storage driver
- if use mysql; then
- myconf="${myconf} --with-storage-driver=mysql_drv"
- myconf="${myconf} --with-mysql-includes=/usr/include/mysql"
- myconf="${myconf} --with-mysql-libraries=/usr/lib/mysql"
- myconf="${myconf} --enable-preferences-extension"
-
- if has_version ">sys-kernel/linux-headers-2.6"; then
- myconf="${myconf} --enable-daemon"
- fi
-
- use virtual-users && myconf="${myconf} --enable-virtual-users"
- # an experimental feature available with MySQL and PgSQL backend
- use neural && myconf="${myconf} --enable-neural-networking"
- elif use postgres ; then
- myconf="${myconf} --with-storage-driver=pgsql_drv"
- myconf="${myconf} --with-pgsql-includes=/usr/include/postgresql"
- myconf="${myconf} --with-pgsql-libraries=/usr/lib/postgresql"
- myconf="${myconf} --enable-preferences-extension"
-
- if has_version ">sys-kernel/linux-headers-2.6"; then
- myconf="${myconf} --enable-daemon"
- fi
-
- use virtual-users && myconf="${myconf} --enable-virtual-users"
- # an experimental feature available with MySQL and PgSQL backend
- use neural && myconf="${myconf} --enable-neural-networking"
- elif use oci8 ; then
- myconf="${myconf} --with-storage-driver=ora_drv"
- myconf="${myconf} --with-oracle-home=${ORACLE_HOME}"
- myconf="${myconf} --enable-virtual-users"
-
- # I am in no way a Oracle specialist. If someone knows
- # how to query the version of Oracle, then let me know.
- if (expr ${ORACLE_HOME/*\/} : 10 1>/dev/null 2>&1); then
- myconf="${myconf} --with-oracle-version=10"
- fi
- elif use sqlite3 ; then
- myconf="${myconf} --with-storage-driver=sqlite3_drv"
- myconf="${myconf} --enable-virtual-users"
- elif use sqlite ; then
- myconf="${myconf} --with-storage-driver=sqlite_drv"
- myconf="${myconf} --enable-virtual-users"
- else
- myconf="${myconf} --with-storage-driver=libdb4_drv"
- fi
-
- econf ${myconf} || die
- emake || die
-
-}
-
-src_install () {
-
- # Fix issues with older dspam configuration
- CONFIG_PROTECT="${CONFIG_PROTECT} ${DATADIR} /var/run/dspam"
- CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${HOMEDIR}/}"
- CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${DATADIR}/}"
-
- # open up perms on /etc/mail/dspam
- diropts -m0775 -o dspam -g dspam
- dodir ${HOMEDIR}
- keepdir ${HOMEDIR}
-
- # keeps dspam data in /var
- diropts -m0775 -o dspam -g dspam
- dodir ${DATADIR}
- keepdir ${DATADIR}
-
- # keeps dspam log in /var/log
- diropts -m0775 -o dspam -g dspam
- dodir ${LOGDIR}
- keepdir ${LOGDIR}
- insinto ${LOGDIR}
- touch ${T}/empty.file
- newins ${T}/empty.file system.log
- chown dspam:dspam ${D}/${LOGDIR}/system.log
- dosym ${LOGDIR}/system.log ${HOMEDIR}/system.log
-
- # ${HOMEDIR}/data is a symlink to ${DATADIR}
- dosym ${DATADIR} ${HOMEDIR}/data
-
- # make install
- make DESTDIR=${D} install || die
- chmod 4755 ${D}/usr/bin/dspam
- chmod 4755 ${D}/usr/bin/dspam_stats
-
- # documentation
- dodoc CHANGELOG LICENSE README* RELEASE.NOTES UPGRADING
- dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
- docinto doc
- dodoc doc/*.txt
- docinto gentoo
- dodoc ${FILESDIR}/README.postfix ${FILESDIR}/README.qmail
- if use mysql; then
- dodoc src/tools.mysql_drv/README
- elif use postgres ; then
- dodoc src/tools.pgsql_drv/README
- elif use oci8 ; then
- dodoc src/tools.ora_drv/README
- elif use sqlite || use sqlite3 ; then
- dodoc src/tools.sqlite_drv/README
- fi
- doman man/dspam*
- dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
-
- # build some initial configuration data
- [ -f ${HOMEDIR}/dspam.conf ] \
- && cp ${HOMEDIR}/dspam.conf ${T}/dspam.conf \
- || cp src/dspam.conf ${T}/dspam.conf
-
- if use cyrus; then
- sed -e 's:^#*\(UntrustedDeliveryAgent\)[\t ]*.*:\1 \"/usr/lib/cyrus/deliver %u\":gI' \
- -e 's:^\(TrustedDeliveryAgent\)[\t ]*.*:\1 \"/usr/lib/cyrus/deliver\":gI' \
- -i ${T}/dspam.conf
- elif use exim; then
- sed -e 's:^#*\(UntrustedDeliveryAgent\)[\t ]*.*:\1 \"/usr/sbin/exim -oMr spam-scanned %u\":gI' \
- -e 's:^\(TrustedDeliveryAgent\)[\t ]*.*:\1 \"/usr/sbin/exim -oMr spam-scanned %u\":gI' \
- -i ${T}/dspam.conf
- elif use maildrop; then
- sed -e 's:^#*\(UntrustedDeliveryAgent\)[\t ]*.*:\1 \"/usr/bin/maildrop -d %u\":gI' \
- -e 's:^\(TrustedDeliveryAgent\)[\t ]*.*:\1 \"/usr/bin/maildrop\":gI' \
- -i ${T}/dspam.conf
- elif use procmail; then
- sed -e 's:^#*\(UntrustedDeliveryAgent\)[\t ]*.*:\1 \"/usr/bin/procmail -d %u\":gI' \
- -e 's:^\(TrustedDeliveryAgent\)[\t ]*.*:\1 \"/usr/bin/procmail":gI' \
- -i ${T}/dspam.conf
- else
- sed -e 's:^#*\(UntrustedDeliveryAgent\)[\t ]*.*:\1 \"/usr/sbin/sendmail\":gI' \
- -e 's:^\(TrustedDeliveryAgent\)[\t ]*.*:\1 \"/usr/sbin/sendmail\":gI' \
- -i ${T}/dspam.conf
- fi
- if use mysql || use postgres; then
- if has_version ">sys-kernel/linux-headers-2.6"; then
- # keeps dspam socket for deamon in /var/run/dspam
- diropts -m0775 -o dspam -g dspam
- dodir /var/run/dspam
- keepdir /var/run/dspam
-
- # We use sockets for the deamon instead of tcp port 24
- sed -e 's:^#*\(ServerDomainSocketPath[\t ]\{1,\}\).*:\1\"/var/run/dspam/dspam.sock\":gI' \
- -e 's:^#*\(ServerPID[\t ]\{1,\}\).*:\1/var/run/dspam/dspam.pid:gI' \
- -i ${T}/dspam.conf
-
- # dspam init script
- exeinto /etc/init.d
- exeopts -m0755 -o root -g root
- newexe ${FILESDIR}/dspam.rc dspam
- fi
- fi
-
- # generate random password
- local PASSWORD="${RANDOM}${RANDOM}${RANDOM}${RANDOM}"
-
- # database related configuration and scripts
- if use mysql; then
- # Use existing configuration if possible
- if [[ -f ${ROOT}${HOMEDIR}/mysql.data ]]; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${HOMEDIR}/mysql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="/var/run/mysqld/mysqld.sock"
- DSPAM_DB_DATA[1]=""
- DSPAM_DB_DATA[2]="dspam"
- DSPAM_DB_DATA[3]="${PASSWORD}"
- DSPAM_DB_DATA[4]="dspam"
- DSPAM_DB_DATA[5]="true"
- fi
-
- # Modify configuration and create mysql.data file
- sed -e "s:^#*\(MySQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^#*\(MySQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^#*\(MySQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^#*\(MySQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
- -e "s:^#*\(MySQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
- -e "s:^#*\(MySQLCompress[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[5]}:gI" \
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/mysql.data
- done
- insinto ${HOMEDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/mysql.data
- newins src/tools.mysql_drv/mysql_objects-space.sql mysql_objects-space.sql
- newins src/tools.mysql_drv/mysql_objects-speed.sql mysql_objects-speed.sql
- newins src/tools.mysql_drv/mysql_objects-4.1.sql mysql_objects-4.1.sql
- newins src/tools.mysql_drv/virtual_users.sql mysql_virtual_users.sql
- newins src/tools.mysql_drv/neural.sql mysql_neural.sql
- newins src/tools.mysql_drv/purge.sql mysql_purge.sql
- newins src/tools.mysql_drv/purge-4.1.sql mysql_purge-4.1.sql
-
- elif use postgres ; then
- # Use existing configuration if possible
- if [ -f ${ROOT}${HOMEDIR}/pgsql.data ]; then
- DSPAM_DB_DATA=( $(cat "${ROOT}${HOMEDIR}/pgsql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="127.0.0.1"
- DSPAM_DB_DATA[1]="5432"
- DSPAM_DB_DATA[2]="dspam"
- DSPAM_DB_DATA[3]="${PASSWORD}"
- DSPAM_DB_DATA[4]="dspam"
- fi
-
- # Modify configuration and create pgsql.data file
- sed -e "s:^#*\(PgSQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^#*\(PgSQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^#*\(PgSQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^#*\(PgSQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
- -e "s:^#*\(PgSQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
- -e "s:^#*\(PgSQLConnectionCache[\t ]*.\):\1:gI" \
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/pgsql.data
- done
-
- insinto ${HOMEDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/pgsql.data
- newins src/tools.pgsql_drv/pgsql_objects.sql pgsql_objects.sql
- newins src/tools.pgsql_drv/virtual_users.sql pgsql_virtual_users.sql
- newins src/tools.pgsql_drv/purge.sql pgsql_purge.sql
-
- elif use oci8 ; then
- # Use existing configuration if possible
- if [ -f ${ROOT}${HOMEDIR}/oracle.data ]; then
- DSPAM_DB_DATA=( $(cat "${ROOT}${HOMEDIR}/oracle.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=PROD)))"
- DSPAM_DB_DATA[1]="dspam"
- DSPAM_DB_DATA[2]="${PASSWORD}"
- DSPAM_DB_DATA[3]="dspam"
- fi
-
- # Modify configuration and create oracle.data file
- sed -e "s:^#*\(OraServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^\(OraUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^\(OraPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^\(OraSchema[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI"\
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/oracle.data
- done
-
- insinto ${HOMEDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/oracle.data
- newins src/tools.ora_drv/oral_objects.sql ora_objects.sql
- newins src/tools.ora_drv/virtual_users.sql ora_virtual_users.sql
- newins src/tools.ora_drv/purge.sql ora_purge.sql
- elif use sqlite || use sqlite3 ; then
- insinto ${HOMEDIR}
- insopts -m644 -o dspam -g dspam
- newins src/tools.sqlite_drv/purge.sql sqlite_purge.sql
- fi
-
- sed -e "s:^\(Purge.*\):###\1:g" \
- -e "s:^#\(Purge.*\):\1:g" \
- -e "s:^###\(Purge.*\):#\1:g" \
- -i ${T}/dspam.conf
- insinto ${HOMEDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/dspam.conf
-
- # installs the notification messages
- # -> The documentation is wrong! The files need to be in ./txt
- diropts -m0775 -o dspam -g dspam
- dodir ${HOMEDIR}/txt
- keepdir ${HOMEDIR}/txt
- insinto ${HOMEDIR}/txt
- insopts -m644 -o dspam -g dspam
- doins ${S}/txt/*.txt
-
- # Create the opt-in / opt-out directories
- diropts -m0775 -o dspam -g dspam
- dodir ${HOMEDIR}/opt-in
- keepdir ${HOMEDIR}/opt-in
- dodir ${HOMEDIR}/opt-out
- keepdir ${HOMEDIR}/opt-out
-
- # logrotation scripts
- diropts -m0755 -o dspam -g dspam
- dodir /etc/logrotate.d
- keepdir /etc/logrotate.d
- insinto /etc/logrotate.d
- insopts -m0755 -o dspam -g dspam
- newins ${FILESDIR}/logrotate.dspam dspam
-
- # dspam cron job
- diropts -m0755 -o dspam -g dspam
- dodir /etc/cron.daily
- keepdir /etc/cron.daily
- exeinto /etc/cron.daily
- exeopts -m0755 -o dspam -g dspam
- doexe ${FILESDIR}/dspam.cron
-
- # dspam enviroment
- echo -ne "CONFIG_PROTECT=\"${DATADIR} /var/run/dspam\"\n\n" > ${T}/40dspam
- doenvd ${T}/40dspam || die
-}
-
-pkg_postinst() {
- env-update
- if use mysql || use postgres || use oci8; then
- echo
- einfo "To setup DSPAM to run out-of-the-box on your system with a MySQL,"
- einfo "PostgreSQL or Oracle database, run:"
- einfo "emerge --config ${PF}"
- fi
- if use mysql || use postgres; then
- if has_version ">sys-kernel/linux-headers-2.6"; then
- einfo "If you want to run DSPAM in the new deamon mode. Remember"
- einfo "to make the DSPAM daemon start durig boot:"
- einfo " rc-update add dspam default"
- fi
- fi
- if use exim ; then
- echo
- einfo "To use dspam in conjunction with your exim system, you should read the README"
- fi
-}
-
-pkg_config () {
- if use mysql ; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${HOMEDIR}/mysql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- DSPAM_MySQL_USER="${DSPAM_DB_DATA[2]}"
- DSPAM_MySQL_PWD="${DSPAM_DB_DATA[3]}"
- DSPAM_MySQL_DB="${DSPAM_DB_DATA[4]}"
-
- ewarn "When prompted for a password, please enter your MySQL root password"
- ewarn ""
-
- einfo "Creating DSPAM MySQL database \"${DSPAM_MySQL_DB}\""
- /usr/bin/mysqladmin -u root -p create ${DSPAM_MySQL_DB}
-
- einfo "Creating DSPAM MySQL tables for data objects"
- einfo " Please select what kind of object database you like to use."
- einfo " [1] Space optimized database"
- einfo " [2] Speed optimized database"
- einfo
- while true
- do
- read -n 1 -s -p " Press 1 or 2 on the keyboard to select database" DSPAM_MySQL_DB_Type
- [[ "${DSPAM_MySQL_DB_Type}" == "1" || "${DSPAM_MySQL_DB_Type}" == "2" ]] && echo && break
- done
-
- if [ "${DSPAM_MySQL_DB_Type}" == "1" ]
- then
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_objects-space.sql
- else
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_objects-speed.sql
- fi
-
- if use virtual-users ; then
- einfo "Creating DSPAM MySQL database for virtual-users users"
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_virtual_users.sql
- fi
-
- if use neural ; then
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${HOMEDIR}/mysql_neural.sql
- fi
-
- einfo "Creating DSPAM MySQL user \"${DSPAM_MySQL_USER}\""
- /usr/bin/mysql -u root -p -e "GRANT SELECT,INSERT,UPDATE,DELETE ON ${DSPAM_MySQL_DB}.* TO ${DSPAM_MySQL_USER}@localhost IDENTIFIED BY '${DSPAM_MySQL_PWD}';FLUSH PRIVILEGES;" -D mysql
- elif use postgres ; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${HOMEDIR}/pgsql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- DSPAM_PgSQL_USER="${DSPAM_DB_DATA[2]}"
- DSPAM_PgSQL_PWD="${DSPAM_DB_DATA[3]}"
- DSPAM_PgSQL_DB="${DSPAM_DB_DATA[4]}"
-
- ewarn "When prompted for a password, please enter your PgSQL postgres password"
- ewarn ""
-
- einfo "Creating DSPAM PostgreSQL database \"${DSPAM_PgSQL_DB}\" and user \"${DSPAM_PgSQL_USER}\""
- /usr/bin/psql -h localhost -d template1 -U postgres -c "CREATE USER ${DSPAM_PgSQL_USER} WITH PASSWORD '${DSPAM_PgSQL_PWD}' NOCREATEDB NOCREATEUSER; CREATE DATABASE ${DSPAM_PgSQL_DB}; GRANT ALL PRIVILEGES ON DATABASE ${DSPAM_PgSQL_DB} TO ${DSPAM_PgSQL_USER}; GRANT ALL PRIVILEGES ON SCHEMA public TO ${DSPAM_PgSQL_USER}; UPDATE pg_database SET datdba=(SELECT usesysid FROM pg_shadow WHERE usename='${DSPAM_PgSQL_USER}') WHERE datname='${DSPAM_PgSQL_DB}';"
-
- einfo "Creating DSPAM PostgreSQL tables"
- 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
-
- if use virtual-users ; then
- einfo "Creating DSPAM PostgreSQL database for virtual-users users"
- 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
- fi
- elif use oci8 ; then
- einfo "We have not enought Oracle knowledge to configure Oracle"
- einfo "automatically. If you know how, please post a message in"
- einfo "Gentoo Bugzilla."
- einfo ""
- einfo "You need manually to create the Oracle user for DSPAM and"
- einfo "the necessary database."
- einfo "But the DSPAM configuration file dspam.conf and oracle.data"
- einfo "was already configured with the necessary information to"
- einfo "access the database."
- einfo "Please read your dspam.conf, oracle.data and the README for"
- einfo "more info on how to setup DSPAM with Oracle."
- elif use sqlite3 ; then
- einfo "sqlite3_drv will automatically create the necessary database"
- einfo "objects for each user upon first use of DSPAM by that user."
- elif use sqlite ; then
- einfo "sqlite_drv will automatically create the necessary database"
- einfo "objects for each user upon first use of DSPAM by that user."
- fi
-
-}
diff --git a/mail-filter/dspam/dspam-3.6.0.ebuild b/mail-filter/dspam/dspam-3.6.0.ebuild
deleted file mode 100644
index e2d308b5f560..000000000000
--- a/mail-filter/dspam/dspam-3.6.0.ebuild
+++ /dev/null
@@ -1,491 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.6.0.ebuild,v 1.9 2006/01/08 17:29:50 rl03 Exp $
-
-inherit eutils
-
-DESCRIPTION="A statistical-algorithmic hybrid anti-spam filter"
-SRC_URI="http://dspam.nuclearelephant.com/sources/${P}.tar.gz
- http://dspam.nuclearelephant.com/sources/extras/dspam_sa_trainer.tar.gz"
-HOMEPAGE="http://dspam.nuclearelephant.com/"
-LICENSE="GPL-2"
-
-IUSE="clamav debug large-domain logrotate mysql neural oci8 postgres sqlite sqlite3 virtual-users user-homedirs"
-DEPEND="clamav? ( >=app-antivirus/clamav-0.86 )
- mysql? ( >=dev-db/mysql-3.23 )
- sqlite? ( <dev-db/sqlite-3 )
- sqlite3? ( =dev-db/sqlite-3* )
- postgres? ( >=dev-db/postgresql-7.4.3 )
- >=sys-libs/db-4.0
- "
-RDEPEND="sys-process/cronbase
- clamav? ( >=app-antivirus/clamav-0.86 )
- mysql? ( >=dev-db/mysql-3.23 )
- sqlite? ( <dev-db/sqlite-3 )
- sqlite3? ( =dev-db/sqlite-3* )
- postgres? ( >=dev-db/postgresql-7.4.3 )
- >=sys-libs/db-4.0
- logrotate? ( app-admin/logrotate )"
-KEYWORDS="~x86 ~ppc ~alpha ~amd64"
-SLOT="0"
-
-# some FHS-like structure
-HOMEDIR="/var/spool/dspam"
-CONFDIR="/etc/mail/dspam"
-LOGDIR="/var/log/dspam"
-
-pkg_setup() {
- local multiple_dbs="0"
- local supported_dbs="mysql postgres oci8 sqlite sqlite3"
- for foo in ${supported_dbs}; do
- if use ${foo}; then
- let multiple_dbs="((multiple_dbs + 1 ))"
- einfo " ${foo} database support in your USE flags."
- fi
- done
- if [ "${multiple_dbs}" -ge "2" ]; then
- echo
- ewarn "You have multiple database backends active in your USE flags."
- ewarn "Will default to MySQL as your dspam database backend."
- ewarn "If you want to build with another database backend; hit Control-C now."
- ewarn "Change your USE flag -mysql and emerge again."
- echo
- has_version ">=sys-apps/portage-2.0.50" && (
- einfo "It would be best practice to add the set of USE flags that you use for this"
- einfo "package to the file: /etc/portage/package.use. Example:"
- einfo "\`echo \"mail-filter/dspam -mysql postgres -oci8 -sqlite -sqlite3\" >> /etc/portage/package.use\`"
- einfo "to build dspam with Postgres database as your dspam backend."
- )
- echo
- ewarn "Waiting 30 seconds before starting..."
- ewarn "(Control-C to abort)..."
- epause 30
- elif [ "${multiple_dbs}" -eq "0" ]; then
- echo
- ewarn "You did not select any SQL based database backend. DSPAM will use"
- ewarn "Berkeley DB for storing data. If you don't want that, then enable"
- ewarn "one of the following USE flags:"
- ewarn "${supported_dbs}"
- echo
- ewarn "Waiting 30 seconds before starting..."
- ewarn "(Control-C to abort)..."
- epause 30
- fi
- has_version ">sys-kernel/linux-headers-2.6" || (
- einfo "To use the new DSPAM deamon mode, you need to emerge"
- einfo ">sys-kernel/linux-headers-2.6 and rebuild glibc to support NPTL"
- echo
- ewarn "Waiting 30 seconds before starting..."
- ewarn "(Control-C to abort)..."
- epause 30
- )
- if use virtual-users && use user-homedirs ; then
- ewarn "If the users are virtual, then they probably should not have home directories."
- fi
- if use user-homedirs ; then
- ewarn "WARNING: dspam-web will not work with user-homedirs. Disable this USE flag"
- ewarn "if you intend on using dspam-web."
- fi
- id dspam 2>/dev/null || enewgroup dspam 26
- id dspam 2>/dev/null || enewuser dspam 26 /bin/bash ${HOMEDIR} dspam
-}
-
-src_compile() {
- local myconf
-
- myconf="${myconf} --enable-long-username"
- myconf="${myconf} --with-delivery-agent=/usr/bin/procmail"
- use large-domain && myconf="${myconf} --enable-large-scale" ||\
- myconf="${myconf} --enable-domain-scale"
-
- myconf="${myconf} --with-dspam-home=${HOMEDIR}"
- myconf="${myconf} --sysconfdir=${CONFDIR}"
- use user-homedirs || myconf="${myconf} --enable-homedir"
- use clamav || myconf="${myconf} --enable-clamav"
-
- # enables support for debugging (touch /etc/dspam/.debug to turn on)
- # optional: even MORE debugging output, use with extreme caution!
- use debug && myconf="${myconf} --enable-debug --enable-verbose-debug"
-
- # select storage driver
- if use sqlite ; then
- myconf="${myconf} --with-storage-driver=sqlite_drv"
- myconf="${myconf} --enable-virtual-users"
- elif use sqlite3 ; then
- myconf="${myconf} --with-storage-driver=sqlite3_drv"
- myconf="${myconf} --enable-virtual-users"
- elif use mysql; then
- myconf="${myconf} --with-storage-driver=mysql_drv"
- myconf="${myconf} --with-mysql-includes=/usr/include/mysql"
- myconf="${myconf} --with-mysql-libraries=/usr/lib/mysql"
- myconf="${myconf} --enable-preferences-extension"
-
- if has_version ">sys-kernel/linux-headers-2.6"; then
- myconf="${myconf} --enable-daemon"
- fi
-
- use virtual-users && myconf="${myconf} --enable-virtual-users"
- # an experimental feature available with MySQL and PgSQL backend
- use neural && myconf="${myconf} --enable-neural-networking"
- elif use postgres ; then
- myconf="${myconf} --with-storage-driver=pgsql_drv"
- myconf="${myconf} --with-pgsql-includes=/usr/include/postgresql"
- myconf="${myconf} --with-pgsql-libraries=/usr/lib/postgresql"
- myconf="${myconf} --enable-preferences-extension"
-
- if has_version ">sys-kernel/linux-headers-2.6"; then
- myconf="${myconf} --enable-daemon"
- fi
-
- use virtual-users && myconf="${myconf} --enable-virtual-users"
- # an experimental feature available with MySQL and PgSQL backend
- use neural && myconf="${myconf} --enable-neural-networking"
- elif use oci8 ; then
- myconf="${myconf} --with-storage-driver=ora_drv"
- myconf="${myconf} --with-oracle-home=${ORACLE_HOME}"
- myconf="${myconf} --enable-virtual-users"
-
- # I am in no way a Oracle specialist. If someone knows
- # how to query the version of Oracle, then let me know.
- if (expr ${ORACLE_HOME/*\/} : 10 1>/dev/null 2>&1); then
- myconf="${myconf} --with-oracle-version=10"
- fi
- else
- myconf="${myconf} --with-storage-driver=libdb4_drv"
- fi
-
- econf ${myconf} || die
- emake || die
-}
-
-src_install () {
-
- # Fix issues with older dspam configuration
- CONFIG_PROTECT="${CONFIG_PROTECT} ${HOMEDIR} ${CONFDIR} /var/run/dspam"
- CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${HOMEDIR}/}"
- CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${CONFDIR}/}"
-
- # open up perms on $HOMEDIR
- diropts -m0775 -o dspam -g dspam
- dodir ${HOMEDIR}
- keepdir ${HOMEDIR}
-
- # keeps dspam data in $CONFDIR
- diropts -m0775 -o dspam -g dspam
- dodir ${CONFDIR}
- keepdir ${CONFDIR}
-
- # make install
- make DESTDIR=${D} install || die
- chmod o+s ${D}/usr/bin/dspam
- chmod o+s ${D}/usr/bin/dspam_stats
-
- # documentation
- dodoc CHANGELOG LICENSE README* RELEASE.NOTES UPGRADING
- dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
- docinto doc
- dodoc doc/*.txt
- docinto gentoo
- dodoc ${FILESDIR}/README.postfix ${FILESDIR}/README.qmail
- if use sqlite; then
- dodoc src/tools.sqlite_drv/README
- elif use mysql; then
- dodoc src/tools.mysql_drv/README
- elif use postgres ; then
- dodoc src/tools.pgsql_drv/README
- elif use oci8 ; then
- dodoc src/tools.ora_drv/README
- fi
- doman man/dspam*
- dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
-
- # build some initial configuration data
- [ ! -f ${CONFDIR}/dspam.conf ] \
- && cp src/dspam.conf ${T}/dspam.conf
-
- if use mysql || use postgres; then
- if has_version ">sys-kernel/linux-headers-2.6"; then
- # keeps dspam socket for deamon in /var/run/dspam
- diropts -m0775 -o dspam -g dspam
- dodir /var/run/dspam
- keepdir /var/run/dspam
-
- # We use sockets for the deamon instead of tcp port 24
- sed -e 's:^#*\(ServerDomainSocketPath[\t ]\{1,\}\).*:\1\"/var/run/dspam/dspam.sock\":gI' \
- -e 's:^#*\(ServerPID[\t ]\{1,\}\).*:\1/var/run/dspam/dspam.pid:gI' \
- -i ${T}/dspam.conf
-
- # dspam init script
- exeinto /etc/init.d
- exeopts -m0755 -o root -g root
- newexe ${FILESDIR}/dspam.rc dspam
- fi
- fi
-
- # generate random password
- local PASSWORD="${RANDOM}${RANDOM}${RANDOM}${RANDOM}"
-
- # database related configuration and scripts
- if use sqlite; then
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- newins src/tools.sqlite_drv/purge-2.sql sqlite_purge.sql
- elif use sqlite3; then
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- newins src/tools.sqlite_drv/purge-3.sql sqlite3_purge.sql
- elif use mysql; then
- # Use existing configuration if possible
- if [[ -f ${ROOT}${CONFDIR}/mysql.data ]]; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="/var/run/mysqld/mysqld.sock"
- DSPAM_DB_DATA[1]=""
- DSPAM_DB_DATA[2]="dspam"
- DSPAM_DB_DATA[3]="${PASSWORD}"
- DSPAM_DB_DATA[4]="dspam"
- DSPAM_DB_DATA[5]="true"
- fi
-
- # Modify configuration and create mysql.data file
- sed -e "s:^#*\(MySQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^#*\(MySQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^#*\(MySQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^#*\(MySQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
- -e "s:^#*\(MySQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
- -e "s:^#*\(MySQLCompress[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[5]}:gI" \
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/mysql.data
- done
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/mysql.data
- newins src/tools.mysql_drv/mysql_objects-space.sql mysql_objects-space.sql
- newins src/tools.mysql_drv/mysql_objects-speed.sql mysql_objects-speed.sql
- newins src/tools.mysql_drv/mysql_objects-4.1.sql mysql_objects-4.1.sql
- newins src/tools.mysql_drv/virtual_users.sql mysql_virtual_users.sql
- newins src/tools.mysql_drv/neural.sql mysql_neural.sql
- newins src/tools.mysql_drv/purge.sql mysql_purge.sql
- newins src/tools.mysql_drv/purge-4.1.sql mysql_purge-4.1.sql
-
- elif use postgres ; then
- # Use existing configuration if possible
- if [ -f ${ROOT}${CONFDIR}/pgsql.data ]; then
- DSPAM_DB_DATA=( $(cat "${ROOT}${CONFDIR}/pgsql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="127.0.0.1"
- DSPAM_DB_DATA[1]="5432"
- DSPAM_DB_DATA[2]="dspam"
- DSPAM_DB_DATA[3]="${PASSWORD}"
- DSPAM_DB_DATA[4]="dspam"
- fi
-
- # Modify configuration and create pgsql.data file
- sed -e "s:^#*\(PgSQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^#*\(PgSQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^#*\(PgSQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^#*\(PgSQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
- -e "s:^#*\(PgSQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
- -e "s:^#*\(PgSQLConnectionCache[\t ]*.\):\1:gI" \
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/pgsql.data
- done
-
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/pgsql.data
- newins src/tools.pgsql_drv/pgsql_objects.sql pgsql_objects.sql
- newins src/tools.pgsql_drv/virtual_users.sql pgsql_virtual_users.sql
- newins src/tools.pgsql_drv/purge.sql pgsql_purge.sql
-
- elif use oci8 ; then
- # Use existing configuration if possible
- if [ -f ${ROOT}${CONFDIR}/oracle.data ]; then
- DSPAM_DB_DATA=( $(cat "${ROOT}${CONFDIR}/oracle.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=PROD)))"
- DSPAM_DB_DATA[1]="dspam"
- DSPAM_DB_DATA[2]="${PASSWORD}"
- DSPAM_DB_DATA[3]="dspam"
- fi
-
- # Modify configuration and create oracle.data file
- sed -e "s:^#*\(OraServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^\(OraUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^\(OraPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^\(OraSchema[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI"\
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/oracle.data
- done
-
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/oracle.data
- newins src/tools.ora_drv/oral_objects.sql ora_objects.sql
- newins src/tools.ora_drv/virtual_users.sql ora_virtual_users.sql
- newins src/tools.ora_drv/purge.sql ora_purge.sql
- fi
-
- sed -e "s:^\(Purge.*\):###\1:g" \
- -e "s:^#\(Purge.*\):\1:g" \
- -e "s:^###\(Purge.*\):#\1:g" \
- -i ${T}/dspam.conf
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/dspam.conf
-
- # installs the notification messages
- # -> The documentation is wrong! The files need to be in ./txt
- diropts -m0775 -o dspam -g dspam
- dodir ${CONFDIR}/txt
- keepdir ${CONFDIR}/txt
- insinto ${CONFDIR}/txt
- insopts -m644 -o dspam -g dspam
- doins ${S}/txt/*.txt
-
- # Create the opt-in / opt-out directories
- diropts -m0775 -o dspam -g dspam
- dodir ${CONFDIR}/opt-in
- keepdir ${CONFDIR}/opt-in
- dodir ${CONFDIR}/opt-out
- keepdir ${CONFDIR}/opt-out
-
- # logrotation scripts
- diropts -m0755 -o dspam -g dspam
- dodir /etc/logrotate.d
- keepdir /etc/logrotate.d
- insinto /etc/logrotate.d
- insopts -m0644 -o dspam -g dspam
- newins ${FILESDIR}/logrotate.dspam dspam
-
- # dspam cron job
- diropts -m0755 -o dspam -g dspam
- dodir /etc/cron.daily
- keepdir /etc/cron.daily
- exeinto /etc/cron.daily
- exeopts -m0755 -o dspam -g dspam
- doexe ${FILESDIR}/dspam.cron
-
- # dspam enviroment
- echo -ne "CONFIG_PROTECT=\"${CONFDIR} /var/run/dspam\"\n\n" > ${T}/40dspam
- doenvd ${T}/40dspam || die
-}
-
-pkg_postinst() {
- env-update
- if use mysql || use postgres || use oci8; then
- echo
- einfo "To setup DSPAM to run out-of-the-box on your system with a MySQL,"
- einfo "PostgreSQL or Oracle database, run:"
- einfo "emerge --config ${PF}"
- fi
- if use mysql || use postgres; then
- if has_version ">sys-kernel/linux-headers-2.6"; then
- einfo "If you want to run DSPAM in the new deamon mode. Remember"
- einfo "to make the DSPAM daemon start durig boot:"
- einfo " rc-update add dspam default"
- fi
- fi
- if use exim ; then
- echo
- einfo "To use dspam in conjunction with your exim system, you should read the README"
- fi
-}
-
-pkg_config () {
- if use sqlite ; then
- einfo "sqlite_drv will automatically create the necessary database"
- elif use mysql ; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- DSPAM_MySQL_USER="${DSPAM_DB_DATA[2]}"
- DSPAM_MySQL_PWD="${DSPAM_DB_DATA[3]}"
- DSPAM_MySQL_DB="${DSPAM_DB_DATA[4]}"
-
- ewarn "When prompted for a password, please enter your MySQL root password"
- ewarn
-
- einfo "Creating DSPAM MySQL database \"${DSPAM_MySQL_DB}\""
- /usr/bin/mysqladmin -u root -p create ${DSPAM_MySQL_DB}
-
- einfo "Creating DSPAM MySQL tables for data objects"
- einfo " Please select what kind of object database you like to use."
- einfo " [1] Space optimized database"
- einfo " [2] Speed optimized database"
- einfo
- while true
- do
- read -n 1 -s -p " Press 1 or 2 on the keyboard to select database" DSPAM_MySQL_DB_Type
- [[ "${DSPAM_MySQL_DB_Type}" == "1" || "${DSPAM_MySQL_DB_Type}" == "2" ]] && echo && break
- done
-
- if [ "${DSPAM_MySQL_DB_Type}" == "1" ]
- then
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-space.sql
- else
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-speed.sql
- fi
-
- if use virtual-users ; then
- einfo "Creating DSPAM MySQL database for virtual-users users"
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_virtual_users.sql
- fi
-
- if use neural ; then
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_neural.sql
- fi
-
- einfo "Creating DSPAM MySQL user \"${DSPAM_MySQL_USER}\""
- /usr/bin/mysql -u root -p -e "GRANT SELECT,INSERT,UPDATE,DELETE ON ${DSPAM_MySQL_DB}.* TO ${DSPAM_MySQL_USER}@localhost IDENTIFIED BY '${DSPAM_MySQL_PWD}';FLUSH PRIVILEGES;" -D mysql
- elif use postgres ; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/pgsql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- DSPAM_PgSQL_USER="${DSPAM_DB_DATA[2]}"
- DSPAM_PgSQL_PWD="${DSPAM_DB_DATA[3]}"
- DSPAM_PgSQL_DB="${DSPAM_DB_DATA[4]}"
-
- ewarn "When prompted for a password, please enter your PgSQL postgres password"
- ewarn
-
- einfo "Creating DSPAM PostgreSQL database \"${DSPAM_PgSQL_DB}\" and user \"${DSPAM_PgSQL_USER}\""
- /usr/bin/psql -h localhost -d template1 -U postgres -c "CREATE USER ${DSPAM_PgSQL_USER} WITH PASSWORD '${DSPAM_PgSQL_PWD}' NOCREATEDB NOCREATEUSER; CREATE DATABASE ${DSPAM_PgSQL_DB}; GRANT ALL PRIVILEGES ON DATABASE ${DSPAM_PgSQL_DB} TO ${DSPAM_PgSQL_USER}; GRANT ALL PRIVILEGES ON SCHEMA public TO ${DSPAM_PgSQL_USER}; UPDATE pg_database SET datdba=(SELECT usesysid FROM pg_shadow WHERE usename='${DSPAM_PgSQL_USER}') WHERE datname='${DSPAM_PgSQL_DB}';"
-
- einfo "Creating DSPAM PostgreSQL tables"
- PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_objects.sql 1>/dev/null 2>&1
-
- if use virtual-users ; then
- einfo "Creating DSPAM PostgreSQL database for virtual-users users"
- PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_virtual-users.sql 1>/dev/null 2>&1
- fi
- elif use oci8 ; then
- einfo "We have not enought Oracle knowledge to configure Oracle"
- einfo "automatically. If you know how, please post a message in"
- einfo "Gentoo Bugzilla."
- einfo
- einfo "You need manually to create the Oracle user for DSPAM and"
- einfo "the necessary database."
- einfo "But the DSPAM configuration file dspam.conf and oracle.data"
- einfo "was already configured with the necessary information to"
- einfo "access the database."
- einfo "Please read your dspam.conf, oracle.data and the README for"
- einfo "more info on how to setup DSPAM with Oracle."
- einfo "objects for each user upon first use of DSPAM by that user."
- fi
-
-}
diff --git a/mail-filter/dspam/dspam-3.6.1.ebuild b/mail-filter/dspam/dspam-3.6.1.ebuild
deleted file mode 100644
index c07b50e02a18..000000000000
--- a/mail-filter/dspam/dspam-3.6.1.ebuild
+++ /dev/null
@@ -1,481 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.6.1.ebuild,v 1.6 2006/01/08 17:29:50 rl03 Exp $
-
-inherit eutils
-
-DESCRIPTION="A statistical-algorithmic hybrid anti-spam filter"
-SRC_URI="http://dspam.nuclearelephant.com/sources/${P}.tar.gz
- http://dspam.nuclearelephant.com/sources/extras/dspam_sa_trainer.tar.gz"
-HOMEPAGE="http://dspam.nuclearelephant.com/"
-LICENSE="GPL-2"
-
-IUSE="berkdb clamav debug large-domain logrotate mysql neural oci8 postgres sqlite sqlite3 virtual-users user-homedirs"
-DEPEND="clamav? ( >=app-antivirus/clamav-0.86 )
- mysql? ( >=dev-db/mysql-3.23 )
- sqlite? ( <dev-db/sqlite-3 )
- sqlite3? ( =dev-db/sqlite-3* )
- postgres? ( >=dev-db/postgresql-7.4.3 )
- berkdb? ( >=sys-libs/db-4.0 )
- "
-RDEPEND="sys-process/cronbase
- clamav? ( >=app-antivirus/clamav-0.86 )
- mysql? ( >=dev-db/mysql-3.23 )
- sqlite? ( <dev-db/sqlite-3 )
- sqlite3? ( =dev-db/sqlite-3* )
- postgres? ( >=dev-db/postgresql-7.4.3 )
- berkdb? ( >=sys-libs/db-4.0 )
- logrotate? ( app-admin/logrotate )"
-KEYWORDS="~x86 ~ppc ~alpha ~amd64"
-SLOT="0"
-
-# some FHS-like structure
-HOMEDIR="/var/spool/dspam"
-CONFDIR="/etc/mail/dspam"
-LOGDIR="/var/log/dspam"
-
-pkg_setup() {
- local multiple_dbs="0"
- local supported_dbs="berkdb mysql postgres oci8 sqlite sqlite3"
- for foo in ${supported_dbs}; do
- if use ${foo}; then
- let multiple_dbs="((multiple_dbs + 1 ))"
- einfo " ${foo} database support in your USE flags."
- fi
- done
- if [ "${multiple_dbs}" -ge "2" ]; then
- echo
- ewarn "You have multiple database backends active in your USE flags."
- ewarn "Will default to MySQL as your dspam database backend."
- ewarn "If you want to build with another database backend; hit Control-C now."
- ewarn "Change your USE flag -mysql and emerge again."
- echo
- has_version ">=sys-apps/portage-2.0.50" && (
- einfo "It would be best practice to add the set of USE flags that you use for this"
- einfo "package to the file: /etc/portage/package.use. Example:"
- einfo "\`echo \"mail-filter/dspam -mysql postgres -oci8 -sqlite -sqlite3\" >> /etc/portage/package.use\`"
- einfo "to build dspam with Postgres database as your dspam backend."
- )
- elif [ "${multiple_dbs}" -eq "0" ]; then
- echo
- ewarn "You did not select any SQL based database backend."
- ewarn "DSPAM will use self-contained Hash driver for storing data."
- ewarn "If you don't want that, then enable one of the following"
- ewarn "USE flags: ${supported_dbs}"
- fi
- has_version ">sys-kernel/linux-headers-2.6" || (
- einfo "To use the new DSPAM deamon mode, you need to emerge"
- einfo ">sys-kernel/linux-headers-2.6 and rebuild glibc to support NPTL"
- )
- if use virtual-users && use user-homedirs ; then
- ewarn "If the users are virtual, then they probably should not have home directories."
- fi
- if use user-homedirs ; then
- ewarn "WARNING: dspam-web will not work with user-homedirs. Disable this USE flag"
- ewarn "if you intend on using dspam-web."
- fi
- id dspam 2>/dev/null || enewgroup dspam 26
- id dspam 2>/dev/null || enewuser dspam 26 /bin/bash ${HOMEDIR} dspam
-}
-
-src_compile() {
- local myconf
-
- myconf="${myconf} --enable-long-username"
- myconf="${myconf} --with-delivery-agent=/usr/bin/procmail"
- use large-domain && myconf="${myconf} --enable-large-scale" ||\
- myconf="${myconf} --enable-domain-scale"
-
- myconf="${myconf} --with-dspam-home=${HOMEDIR}"
- myconf="${myconf} --sysconfdir=${CONFDIR}"
- use user-homedirs && myconf="${myconf} --enable-homedir"
- use clamav && myconf="${myconf} --enable-clamav"
-
- # enables support for debugging (touch /etc/dspam/.debug to turn on)
- # optional: even MORE debugging output, use with extreme caution!
- use debug && myconf="${myconf} --enable-debug --enable-verbose-debug"
-
- # select storage driver
- if use sqlite ; then
- myconf="${myconf} --with-storage-driver=sqlite_drv"
- myconf="${myconf} --enable-virtual-users"
- elif use sqlite3 ; then
- myconf="${myconf} --with-storage-driver=sqlite3_drv"
- myconf="${myconf} --enable-virtual-users"
- elif use mysql; then
- myconf="${myconf} --with-storage-driver=mysql_drv"
- myconf="${myconf} --with-mysql-includes=/usr/include/mysql"
- myconf="${myconf} --with-mysql-libraries=/usr/lib/mysql"
- myconf="${myconf} --enable-preferences-extension"
-
- if has_version ">sys-kernel/linux-headers-2.6"; then
- myconf="${myconf} --enable-daemon"
- fi
-
- use virtual-users && myconf="${myconf} --enable-virtual-users"
- # an experimental feature available with MySQL and PgSQL backend
- use neural && myconf="${myconf} --enable-neural-networking"
- elif use postgres ; then
- myconf="${myconf} --with-storage-driver=pgsql_drv"
- myconf="${myconf} --with-pgsql-includes=/usr/include/postgresql"
- myconf="${myconf} --with-pgsql-libraries=/usr/lib/postgresql"
- myconf="${myconf} --enable-preferences-extension"
-
- if has_version ">sys-kernel/linux-headers-2.6"; then
- myconf="${myconf} --enable-daemon"
- fi
-
- use virtual-users && myconf="${myconf} --enable-virtual-users"
- # an experimental feature available with MySQL and PgSQL backend
- use neural && myconf="${myconf} --enable-neural-networking"
- elif use oci8 ; then
- myconf="${myconf} --with-storage-driver=ora_drv"
- myconf="${myconf} --with-oracle-home=${ORACLE_HOME}"
- myconf="${myconf} --enable-virtual-users"
-
- # I am in no way a Oracle specialist. If someone knows
- # how to query the version of Oracle, then let me know.
- if (expr ${ORACLE_HOME/*\/} : 10 1>/dev/null 2>&1); then
- myconf="${myconf} --with-oracle-version=10"
- fi
- elif use berkdb ; then
- myconf="${myconf} --with-storage-driver=libdb4_drv"
- else
- myconf="${myconf} --with-storage-driver=hash_drv"
- fi
-
- econf ${myconf} || die
- emake || die
-}
-
-src_install () {
-
- # Fix issues with older dspam configuration
- CONFIG_PROTECT="${CONFIG_PROTECT} ${HOMEDIR} ${CONFDIR} /var/run/dspam"
- CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${HOMEDIR}/}"
- CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${CONFDIR}/}"
-
- # open up perms on $HOMEDIR
- diropts -m0775 -o dspam -g dspam
- dodir ${HOMEDIR}
- keepdir ${HOMEDIR}
-
- # keeps dspam data in $CONFDIR
- diropts -m0775 -o dspam -g dspam
- dodir ${CONFDIR}
- keepdir ${CONFDIR}
-
- # make install
- make DESTDIR=${D} install || die
- chmod o+s ${D}/usr/bin/dspam
- chmod o+s ${D}/usr/bin/dspam_stats
-
- # documentation
- dodoc CHANGELOG LICENSE README* RELEASE.NOTES UPGRADING
- dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
- docinto doc
- dodoc doc/*.txt
- docinto gentoo
- dodoc ${FILESDIR}/README.postfix ${FILESDIR}/README.qmail
- if use sqlite; then
- dodoc src/tools.sqlite_drv/README
- elif use mysql; then
- dodoc src/tools.mysql_drv/README
- elif use postgres ; then
- dodoc src/tools.pgsql_drv/README
- elif use oci8 ; then
- dodoc src/tools.ora_drv/README
- fi
- doman man/dspam*
- dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
-
- # build some initial configuration data
- [ ! -f ${CONFDIR}/dspam.conf ] \
- && cp src/dspam.conf ${T}/dspam.conf
-
- if use mysql || use postgres; then
- if has_version ">sys-kernel/linux-headers-2.6"; then
- # keeps dspam socket for deamon in /var/run/dspam
- diropts -m0775 -o dspam -g dspam
- dodir /var/run/dspam
- keepdir /var/run/dspam
-
- # We use sockets for the deamon instead of tcp port 24
- sed -e 's:^#*\(ServerDomainSocketPath[\t ]\{1,\}\).*:\1\"/var/run/dspam/dspam.sock\":gI' \
- -e 's:^#*\(ServerPID[\t ]\{1,\}\).*:\1/var/run/dspam/dspam.pid:gI' \
- -i ${T}/dspam.conf
-
- # dspam init script
- exeinto /etc/init.d
- exeopts -m0755 -o root -g root
- newexe ${FILESDIR}/dspam.rc dspam
- fi
- fi
-
- # generate random password
- local PASSWORD="${RANDOM}${RANDOM}${RANDOM}${RANDOM}"
-
- # database related configuration and scripts
- if use sqlite; then
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- newins src/tools.sqlite_drv/purge-2.sql sqlite_purge.sql
- elif use sqlite3; then
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- newins src/tools.sqlite_drv/purge-3.sql sqlite3_purge.sql
- elif use mysql; then
- # Use existing configuration if possible
- if [[ -f ${ROOT}${CONFDIR}/mysql.data ]]; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="/var/run/mysqld/mysqld.sock"
- DSPAM_DB_DATA[1]=""
- DSPAM_DB_DATA[2]="dspam"
- DSPAM_DB_DATA[3]="${PASSWORD}"
- DSPAM_DB_DATA[4]="dspam"
- DSPAM_DB_DATA[5]="true"
- fi
-
- # Modify configuration and create mysql.data file
- sed -e "s:^#*\(MySQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^#*\(MySQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^#*\(MySQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^#*\(MySQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
- -e "s:^#*\(MySQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
- -e "s:^#*\(MySQLCompress[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[5]}:gI" \
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/mysql.data
- done
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/mysql.data
- newins src/tools.mysql_drv/mysql_objects-space.sql mysql_objects-space.sql
- newins src/tools.mysql_drv/mysql_objects-speed.sql mysql_objects-speed.sql
- newins src/tools.mysql_drv/mysql_objects-4.1.sql mysql_objects-4.1.sql
- newins src/tools.mysql_drv/virtual_users.sql mysql_virtual_users.sql
- newins src/tools.mysql_drv/neural.sql mysql_neural.sql
- newins src/tools.mysql_drv/purge.sql mysql_purge.sql
- newins src/tools.mysql_drv/purge-4.1.sql mysql_purge-4.1.sql
-
- elif use postgres ; then
- # Use existing configuration if possible
- if [ -f ${ROOT}${CONFDIR}/pgsql.data ]; then
- DSPAM_DB_DATA=( $(cat "${ROOT}${CONFDIR}/pgsql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="127.0.0.1"
- DSPAM_DB_DATA[1]="5432"
- DSPAM_DB_DATA[2]="dspam"
- DSPAM_DB_DATA[3]="${PASSWORD}"
- DSPAM_DB_DATA[4]="dspam"
- fi
-
- # Modify configuration and create pgsql.data file
- sed -e "s:^#*\(PgSQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^#*\(PgSQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^#*\(PgSQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^#*\(PgSQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
- -e "s:^#*\(PgSQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
- -e "s:^#*\(PgSQLConnectionCache[\t ]*.\):\1:gI" \
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/pgsql.data
- done
-
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/pgsql.data
- newins src/tools.pgsql_drv/pgsql_objects.sql pgsql_objects.sql
- newins src/tools.pgsql_drv/virtual_users.sql pgsql_virtual_users.sql
- newins src/tools.pgsql_drv/purge.sql pgsql_purge.sql
-
- elif use oci8 ; then
- # Use existing configuration if possible
- if [ -f ${ROOT}${CONFDIR}/oracle.data ]; then
- DSPAM_DB_DATA=( $(cat "${ROOT}${CONFDIR}/oracle.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=PROD)))"
- DSPAM_DB_DATA[1]="dspam"
- DSPAM_DB_DATA[2]="${PASSWORD}"
- DSPAM_DB_DATA[3]="dspam"
- fi
-
- # Modify configuration and create oracle.data file
- sed -e "s:^#*\(OraServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^\(OraUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^\(OraPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^\(OraSchema[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI"\
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/oracle.data
- done
-
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/oracle.data
- newins src/tools.ora_drv/oral_objects.sql ora_objects.sql
- newins src/tools.ora_drv/virtual_users.sql ora_virtual_users.sql
- newins src/tools.ora_drv/purge.sql ora_purge.sql
- fi
-
- sed -e "s:^\(Purge.*\):###\1:g" \
- -e "s:^#\(Purge.*\):\1:g" \
- -e "s:^###\(Purge.*\):#\1:g" \
- -i ${T}/dspam.conf
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/dspam.conf
-
- # installs the notification messages
- # -> The documentation is wrong! The files need to be in ./txt
- diropts -m0775 -o dspam -g dspam
- dodir ${CONFDIR}/txt
- keepdir ${CONFDIR}/txt
- insinto ${CONFDIR}/txt
- insopts -m644 -o dspam -g dspam
- doins ${S}/txt/*.txt
-
- # Create the opt-in / opt-out directories
- diropts -m0775 -o dspam -g dspam
- dodir ${CONFDIR}/opt-in
- keepdir ${CONFDIR}/opt-in
- dodir ${CONFDIR}/opt-out
- keepdir ${CONFDIR}/opt-out
-
- # logrotation scripts
- diropts -m0755 -o dspam -g dspam
- dodir /etc/logrotate.d
- keepdir /etc/logrotate.d
- insinto /etc/logrotate.d
- insopts -m0644 -o dspam -g dspam
- newins ${FILESDIR}/logrotate.dspam dspam
-
- # dspam cron job
- diropts -m0755 -o dspam -g dspam
- dodir /etc/cron.daily
- keepdir /etc/cron.daily
- exeinto /etc/cron.daily
- exeopts -m0755 -o dspam -g dspam
- doexe ${FILESDIR}/dspam.cron
-
- # dspam enviroment
- echo -ne "CONFIG_PROTECT=\"${CONFDIR} /var/run/dspam\"\n\n" > ${T}/40dspam
- doenvd ${T}/40dspam || die
-}
-
-pkg_postinst() {
- env-update
- if use mysql || use postgres || use oci8; then
- echo
- einfo "To setup DSPAM to run out-of-the-box on your system with a MySQL,"
- einfo "PostgreSQL or Oracle database, run:"
- einfo "emerge --config ${PF}"
- fi
- if use mysql || use postgres; then
- if has_version ">sys-kernel/linux-headers-2.6"; then
- einfo "If you want to run DSPAM in the new deamon mode. Remember"
- einfo "to make the DSPAM daemon start durig boot:"
- einfo " rc-update add dspam default"
- fi
- fi
- if use exim ; then
- echo
- einfo "To use dspam in conjunction with your exim system, you should read the README"
- fi
-}
-
-pkg_config () {
- if use sqlite ; then
- einfo "sqlite_drv will automatically create the necessary database"
- elif use mysql ; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- DSPAM_MySQL_USER="${DSPAM_DB_DATA[2]}"
- DSPAM_MySQL_PWD="${DSPAM_DB_DATA[3]}"
- DSPAM_MySQL_DB="${DSPAM_DB_DATA[4]}"
-
- ewarn "When prompted for a password, please enter your MySQL root password"
- ewarn
-
- einfo "Creating DSPAM MySQL database \"${DSPAM_MySQL_DB}\""
- /usr/bin/mysqladmin -u root -p create ${DSPAM_MySQL_DB}
-
- einfo "Creating DSPAM MySQL tables for data objects"
- einfo " Please select what kind of object database you like to use."
- einfo " [1] Space optimized database"
- einfo " [2] Speed optimized database"
- einfo
- while true
- do
- read -n 1 -s -p " Press 1 or 2 on the keyboard to select database" DSPAM_MySQL_DB_Type
- [[ "${DSPAM_MySQL_DB_Type}" == "1" || "${DSPAM_MySQL_DB_Type}" == "2" ]] && echo && break
- done
-
- if [ "${DSPAM_MySQL_DB_Type}" == "1" ]
- then
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-space.sql
- else
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-speed.sql
- fi
-
- if use virtual-users ; then
- einfo "Creating DSPAM MySQL database for virtual-users users"
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_virtual_users.sql
- fi
-
- if use neural ; then
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_neural.sql
- fi
-
- einfo "Creating DSPAM MySQL user \"${DSPAM_MySQL_USER}\""
- /usr/bin/mysql -u root -p -e "GRANT SELECT,INSERT,UPDATE,DELETE ON ${DSPAM_MySQL_DB}.* TO ${DSPAM_MySQL_USER}@localhost IDENTIFIED BY '${DSPAM_MySQL_PWD}';FLUSH PRIVILEGES;" -D mysql
- elif use postgres ; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/pgsql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- DSPAM_PgSQL_USER="${DSPAM_DB_DATA[2]}"
- DSPAM_PgSQL_PWD="${DSPAM_DB_DATA[3]}"
- DSPAM_PgSQL_DB="${DSPAM_DB_DATA[4]}"
-
- ewarn "When prompted for a password, please enter your PgSQL postgres password"
- ewarn
-
- einfo "Creating DSPAM PostgreSQL database \"${DSPAM_PgSQL_DB}\" and user \"${DSPAM_PgSQL_USER}\""
- /usr/bin/psql -h localhost -d template1 -U postgres -c "CREATE USER ${DSPAM_PgSQL_USER} WITH PASSWORD '${DSPAM_PgSQL_PWD}' NOCREATEDB NOCREATEUSER; CREATE DATABASE ${DSPAM_PgSQL_DB}; GRANT ALL PRIVILEGES ON DATABASE ${DSPAM_PgSQL_DB} TO ${DSPAM_PgSQL_USER}; GRANT ALL PRIVILEGES ON SCHEMA public TO ${DSPAM_PgSQL_USER}; UPDATE pg_database SET datdba=(SELECT usesysid FROM pg_shadow WHERE usename='${DSPAM_PgSQL_USER}') WHERE datname='${DSPAM_PgSQL_DB}';"
-
- einfo "Creating DSPAM PostgreSQL tables"
- PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_objects.sql 1>/dev/null 2>&1
-
- if use virtual-users ; then
- einfo "Creating DSPAM PostgreSQL database for virtual-users users"
- PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_virtual-users.sql 1>/dev/null 2>&1
- fi
- elif use oci8 ; then
- einfo "We have not enought Oracle knowledge to configure Oracle"
- einfo "automatically. If you know how, please post a message in"
- einfo "Gentoo Bugzilla."
- einfo
- einfo "You need manually to create the Oracle user for DSPAM and"
- einfo "the necessary database."
- einfo "But the DSPAM configuration file dspam.conf and oracle.data"
- einfo "was already configured with the necessary information to"
- einfo "access the database."
- einfo "Please read your dspam.conf, oracle.data and the README for"
- einfo "more info on how to setup DSPAM with Oracle."
- einfo "objects for each user upon first use of DSPAM by that user."
- fi
-
-}
diff --git a/mail-filter/dspam/dspam-3.6.2.ebuild b/mail-filter/dspam/dspam-3.6.2.ebuild
deleted file mode 100644
index 4242710a9901..000000000000
--- a/mail-filter/dspam/dspam-3.6.2.ebuild
+++ /dev/null
@@ -1,481 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.6.2.ebuild,v 1.2 2006/01/08 17:29:50 rl03 Exp $
-
-inherit eutils
-
-DESCRIPTION="A statistical-algorithmic hybrid anti-spam filter"
-SRC_URI="http://dspam.nuclearelephant.com/sources/${P}.tar.gz
- http://dspam.nuclearelephant.com/sources/extras/dspam_sa_trainer.tar.gz"
-HOMEPAGE="http://dspam.nuclearelephant.com/"
-LICENSE="GPL-2"
-
-IUSE="berkdb clamav debug large-domain logrotate mysql neural oci8 postgres sqlite sqlite3 virtual-users user-homedirs"
-DEPEND="clamav? ( >=app-antivirus/clamav-0.86 )
- mysql? ( >=dev-db/mysql-3.23 )
- sqlite? ( <dev-db/sqlite-3 )
- sqlite3? ( =dev-db/sqlite-3* )
- postgres? ( >=dev-db/postgresql-7.4.3 )
- berkdb? ( >=sys-libs/db-4.0 )
- "
-RDEPEND="sys-process/cronbase
- clamav? ( >=app-antivirus/clamav-0.86 )
- mysql? ( >=dev-db/mysql-3.23 )
- sqlite? ( <dev-db/sqlite-3 )
- sqlite3? ( =dev-db/sqlite-3* )
- postgres? ( >=dev-db/postgresql-7.4.3 )
- berkdb? ( >=sys-libs/db-4.0 )
- logrotate? ( app-admin/logrotate )"
-KEYWORDS="~x86 ~ppc ~alpha ~amd64"
-SLOT="0"
-
-# some FHS-like structure
-HOMEDIR="/var/spool/dspam"
-CONFDIR="/etc/mail/dspam"
-LOGDIR="/var/log/dspam"
-
-pkg_setup() {
- local multiple_dbs="0"
- local supported_dbs="berkdb mysql postgres oci8 sqlite sqlite3"
- for foo in ${supported_dbs}; do
- if use ${foo}; then
- let multiple_dbs="((multiple_dbs + 1 ))"
- einfo " ${foo} database support in your USE flags."
- fi
- done
- if [ "${multiple_dbs}" -ge "2" ]; then
- echo
- ewarn "You have multiple database backends active in your USE flags."
- ewarn "Will default to MySQL as your dspam database backend."
- ewarn "If you want to build with another database backend; hit Control-C now."
- ewarn "Change your USE flag -mysql and emerge again."
- echo
- has_version ">=sys-apps/portage-2.0.50" && (
- einfo "It would be best practice to add the set of USE flags that you use for this"
- einfo "package to the file: /etc/portage/package.use. Example:"
- einfo "\`echo \"mail-filter/dspam -mysql postgres -oci8 -sqlite -sqlite3\" >> /etc/portage/package.use\`"
- einfo "to build dspam with Postgres database as your dspam backend."
- )
- elif [ "${multiple_dbs}" -eq "0" ]; then
- echo
- ewarn "You did not select any SQL based database backend."
- ewarn "DSPAM will use self-contained Hash driver for storing data."
- ewarn "If you don't want that, then enable one of the following"
- ewarn "USE flags: ${supported_dbs}"
- fi
- has_version ">sys-kernel/linux-headers-2.6" || (
- einfo "To use the new DSPAM deamon mode, you need to emerge"
- einfo ">sys-kernel/linux-headers-2.6 and rebuild glibc to support NPTL"
- )
- if use virtual-users && use user-homedirs ; then
- ewarn "If the users are virtual, then they probably should not have home directories."
- fi
- if use user-homedirs ; then
- ewarn "WARNING: dspam-web will not work with user-homedirs. Disable this USE flag"
- ewarn "if you intend on using dspam-web."
- fi
- id dspam 2>/dev/null || enewgroup dspam 26
- id dspam 2>/dev/null || enewuser dspam 26 /bin/bash ${HOMEDIR} dspam
-}
-
-src_compile() {
- local myconf
-
- myconf="${myconf} --enable-long-username"
- myconf="${myconf} --with-delivery-agent=/usr/bin/procmail"
- use large-domain && myconf="${myconf} --enable-large-scale" ||\
- myconf="${myconf} --enable-domain-scale"
-
- myconf="${myconf} --with-dspam-home=${HOMEDIR}"
- myconf="${myconf} --sysconfdir=${CONFDIR}"
- use user-homedirs && myconf="${myconf} --enable-homedir"
- use clamav && myconf="${myconf} --enable-clamav"
-
- # enables support for debugging (touch /etc/dspam/.debug to turn on)
- # optional: even MORE debugging output, use with extreme caution!
- use debug && myconf="${myconf} --enable-debug --enable-verbose-debug"
-
- # select storage driver
- if use sqlite ; then
- myconf="${myconf} --with-storage-driver=sqlite_drv"
- myconf="${myconf} --enable-virtual-users"
- elif use sqlite3 ; then
- myconf="${myconf} --with-storage-driver=sqlite3_drv"
- myconf="${myconf} --enable-virtual-users"
- elif use mysql; then
- myconf="${myconf} --with-storage-driver=mysql_drv"
- myconf="${myconf} --with-mysql-includes=/usr/include/mysql"
- myconf="${myconf} --with-mysql-libraries=/usr/lib/mysql"
- myconf="${myconf} --enable-preferences-extension"
-
- if has_version ">sys-kernel/linux-headers-2.6"; then
- myconf="${myconf} --enable-daemon"
- fi
-
- use virtual-users && myconf="${myconf} --enable-virtual-users"
- # an experimental feature available with MySQL and PgSQL backend
- use neural && myconf="${myconf} --enable-neural-networking"
- elif use postgres ; then
- myconf="${myconf} --with-storage-driver=pgsql_drv"
- myconf="${myconf} --with-pgsql-includes=/usr/include/postgresql"
- myconf="${myconf} --with-pgsql-libraries=/usr/lib/postgresql"
- myconf="${myconf} --enable-preferences-extension"
-
- if has_version ">sys-kernel/linux-headers-2.6"; then
- myconf="${myconf} --enable-daemon"
- fi
-
- use virtual-users && myconf="${myconf} --enable-virtual-users"
- # an experimental feature available with MySQL and PgSQL backend
- use neural && myconf="${myconf} --enable-neural-networking"
- elif use oci8 ; then
- myconf="${myconf} --with-storage-driver=ora_drv"
- myconf="${myconf} --with-oracle-home=${ORACLE_HOME}"
- myconf="${myconf} --enable-virtual-users"
-
- # I am in no way a Oracle specialist. If someone knows
- # how to query the version of Oracle, then let me know.
- if (expr ${ORACLE_HOME/*\/} : 10 1>/dev/null 2>&1); then
- myconf="${myconf} --with-oracle-version=10"
- fi
- elif use berkdb ; then
- myconf="${myconf} --with-storage-driver=libdb4_drv"
- else
- myconf="${myconf} --with-storage-driver=hash_drv"
- fi
-
- econf ${myconf} || die
- emake || die
-}
-
-src_install () {
-
- # Fix issues with older dspam configuration
- CONFIG_PROTECT="${CONFIG_PROTECT} ${HOMEDIR} ${CONFDIR} /var/run/dspam"
- CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${HOMEDIR}/}"
- CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${CONFDIR}/}"
-
- # open up perms on $HOMEDIR
- diropts -m0775 -o dspam -g dspam
- dodir ${HOMEDIR}
- keepdir ${HOMEDIR}
-
- # keeps dspam data in $CONFDIR
- diropts -m0775 -o dspam -g dspam
- dodir ${CONFDIR}
- keepdir ${CONFDIR}
-
- # make install
- make DESTDIR=${D} install || die
- chmod o+s ${D}/usr/bin/dspam
- chmod o+s ${D}/usr/bin/dspam_stats
-
- # documentation
- dodoc CHANGELOG LICENSE README* RELEASE.NOTES UPGRADING
- dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
- docinto doc
- dodoc doc/*.txt
- docinto gentoo
- dodoc ${FILESDIR}/README.postfix ${FILESDIR}/README.qmail
- if use sqlite; then
- dodoc src/tools.sqlite_drv/README
- elif use mysql; then
- dodoc src/tools.mysql_drv/README
- elif use postgres ; then
- dodoc src/tools.pgsql_drv/README
- elif use oci8 ; then
- dodoc src/tools.ora_drv/README
- fi
- doman man/dspam*
- dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
-
- # build some initial configuration data
- [ ! -f ${CONFDIR}/dspam.conf ] \
- && cp src/dspam.conf ${T}/dspam.conf
-
- if use mysql || use postgres; then
- if has_version ">sys-kernel/linux-headers-2.6"; then
- # keeps dspam socket for deamon in /var/run/dspam
- diropts -m0775 -o dspam -g dspam
- dodir /var/run/dspam
- keepdir /var/run/dspam
-
- # We use sockets for the deamon instead of tcp port 24
- sed -e 's:^#*\(ServerDomainSocketPath[\t ]\{1,\}\).*:\1\"/var/run/dspam/dspam.sock\":gI' \
- -e 's:^#*\(ServerPID[\t ]\{1,\}\).*:\1/var/run/dspam/dspam.pid:gI' \
- -i ${T}/dspam.conf
-
- # dspam init script
- exeinto /etc/init.d
- exeopts -m0755 -o root -g root
- newexe ${FILESDIR}/dspam.rc dspam
- fi
- fi
-
- # generate random password
- local PASSWORD="${RANDOM}${RANDOM}${RANDOM}${RANDOM}"
-
- # database related configuration and scripts
- if use sqlite; then
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- newins src/tools.sqlite_drv/purge-2.sql sqlite_purge.sql
- elif use sqlite3; then
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- newins src/tools.sqlite_drv/purge-3.sql sqlite3_purge.sql
- elif use mysql; then
- # Use existing configuration if possible
- if [[ -f ${ROOT}${CONFDIR}/mysql.data ]]; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="/var/run/mysqld/mysqld.sock"
- DSPAM_DB_DATA[1]=""
- DSPAM_DB_DATA[2]="dspam"
- DSPAM_DB_DATA[3]="${PASSWORD}"
- DSPAM_DB_DATA[4]="dspam"
- DSPAM_DB_DATA[5]="true"
- fi
-
- # Modify configuration and create mysql.data file
- sed -e "s:^#*\(MySQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^#*\(MySQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^#*\(MySQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^#*\(MySQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
- -e "s:^#*\(MySQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
- -e "s:^#*\(MySQLCompress[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[5]}:gI" \
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/mysql.data
- done
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/mysql.data
- newins src/tools.mysql_drv/mysql_objects-space.sql mysql_objects-space.sql
- newins src/tools.mysql_drv/mysql_objects-speed.sql mysql_objects-speed.sql
- newins src/tools.mysql_drv/mysql_objects-4.1.sql mysql_objects-4.1.sql
- newins src/tools.mysql_drv/virtual_users.sql mysql_virtual_users.sql
- newins src/tools.mysql_drv/neural.sql mysql_neural.sql
- newins src/tools.mysql_drv/purge.sql mysql_purge.sql
- newins src/tools.mysql_drv/purge-4.1.sql mysql_purge-4.1.sql
-
- elif use postgres ; then
- # Use existing configuration if possible
- if [ -f ${ROOT}${CONFDIR}/pgsql.data ]; then
- DSPAM_DB_DATA=( $(cat "${ROOT}${CONFDIR}/pgsql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="127.0.0.1"
- DSPAM_DB_DATA[1]="5432"
- DSPAM_DB_DATA[2]="dspam"
- DSPAM_DB_DATA[3]="${PASSWORD}"
- DSPAM_DB_DATA[4]="dspam"
- fi
-
- # Modify configuration and create pgsql.data file
- sed -e "s:^#*\(PgSQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^#*\(PgSQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^#*\(PgSQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^#*\(PgSQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
- -e "s:^#*\(PgSQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
- -e "s:^#*\(PgSQLConnectionCache[\t ]*.\):\1:gI" \
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/pgsql.data
- done
-
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/pgsql.data
- newins src/tools.pgsql_drv/pgsql_objects.sql pgsql_objects.sql
- newins src/tools.pgsql_drv/virtual_users.sql pgsql_virtual_users.sql
- newins src/tools.pgsql_drv/purge.sql pgsql_purge.sql
-
- elif use oci8 ; then
- # Use existing configuration if possible
- if [ -f ${ROOT}${CONFDIR}/oracle.data ]; then
- DSPAM_DB_DATA=( $(cat "${ROOT}${CONFDIR}/oracle.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=PROD)))"
- DSPAM_DB_DATA[1]="dspam"
- DSPAM_DB_DATA[2]="${PASSWORD}"
- DSPAM_DB_DATA[3]="dspam"
- fi
-
- # Modify configuration and create oracle.data file
- sed -e "s:^#*\(OraServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^\(OraUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^\(OraPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^\(OraSchema[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI"\
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/oracle.data
- done
-
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/oracle.data
- newins src/tools.ora_drv/oral_objects.sql ora_objects.sql
- newins src/tools.ora_drv/virtual_users.sql ora_virtual_users.sql
- newins src/tools.ora_drv/purge.sql ora_purge.sql
- fi
-
- sed -e "s:^\(Purge.*\):###\1:g" \
- -e "s:^#\(Purge.*\):\1:g" \
- -e "s:^###\(Purge.*\):#\1:g" \
- -i ${T}/dspam.conf
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/dspam.conf
-
- # installs the notification messages
- # -> The documentation is wrong! The files need to be in ./txt
- diropts -m0775 -o dspam -g dspam
- dodir ${CONFDIR}/txt
- keepdir ${CONFDIR}/txt
- insinto ${CONFDIR}/txt
- insopts -m644 -o dspam -g dspam
- doins ${S}/txt/*.txt
-
- # Create the opt-in / opt-out directories
- diropts -m0775 -o dspam -g dspam
- dodir ${CONFDIR}/opt-in
- keepdir ${CONFDIR}/opt-in
- dodir ${CONFDIR}/opt-out
- keepdir ${CONFDIR}/opt-out
-
- # logrotation scripts
- diropts -m0755 -o dspam -g dspam
- dodir /etc/logrotate.d
- keepdir /etc/logrotate.d
- insinto /etc/logrotate.d
- insopts -m0644 -o dspam -g dspam
- newins ${FILESDIR}/logrotate.dspam dspam
-
- # dspam cron job
- diropts -m0755 -o dspam -g dspam
- dodir /etc/cron.daily
- keepdir /etc/cron.daily
- exeinto /etc/cron.daily
- exeopts -m0755 -o dspam -g dspam
- doexe ${FILESDIR}/dspam.cron
-
- # dspam enviroment
- echo -ne "CONFIG_PROTECT=\"${CONFDIR} /var/run/dspam\"\n\n" > ${T}/40dspam
- doenvd ${T}/40dspam || die
-}
-
-pkg_postinst() {
- env-update
- if use mysql || use postgres || use oci8; then
- echo
- einfo "To setup DSPAM to run out-of-the-box on your system with a MySQL,"
- einfo "PostgreSQL or Oracle database, run:"
- einfo "emerge --config ${PF}"
- fi
- if use mysql || use postgres; then
- if has_version ">sys-kernel/linux-headers-2.6"; then
- einfo "If you want to run DSPAM in the new deamon mode. Remember"
- einfo "to make the DSPAM daemon start durig boot:"
- einfo " rc-update add dspam default"
- fi
- fi
- if use exim ; then
- echo
- einfo "To use dspam in conjunction with your exim system, you should read the README"
- fi
-}
-
-pkg_config () {
- if use sqlite ; then
- einfo "sqlite_drv will automatically create the necessary database"
- elif use mysql ; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- DSPAM_MySQL_USER="${DSPAM_DB_DATA[2]}"
- DSPAM_MySQL_PWD="${DSPAM_DB_DATA[3]}"
- DSPAM_MySQL_DB="${DSPAM_DB_DATA[4]}"
-
- ewarn "When prompted for a password, please enter your MySQL root password"
- ewarn
-
- einfo "Creating DSPAM MySQL database \"${DSPAM_MySQL_DB}\""
- /usr/bin/mysqladmin -u root -p create ${DSPAM_MySQL_DB}
-
- einfo "Creating DSPAM MySQL tables for data objects"
- einfo " Please select what kind of object database you like to use."
- einfo " [1] Space optimized database"
- einfo " [2] Speed optimized database"
- einfo
- while true
- do
- read -n 1 -s -p " Press 1 or 2 on the keyboard to select database" DSPAM_MySQL_DB_Type
- [[ "${DSPAM_MySQL_DB_Type}" == "1" || "${DSPAM_MySQL_DB_Type}" == "2" ]] && echo && break
- done
-
- if [ "${DSPAM_MySQL_DB_Type}" == "1" ]
- then
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-space.sql
- else
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-speed.sql
- fi
-
- if use virtual-users ; then
- einfo "Creating DSPAM MySQL database for virtual-users users"
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_virtual_users.sql
- fi
-
- if use neural ; then
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_neural.sql
- fi
-
- einfo "Creating DSPAM MySQL user \"${DSPAM_MySQL_USER}\""
- /usr/bin/mysql -u root -p -e "GRANT SELECT,INSERT,UPDATE,DELETE ON ${DSPAM_MySQL_DB}.* TO ${DSPAM_MySQL_USER}@localhost IDENTIFIED BY '${DSPAM_MySQL_PWD}';FLUSH PRIVILEGES;" -D mysql
- elif use postgres ; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/pgsql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- DSPAM_PgSQL_USER="${DSPAM_DB_DATA[2]}"
- DSPAM_PgSQL_PWD="${DSPAM_DB_DATA[3]}"
- DSPAM_PgSQL_DB="${DSPAM_DB_DATA[4]}"
-
- ewarn "When prompted for a password, please enter your PgSQL postgres password"
- ewarn
-
- einfo "Creating DSPAM PostgreSQL database \"${DSPAM_PgSQL_DB}\" and user \"${DSPAM_PgSQL_USER}\""
- /usr/bin/psql -h localhost -d template1 -U postgres -c "CREATE USER ${DSPAM_PgSQL_USER} WITH PASSWORD '${DSPAM_PgSQL_PWD}' NOCREATEDB NOCREATEUSER; CREATE DATABASE ${DSPAM_PgSQL_DB}; GRANT ALL PRIVILEGES ON DATABASE ${DSPAM_PgSQL_DB} TO ${DSPAM_PgSQL_USER}; GRANT ALL PRIVILEGES ON SCHEMA public TO ${DSPAM_PgSQL_USER}; UPDATE pg_database SET datdba=(SELECT usesysid FROM pg_shadow WHERE usename='${DSPAM_PgSQL_USER}') WHERE datname='${DSPAM_PgSQL_DB}';"
-
- einfo "Creating DSPAM PostgreSQL tables"
- PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_objects.sql 1>/dev/null 2>&1
-
- if use virtual-users ; then
- einfo "Creating DSPAM PostgreSQL database for virtual-users users"
- PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_virtual-users.sql 1>/dev/null 2>&1
- fi
- elif use oci8 ; then
- einfo "We have not enought Oracle knowledge to configure Oracle"
- einfo "automatically. If you know how, please post a message in"
- einfo "Gentoo Bugzilla."
- einfo
- einfo "You need manually to create the Oracle user for DSPAM and"
- einfo "the necessary database."
- einfo "But the DSPAM configuration file dspam.conf and oracle.data"
- einfo "was already configured with the necessary information to"
- einfo "access the database."
- einfo "Please read your dspam.conf, oracle.data and the README for"
- einfo "more info on how to setup DSPAM with Oracle."
- einfo "objects for each user upon first use of DSPAM by that user."
- fi
-
-}
diff --git a/mail-filter/dspam/dspam-3.6.3.ebuild b/mail-filter/dspam/dspam-3.6.3.ebuild
deleted file mode 100644
index 949ea119a4eb..000000000000
--- a/mail-filter/dspam/dspam-3.6.3.ebuild
+++ /dev/null
@@ -1,481 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.6.3.ebuild,v 1.1 2006/01/20 08:23:21 st_lim Exp $
-
-inherit eutils
-
-DESCRIPTION="A statistical-algorithmic hybrid anti-spam filter"
-SRC_URI="http://dspam.nuclearelephant.com/sources/${P}.tar.gz
- http://dspam.nuclearelephant.com/sources/extras/dspam_sa_trainer.tar.gz"
-HOMEPAGE="http://dspam.nuclearelephant.com/"
-LICENSE="GPL-2"
-
-IUSE="berkdb clamav debug large-domain logrotate mysql neural oci8 postgres sqlite sqlite3 virtual-users user-homedirs"
-DEPEND="clamav? ( >=app-antivirus/clamav-0.86 )
- mysql? ( >=dev-db/mysql-3.23 )
- sqlite? ( <dev-db/sqlite-3 )
- sqlite3? ( =dev-db/sqlite-3* )
- postgres? ( >=dev-db/postgresql-7.4.3 )
- berkdb? ( >=sys-libs/db-4.0 )
- "
-RDEPEND="sys-process/cronbase
- clamav? ( >=app-antivirus/clamav-0.86 )
- mysql? ( >=dev-db/mysql-3.23 )
- sqlite? ( <dev-db/sqlite-3 )
- sqlite3? ( =dev-db/sqlite-3* )
- postgres? ( >=dev-db/postgresql-7.4.3 )
- berkdb? ( >=sys-libs/db-4.0 )
- logrotate? ( app-admin/logrotate )"
-KEYWORDS="~x86 ~ppc ~alpha ~amd64"
-SLOT="0"
-
-# some FHS-like structure
-HOMEDIR="/var/spool/dspam"
-CONFDIR="/etc/mail/dspam"
-LOGDIR="/var/log/dspam"
-
-pkg_setup() {
- local multiple_dbs="0"
- local supported_dbs="berkdb mysql postgres oci8 sqlite sqlite3"
- for foo in ${supported_dbs}; do
- if use ${foo}; then
- let multiple_dbs="((multiple_dbs + 1 ))"
- einfo " ${foo} database support in your USE flags."
- fi
- done
- if [ "${multiple_dbs}" -ge "2" ]; then
- echo
- ewarn "You have multiple database backends active in your USE flags."
- ewarn "Will default to MySQL as your dspam database backend."
- ewarn "If you want to build with another database backend; hit Control-C now."
- ewarn "Change your USE flag -mysql and emerge again."
- echo
- has_version ">=sys-apps/portage-2.0.50" && (
- einfo "It would be best practice to add the set of USE flags that you use for this"
- einfo "package to the file: /etc/portage/package.use. Example:"
- einfo "\`echo \"mail-filter/dspam -mysql postgres -oci8 -sqlite -sqlite3\" >> /etc/portage/package.use\`"
- einfo "to build dspam with Postgres database as your dspam backend."
- )
- elif [ "${multiple_dbs}" -eq "0" ]; then
- echo
- ewarn "You did not select any SQL based database backend."
- ewarn "DSPAM will use self-contained Hash driver for storing data."
- ewarn "If you don't want that, then enable one of the following"
- ewarn "USE flags: ${supported_dbs}"
- fi
- has_version ">sys-kernel/linux-headers-2.6" || (
- einfo "To use the new DSPAM deamon mode, you need to emerge"
- einfo ">sys-kernel/linux-headers-2.6 and rebuild glibc to support NPTL"
- )
- if use virtual-users && use user-homedirs ; then
- ewarn "If the users are virtual, then they probably should not have home directories."
- fi
- if use user-homedirs ; then
- ewarn "WARNING: dspam-web will not work with user-homedirs. Disable this USE flag"
- ewarn "if you intend on using dspam-web."
- fi
- id dspam 2>/dev/null || enewgroup dspam 26
- id dspam 2>/dev/null || enewuser dspam 26 /bin/bash ${HOMEDIR} dspam
-}
-
-src_compile() {
- local myconf
-
- myconf="${myconf} --enable-long-username"
- myconf="${myconf} --with-delivery-agent=/usr/bin/procmail"
- use large-domain && myconf="${myconf} --enable-large-scale" ||\
- myconf="${myconf} --enable-domain-scale"
-
- myconf="${myconf} --with-dspam-home=${HOMEDIR}"
- myconf="${myconf} --sysconfdir=${CONFDIR}"
- use user-homedirs && myconf="${myconf} --enable-homedir"
- use clamav && myconf="${myconf} --enable-clamav"
-
- # enables support for debugging (touch /etc/dspam/.debug to turn on)
- # optional: even MORE debugging output, use with extreme caution!
- use debug && myconf="${myconf} --enable-debug --enable-verbose-debug"
-
- # select storage driver
- if use sqlite ; then
- myconf="${myconf} --with-storage-driver=sqlite_drv"
- myconf="${myconf} --enable-virtual-users"
- elif use sqlite3 ; then
- myconf="${myconf} --with-storage-driver=sqlite3_drv"
- myconf="${myconf} --enable-virtual-users"
- elif use mysql; then
- myconf="${myconf} --with-storage-driver=mysql_drv"
- myconf="${myconf} --with-mysql-includes=/usr/include/mysql"
- myconf="${myconf} --with-mysql-libraries=/usr/lib/mysql"
- myconf="${myconf} --enable-preferences-extension"
-
- if has_version ">sys-kernel/linux-headers-2.6"; then
- myconf="${myconf} --enable-daemon"
- fi
-
- use virtual-users && myconf="${myconf} --enable-virtual-users"
- # an experimental feature available with MySQL and PgSQL backend
- use neural && myconf="${myconf} --enable-neural-networking"
- elif use postgres ; then
- myconf="${myconf} --with-storage-driver=pgsql_drv"
- myconf="${myconf} --with-pgsql-includes=/usr/include/postgresql"
- myconf="${myconf} --with-pgsql-libraries=/usr/lib/postgresql"
- myconf="${myconf} --enable-preferences-extension"
-
- if has_version ">sys-kernel/linux-headers-2.6"; then
- myconf="${myconf} --enable-daemon"
- fi
-
- use virtual-users && myconf="${myconf} --enable-virtual-users"
- # an experimental feature available with MySQL and PgSQL backend
- use neural && myconf="${myconf} --enable-neural-networking"
- elif use oci8 ; then
- myconf="${myconf} --with-storage-driver=ora_drv"
- myconf="${myconf} --with-oracle-home=${ORACLE_HOME}"
- myconf="${myconf} --enable-virtual-users"
-
- # I am in no way a Oracle specialist. If someone knows
- # how to query the version of Oracle, then let me know.
- if (expr ${ORACLE_HOME/*\/} : 10 1>/dev/null 2>&1); then
- myconf="${myconf} --with-oracle-version=10"
- fi
- elif use berkdb ; then
- myconf="${myconf} --with-storage-driver=libdb4_drv"
- else
- myconf="${myconf} --with-storage-driver=hash_drv"
- fi
-
- econf ${myconf} || die
- emake || die
-}
-
-src_install () {
-
- # Fix issues with older dspam configuration
- CONFIG_PROTECT="${CONFIG_PROTECT} ${HOMEDIR} ${CONFDIR} /var/run/dspam"
- CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${HOMEDIR}/}"
- CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${CONFDIR}/}"
-
- # open up perms on $HOMEDIR
- diropts -m0775 -o dspam -g dspam
- dodir ${HOMEDIR}
- keepdir ${HOMEDIR}
-
- # keeps dspam data in $CONFDIR
- diropts -m0775 -o dspam -g dspam
- dodir ${CONFDIR}
- keepdir ${CONFDIR}
-
- # make install
- make DESTDIR=${D} install || die
- chmod o+s ${D}/usr/bin/dspam
- chmod o+s ${D}/usr/bin/dspam_stats
-
- # documentation
- dodoc CHANGELOG LICENSE README* RELEASE.NOTES UPGRADING
- dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
- docinto doc
- dodoc doc/*.txt
- docinto gentoo
- dodoc ${FILESDIR}/README.postfix ${FILESDIR}/README.qmail
- if use sqlite; then
- dodoc src/tools.sqlite_drv/README
- elif use mysql; then
- dodoc src/tools.mysql_drv/README
- elif use postgres ; then
- dodoc src/tools.pgsql_drv/README
- elif use oci8 ; then
- dodoc src/tools.ora_drv/README
- fi
- doman man/dspam*
- dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
-
- # build some initial configuration data
- [ ! -f ${CONFDIR}/dspam.conf ] \
- && cp src/dspam.conf ${T}/dspam.conf
-
- if use mysql || use postgres; then
- if has_version ">sys-kernel/linux-headers-2.6"; then
- # keeps dspam socket for deamon in /var/run/dspam
- diropts -m0775 -o dspam -g dspam
- dodir /var/run/dspam
- keepdir /var/run/dspam
-
- # We use sockets for the deamon instead of tcp port 24
- sed -e 's:^#*\(ServerDomainSocketPath[\t ]\{1,\}\).*:\1\"/var/run/dspam/dspam.sock\":gI' \
- -e 's:^#*\(ServerPID[\t ]\{1,\}\).*:\1/var/run/dspam/dspam.pid:gI' \
- -i ${T}/dspam.conf
-
- # dspam init script
- exeinto /etc/init.d
- exeopts -m0755 -o root -g root
- newexe ${FILESDIR}/dspam.rc dspam
- fi
- fi
-
- # generate random password
- local PASSWORD="${RANDOM}${RANDOM}${RANDOM}${RANDOM}"
-
- # database related configuration and scripts
- if use sqlite; then
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- newins src/tools.sqlite_drv/purge-2.sql sqlite_purge.sql
- elif use sqlite3; then
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- newins src/tools.sqlite_drv/purge-3.sql sqlite3_purge.sql
- elif use mysql; then
- # Use existing configuration if possible
- if [[ -f ${ROOT}${CONFDIR}/mysql.data ]]; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="/var/run/mysqld/mysqld.sock"
- DSPAM_DB_DATA[1]=""
- DSPAM_DB_DATA[2]="dspam"
- DSPAM_DB_DATA[3]="${PASSWORD}"
- DSPAM_DB_DATA[4]="dspam"
- DSPAM_DB_DATA[5]="true"
- fi
-
- # Modify configuration and create mysql.data file
- sed -e "s:^#*\(MySQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^#*\(MySQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^#*\(MySQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^#*\(MySQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
- -e "s:^#*\(MySQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
- -e "s:^#*\(MySQLCompress[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[5]}:gI" \
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/mysql.data
- done
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/mysql.data
- newins src/tools.mysql_drv/mysql_objects-space.sql mysql_objects-space.sql
- newins src/tools.mysql_drv/mysql_objects-speed.sql mysql_objects-speed.sql
- newins src/tools.mysql_drv/mysql_objects-4.1.sql mysql_objects-4.1.sql
- newins src/tools.mysql_drv/virtual_users.sql mysql_virtual_users.sql
- newins src/tools.mysql_drv/neural.sql mysql_neural.sql
- newins src/tools.mysql_drv/purge.sql mysql_purge.sql
- newins src/tools.mysql_drv/purge-4.1.sql mysql_purge-4.1.sql
-
- elif use postgres ; then
- # Use existing configuration if possible
- if [ -f ${ROOT}${CONFDIR}/pgsql.data ]; then
- DSPAM_DB_DATA=( $(cat "${ROOT}${CONFDIR}/pgsql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="127.0.0.1"
- DSPAM_DB_DATA[1]="5432"
- DSPAM_DB_DATA[2]="dspam"
- DSPAM_DB_DATA[3]="${PASSWORD}"
- DSPAM_DB_DATA[4]="dspam"
- fi
-
- # Modify configuration and create pgsql.data file
- sed -e "s:^#*\(PgSQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^#*\(PgSQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^#*\(PgSQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^#*\(PgSQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
- -e "s:^#*\(PgSQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
- -e "s:^#*\(PgSQLConnectionCache[\t ]*.\):\1:gI" \
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/pgsql.data
- done
-
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/pgsql.data
- newins src/tools.pgsql_drv/pgsql_objects.sql pgsql_objects.sql
- newins src/tools.pgsql_drv/virtual_users.sql pgsql_virtual_users.sql
- newins src/tools.pgsql_drv/purge.sql pgsql_purge.sql
-
- elif use oci8 ; then
- # Use existing configuration if possible
- if [ -f ${ROOT}${CONFDIR}/oracle.data ]; then
- DSPAM_DB_DATA=( $(cat "${ROOT}${CONFDIR}/oracle.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=PROD)))"
- DSPAM_DB_DATA[1]="dspam"
- DSPAM_DB_DATA[2]="${PASSWORD}"
- DSPAM_DB_DATA[3]="dspam"
- fi
-
- # Modify configuration and create oracle.data file
- sed -e "s:^#*\(OraServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^\(OraUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^\(OraPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^\(OraSchema[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI"\
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/oracle.data
- done
-
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/oracle.data
- newins src/tools.ora_drv/oral_objects.sql ora_objects.sql
- newins src/tools.ora_drv/virtual_users.sql ora_virtual_users.sql
- newins src/tools.ora_drv/purge.sql ora_purge.sql
- fi
-
- sed -e "s:^\(Purge.*\):###\1:g" \
- -e "s:^#\(Purge.*\):\1:g" \
- -e "s:^###\(Purge.*\):#\1:g" \
- -i ${T}/dspam.conf
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/dspam.conf
-
- # installs the notification messages
- # -> The documentation is wrong! The files need to be in ./txt
- diropts -m0775 -o dspam -g dspam
- dodir ${CONFDIR}/txt
- keepdir ${CONFDIR}/txt
- insinto ${CONFDIR}/txt
- insopts -m644 -o dspam -g dspam
- doins ${S}/txt/*.txt
-
- # Create the opt-in / opt-out directories
- diropts -m0775 -o dspam -g dspam
- dodir ${CONFDIR}/opt-in
- keepdir ${CONFDIR}/opt-in
- dodir ${CONFDIR}/opt-out
- keepdir ${CONFDIR}/opt-out
-
- # logrotation scripts
- diropts -m0755 -o dspam -g dspam
- dodir /etc/logrotate.d
- keepdir /etc/logrotate.d
- insinto /etc/logrotate.d
- insopts -m0644 -o dspam -g dspam
- newins ${FILESDIR}/logrotate.dspam dspam
-
- # dspam cron job
- diropts -m0755 -o dspam -g dspam
- dodir /etc/cron.daily
- keepdir /etc/cron.daily
- exeinto /etc/cron.daily
- exeopts -m0755 -o dspam -g dspam
- doexe ${FILESDIR}/dspam.cron
-
- # dspam enviroment
- echo -ne "CONFIG_PROTECT=\"${CONFDIR} /var/run/dspam\"\n\n" > ${T}/40dspam
- doenvd ${T}/40dspam || die
-}
-
-pkg_postinst() {
- env-update
- if use mysql || use postgres || use oci8; then
- echo
- einfo "To setup DSPAM to run out-of-the-box on your system with a MySQL,"
- einfo "PostgreSQL or Oracle database, run:"
- einfo "emerge --config ${PF}"
- fi
- if use mysql || use postgres; then
- if has_version ">sys-kernel/linux-headers-2.6"; then
- einfo "If you want to run DSPAM in the new deamon mode. Remember"
- einfo "to make the DSPAM daemon start durig boot:"
- einfo " rc-update add dspam default"
- fi
- fi
- if use exim ; then
- echo
- einfo "To use dspam in conjunction with your exim system, you should read the README"
- fi
-}
-
-pkg_config () {
- if use sqlite ; then
- einfo "sqlite_drv will automatically create the necessary database"
- elif use mysql ; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- DSPAM_MySQL_USER="${DSPAM_DB_DATA[2]}"
- DSPAM_MySQL_PWD="${DSPAM_DB_DATA[3]}"
- DSPAM_MySQL_DB="${DSPAM_DB_DATA[4]}"
-
- ewarn "When prompted for a password, please enter your MySQL root password"
- ewarn
-
- einfo "Creating DSPAM MySQL database \"${DSPAM_MySQL_DB}\""
- /usr/bin/mysqladmin -u root -p create ${DSPAM_MySQL_DB}
-
- einfo "Creating DSPAM MySQL tables for data objects"
- einfo " Please select what kind of object database you like to use."
- einfo " [1] Space optimized database"
- einfo " [2] Speed optimized database"
- einfo
- while true
- do
- read -n 1 -s -p " Press 1 or 2 on the keyboard to select database" DSPAM_MySQL_DB_Type
- [[ "${DSPAM_MySQL_DB_Type}" == "1" || "${DSPAM_MySQL_DB_Type}" == "2" ]] && echo && break
- done
-
- if [ "${DSPAM_MySQL_DB_Type}" == "1" ]
- then
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-space.sql
- else
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-speed.sql
- fi
-
- if use virtual-users ; then
- einfo "Creating DSPAM MySQL database for virtual-users users"
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_virtual_users.sql
- fi
-
- if use neural ; then
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_neural.sql
- fi
-
- einfo "Creating DSPAM MySQL user \"${DSPAM_MySQL_USER}\""
- /usr/bin/mysql -u root -p -e "GRANT SELECT,INSERT,UPDATE,DELETE ON ${DSPAM_MySQL_DB}.* TO ${DSPAM_MySQL_USER}@localhost IDENTIFIED BY '${DSPAM_MySQL_PWD}';FLUSH PRIVILEGES;" -D mysql
- elif use postgres ; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/pgsql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- DSPAM_PgSQL_USER="${DSPAM_DB_DATA[2]}"
- DSPAM_PgSQL_PWD="${DSPAM_DB_DATA[3]}"
- DSPAM_PgSQL_DB="${DSPAM_DB_DATA[4]}"
-
- ewarn "When prompted for a password, please enter your PgSQL postgres password"
- ewarn
-
- einfo "Creating DSPAM PostgreSQL database \"${DSPAM_PgSQL_DB}\" and user \"${DSPAM_PgSQL_USER}\""
- /usr/bin/psql -h localhost -d template1 -U postgres -c "CREATE USER ${DSPAM_PgSQL_USER} WITH PASSWORD '${DSPAM_PgSQL_PWD}' NOCREATEDB NOCREATEUSER; CREATE DATABASE ${DSPAM_PgSQL_DB}; GRANT ALL PRIVILEGES ON DATABASE ${DSPAM_PgSQL_DB} TO ${DSPAM_PgSQL_USER}; GRANT ALL PRIVILEGES ON SCHEMA public TO ${DSPAM_PgSQL_USER}; UPDATE pg_database SET datdba=(SELECT usesysid FROM pg_shadow WHERE usename='${DSPAM_PgSQL_USER}') WHERE datname='${DSPAM_PgSQL_DB}';"
-
- einfo "Creating DSPAM PostgreSQL tables"
- PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_objects.sql 1>/dev/null 2>&1
-
- if use virtual-users ; then
- einfo "Creating DSPAM PostgreSQL database for virtual-users users"
- PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_virtual-users.sql 1>/dev/null 2>&1
- fi
- elif use oci8 ; then
- einfo "We have not enought Oracle knowledge to configure Oracle"
- einfo "automatically. If you know how, please post a message in"
- einfo "Gentoo Bugzilla."
- einfo
- einfo "You need manually to create the Oracle user for DSPAM and"
- einfo "the necessary database."
- einfo "But the DSPAM configuration file dspam.conf and oracle.data"
- einfo "was already configured with the necessary information to"
- einfo "access the database."
- einfo "Please read your dspam.conf, oracle.data and the README for"
- einfo "more info on how to setup DSPAM with Oracle."
- einfo "objects for each user upon first use of DSPAM by that user."
- fi
-
-}
diff --git a/mail-filter/dspam/dspam-3.6.4.ebuild b/mail-filter/dspam/dspam-3.6.4.ebuild
deleted file mode 100644
index 0211d95c9086..000000000000
--- a/mail-filter/dspam/dspam-3.6.4.ebuild
+++ /dev/null
@@ -1,474 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.6.4.ebuild,v 1.1 2006/02/13 15:59:26 st_lim Exp $
-
-inherit eutils
-
-DESCRIPTION="A statistical-algorithmic hybrid anti-spam filter"
-SRC_URI="http://dspam.nuclearelephant.com/sources/${P}.tar.gz
- http://dspam.nuclearelephant.com/sources/extras/dspam_sa_trainer.tar.gz"
-HOMEPAGE="http://dspam.nuclearelephant.com/"
-LICENSE="GPL-2"
-
-IUSE="berkdb clamav debug large-domain ldap logrotate mysql oci8 postgres sqlite sqlite3 virtual-users user-homedirs"
-DEPEND="berkdb? ( >=sys-libs/db-4.0 )
- clamav? ( >=app-antivirus/clamav-0.86 )
- ldap? ( >=net-nds/openldap-2.2 )
- mysql? ( >=dev-db/mysql-3.23 )
- postgres? ( >=dev-db/postgresql-7.4.3 )
- sqlite? ( <dev-db/sqlite-3 )
- sqlite3? ( =dev-db/sqlite-3* )
- "
-RDEPEND="sys-process/cronbase
- berkdb? ( >=sys-libs/db-4.0 )
- clamav? ( >=app-antivirus/clamav-0.86 )
- logrotate? ( app-admin/logrotate )
- mysql? ( >=dev-db/mysql-3.23 )
- postgres? ( >=dev-db/postgresql-7.4.3 )
- sqlite? ( <dev-db/sqlite-3 )
- sqlite3? ( =dev-db/sqlite-3* )"
-KEYWORDS="~x86 ~ppc ~alpha ~amd64"
-SLOT="0"
-
-# some FHS-like structure
-HOMEDIR="/var/spool/dspam"
-CONFDIR="/etc/mail/dspam"
-LOGDIR="/var/log/dspam"
-
-pkg_setup() {
- local multiple_dbs="0"
- local supported_dbs="berkdb mysql postgres oci8 sqlite sqlite3"
- for foo in ${supported_dbs}; do
- if use ${foo}; then
- let multiple_dbs="((multiple_dbs + 1 ))"
- einfo " ${foo} database support in your USE flags."
- fi
- done
- if [ "${multiple_dbs}" -ge "2" ]; then
- echo
- ewarn "You have multiple database backends active in your USE flags."
- ewarn "Will default to MySQL as your dspam database backend."
- ewarn "If you want to build with another database backend; hit Control-C now."
- ewarn "Change your USE flag -mysql and emerge again."
- echo
- has_version ">=sys-apps/portage-2.0.50" && (
- einfo "It would be best practice to add the set of USE flags that you use for this"
- einfo "package to the file: /etc/portage/package.use. Example:"
- einfo "\`echo \"mail-filter/dspam -mysql postgres -oci8 -sqlite -sqlite3\" >> /etc/portage/package.use\`"
- einfo "to build dspam with Postgres database as your dspam backend."
- )
- elif [ "${multiple_dbs}" -eq "0" ]; then
- echo
- ewarn "You did not select any SQL based database backend."
- ewarn "DSPAM will use self-contained Hash driver for storing data."
- ewarn "If you don't want that, then enable one of the following"
- ewarn "USE flags: ${supported_dbs}"
- fi
- has_version ">sys-kernel/linux-headers-2.6" || (
- einfo "To use the new DSPAM deamon mode, you need to emerge"
- einfo ">sys-kernel/linux-headers-2.6 and rebuild glibc to support NPTL"
- )
- if use virtual-users && use user-homedirs ; then
- ewarn "If the users are virtual, then they probably should not have home directories."
- fi
- if use user-homedirs ; then
- ewarn "WARNING: dspam-web will not work with user-homedirs. Disable this USE flag"
- ewarn "if you intend on using dspam-web."
- fi
- id dspam 2>/dev/null || enewgroup dspam 26
- id dspam 2>/dev/null || enewuser dspam 26 /bin/bash ${HOMEDIR} dspam
-}
-
-src_compile() {
- local myconf
-
- myconf="${myconf} --enable-long-username"
- myconf="${myconf} --with-delivery-agent=/usr/bin/procmail"
- use large-domain && myconf="${myconf} --enable-large-scale" ||\
- myconf="${myconf} --enable-domain-scale"
-
- myconf="${myconf} --with-dspam-home=${HOMEDIR}"
- myconf="${myconf} --sysconfdir=${CONFDIR}"
- use user-homedirs && myconf="${myconf} --enable-homedir"
- use clamav && myconf="${myconf} --enable-clamav"
- use ldap && myconf="${myconf} --enable-ldap"
-
- # enables support for debugging (touch /etc/dspam/.debug to turn on)
- # optional: even MORE debugging output, use with extreme caution!
- use debug && myconf="${myconf} --enable-debug --enable-verbose-debug --enable-bnr-debug"
-
- # select storage driver
- if use sqlite ; then
- myconf="${myconf} --with-storage-driver=sqlite_drv"
- myconf="${myconf} --enable-virtual-users"
- elif use sqlite3 ; then
- myconf="${myconf} --with-storage-driver=sqlite3_drv"
- myconf="${myconf} --enable-virtual-users"
- elif use mysql; then
- myconf="${myconf} --with-storage-driver=mysql_drv"
- myconf="${myconf} --with-mysql-includes=/usr/include/mysql"
- myconf="${myconf} --with-mysql-libraries=/usr/lib/mysql"
- myconf="${myconf} --enable-preferences-extension"
-
- if has_version ">sys-kernel/linux-headers-2.6"; then
- myconf="${myconf} --enable-daemon"
- fi
-
- use virtual-users && myconf="${myconf} --enable-virtual-users"
- elif use postgres ; then
- myconf="${myconf} --with-storage-driver=pgsql_drv"
- myconf="${myconf} --with-pgsql-includes=/usr/include/postgresql"
- myconf="${myconf} --with-pgsql-libraries=/usr/lib/postgresql"
- myconf="${myconf} --enable-preferences-extension"
-
- if has_version ">sys-kernel/linux-headers-2.6"; then
- myconf="${myconf} --enable-daemon"
- fi
-
- use virtual-users && myconf="${myconf} --enable-virtual-users"
- elif use oci8 ; then
- myconf="${myconf} --with-storage-driver=ora_drv"
- myconf="${myconf} --with-oracle-home=${ORACLE_HOME}"
- myconf="${myconf} --enable-virtual-users"
-
- # I am in no way a Oracle specialist. If someone knows
- # how to query the version of Oracle, then let me know.
- if (expr ${ORACLE_HOME/*\/} : 10 1>/dev/null 2>&1); then
- myconf="${myconf} --with-oracle-version=10"
- fi
- elif use berkdb ; then
- myconf="${myconf} --with-storage-driver=libdb4_drv"
- else
- myconf="${myconf} --with-storage-driver=hash_drv"
- fi
-
- econf ${myconf} || die
- emake || die
-}
-
-src_install () {
-
- # Fix issues with older dspam configuration
- CONFIG_PROTECT="${CONFIG_PROTECT} ${HOMEDIR} ${CONFDIR} /var/run/dspam"
- CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${HOMEDIR}/}"
- CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${CONFDIR}/}"
-
- # open up perms on $HOMEDIR
- diropts -m0775 -o dspam -g dspam
- dodir ${HOMEDIR}
- keepdir ${HOMEDIR}
-
- # keeps dspam data in $CONFDIR
- diropts -m0775 -o dspam -g dspam
- dodir ${CONFDIR}
- keepdir ${CONFDIR}
-
- # make install
- make DESTDIR=${D} install || die
- chmod o+s ${D}/usr/bin/dspam
- chmod o+s ${D}/usr/bin/dspam_stats
-
- # documentation
- dodoc CHANGELOG LICENSE README* RELEASE.NOTES UPGRADING
- dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
- docinto doc
- dodoc doc/*.txt
- docinto gentoo
- dodoc ${FILESDIR}/README.postfix ${FILESDIR}/README.qmail
- if use sqlite; then
- dodoc src/tools.sqlite_drv/README
- elif use mysql; then
- dodoc src/tools.mysql_drv/README
- elif use postgres ; then
- dodoc src/tools.pgsql_drv/README
- elif use oci8 ; then
- dodoc src/tools.ora_drv/README
- fi
- doman man/dspam*
- dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
-
- # build some initial configuration data
- [ ! -f ${CONFDIR}/dspam.conf ] \
- && cp src/dspam.conf ${T}/dspam.conf
-
- if use mysql || use postgres; then
- if has_version ">sys-kernel/linux-headers-2.6"; then
- # keeps dspam socket for deamon in /var/run/dspam
- diropts -m0775 -o dspam -g dspam
- dodir /var/run/dspam
- keepdir /var/run/dspam
-
- # We use sockets for the deamon instead of tcp port 24
- sed -e 's:^#*\(ServerDomainSocketPath[\t ]\{1,\}\).*:\1\"/var/run/dspam/dspam.sock\":gI' \
- -e 's:^#*\(ServerPID[\t ]\{1,\}\).*:\1/var/run/dspam/dspam.pid:gI' \
- -i ${T}/dspam.conf
-
- # dspam init script
- exeinto /etc/init.d
- exeopts -m0755 -o root -g root
- newexe ${FILESDIR}/dspam.rc dspam
- fi
- fi
-
- # generate random password
- local PASSWORD="${RANDOM}${RANDOM}${RANDOM}${RANDOM}"
-
- # database related configuration and scripts
- if use sqlite; then
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- newins src/tools.sqlite_drv/purge-2.sql sqlite_purge.sql
- elif use sqlite3; then
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- newins src/tools.sqlite_drv/purge-3.sql sqlite3_purge.sql
- elif use mysql; then
- # Use existing configuration if possible
- if [[ -f ${ROOT}${CONFDIR}/mysql.data ]]; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="/var/run/mysqld/mysqld.sock"
- DSPAM_DB_DATA[1]=""
- DSPAM_DB_DATA[2]="dspam"
- DSPAM_DB_DATA[3]="${PASSWORD}"
- DSPAM_DB_DATA[4]="dspam"
- DSPAM_DB_DATA[5]="true"
- fi
-
- # Modify configuration and create mysql.data file
- sed -e "s:^#*\(MySQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^#*\(MySQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^#*\(MySQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^#*\(MySQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
- -e "s:^#*\(MySQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
- -e "s:^#*\(MySQLCompress[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[5]}:gI" \
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/mysql.data
- done
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/mysql.data
- newins src/tools.mysql_drv/mysql_objects-space.sql mysql_objects-space.sql
- newins src/tools.mysql_drv/mysql_objects-speed.sql mysql_objects-speed.sql
- newins src/tools.mysql_drv/mysql_objects-4.1.sql mysql_objects-4.1.sql
- newins src/tools.mysql_drv/virtual_users.sql mysql_virtual_users.sql
- newins src/tools.mysql_drv/purge.sql mysql_purge.sql
- newins src/tools.mysql_drv/purge-4.1.sql mysql_purge-4.1.sql
-
- elif use postgres ; then
- # Use existing configuration if possible
- if [ -f ${ROOT}${CONFDIR}/pgsql.data ]; then
- DSPAM_DB_DATA=( $(cat "${ROOT}${CONFDIR}/pgsql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="127.0.0.1"
- DSPAM_DB_DATA[1]="5432"
- DSPAM_DB_DATA[2]="dspam"
- DSPAM_DB_DATA[3]="${PASSWORD}"
- DSPAM_DB_DATA[4]="dspam"
- fi
-
- # Modify configuration and create pgsql.data file
- sed -e "s:^#*\(PgSQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^#*\(PgSQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^#*\(PgSQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^#*\(PgSQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
- -e "s:^#*\(PgSQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
- -e "s:^#*\(PgSQLConnectionCache[\t ]*.\):\1:gI" \
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/pgsql.data
- done
-
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/pgsql.data
- newins src/tools.pgsql_drv/pgsql_objects.sql pgsql_objects.sql
- newins src/tools.pgsql_drv/virtual_users.sql pgsql_virtual_users.sql
- newins src/tools.pgsql_drv/purge.sql pgsql_purge.sql
-
- elif use oci8 ; then
- # Use existing configuration if possible
- if [ -f ${ROOT}${CONFDIR}/oracle.data ]; then
- DSPAM_DB_DATA=( $(cat "${ROOT}${CONFDIR}/oracle.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=PROD)))"
- DSPAM_DB_DATA[1]="dspam"
- DSPAM_DB_DATA[2]="${PASSWORD}"
- DSPAM_DB_DATA[3]="dspam"
- fi
-
- # Modify configuration and create oracle.data file
- sed -e "s:^#*\(OraServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^\(OraUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^\(OraPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^\(OraSchema[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI"\
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/oracle.data
- done
-
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/oracle.data
- newins src/tools.ora_drv/oral_objects.sql ora_objects.sql
- newins src/tools.ora_drv/virtual_users.sql ora_virtual_users.sql
- newins src/tools.ora_drv/purge.sql ora_purge.sql
- fi
-
- sed -e "s:^\(Purge.*\):###\1:g" \
- -e "s:^#\(Purge.*\):\1:g" \
- -e "s:^###\(Purge.*\):#\1:g" \
- -i ${T}/dspam.conf
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/dspam.conf
-
- # installs the notification messages
- # -> The documentation is wrong! The files need to be in ./txt
- diropts -m0775 -o dspam -g dspam
- dodir ${HOMEDIR}/txt
- keepdir ${HOMEDIR}/txt
- insinto ${HOMEDIR}/txt
- insopts -m644 -o dspam -g dspam
- doins ${S}/txt/*.txt
-
- # Create the opt-in / opt-out directories
- diropts -m0775 -o dspam -g dspam
- dodir ${HOMEDIR}/opt-in
- keepdir ${HOMEDIR}/opt-in
- dodir ${HOMEDIR}/opt-out
- keepdir ${HOMEDIR}/opt-out
-
- # logrotation scripts
- diropts -m0755 -o dspam -g dspam
- dodir /etc/logrotate.d
- keepdir /etc/logrotate.d
- insinto /etc/logrotate.d
- insopts -m0644 -o dspam -g dspam
- newins ${FILESDIR}/logrotate.dspam dspam
-
- # dspam cron job
- diropts -m0755 -o dspam -g dspam
- dodir /etc/cron.daily
- keepdir /etc/cron.daily
- exeinto /etc/cron.daily
- exeopts -m0755 -o dspam -g dspam
- doexe ${FILESDIR}/dspam.cron
-
- # dspam enviroment
- echo -ne "CONFIG_PROTECT=\"${CONFDIR} /var/run/dspam\"\n\n" > ${T}/40dspam
- doenvd ${T}/40dspam || die
-}
-
-pkg_postinst() {
- env-update
- if use mysql || use postgres || use oci8; then
- echo
- einfo "To setup DSPAM to run out-of-the-box on your system with a MySQL,"
- einfo "PostgreSQL or Oracle database, run:"
- einfo "emerge --config ${PF}"
- fi
- if use mysql || use postgres; then
- if has_version ">sys-kernel/linux-headers-2.6"; then
- einfo "If you want to run DSPAM in the new deamon mode. Remember"
- einfo "to make the DSPAM daemon start durig boot:"
- einfo " rc-update add dspam default"
- fi
- fi
- if use exim ; then
- echo
- einfo "To use dspam in conjunction with your exim system, you should read the README"
- fi
-}
-
-pkg_config () {
- if use sqlite ; then
- einfo "sqlite_drv will automatically create the necessary database"
- elif use mysql ; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- DSPAM_MySQL_USER="${DSPAM_DB_DATA[2]}"
- DSPAM_MySQL_PWD="${DSPAM_DB_DATA[3]}"
- DSPAM_MySQL_DB="${DSPAM_DB_DATA[4]}"
-
- ewarn "When prompted for a password, please enter your MySQL root password"
- ewarn
-
- einfo "Creating DSPAM MySQL database \"${DSPAM_MySQL_DB}\""
- /usr/bin/mysqladmin -u root -p create ${DSPAM_MySQL_DB}
-
- einfo "Creating DSPAM MySQL tables for data objects"
- einfo " Please select what kind of object database you like to use."
- einfo " [1] Space optimized database"
- einfo " [2] Speed optimized database"
- einfo
- while true
- do
- read -n 1 -s -p " Press 1 or 2 on the keyboard to select database" DSPAM_MySQL_DB_Type
- [[ "${DSPAM_MySQL_DB_Type}" == "1" || "${DSPAM_MySQL_DB_Type}" == "2" ]] && echo && break
- done
-
- if [ "${DSPAM_MySQL_DB_Type}" == "1" ]
- then
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-space.sql
- else
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-speed.sql
- fi
-
- if use virtual-users ; then
- einfo "Creating DSPAM MySQL database for virtual-users users"
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_virtual_users.sql
- fi
-
- einfo "Creating DSPAM MySQL user \"${DSPAM_MySQL_USER}\""
- /usr/bin/mysql -u root -p -e "GRANT SELECT,INSERT,UPDATE,DELETE ON ${DSPAM_MySQL_DB}.* TO ${DSPAM_MySQL_USER}@localhost IDENTIFIED BY '${DSPAM_MySQL_PWD}';FLUSH PRIVILEGES;" -D mysql
- elif use postgres ; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/pgsql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- DSPAM_PgSQL_USER="${DSPAM_DB_DATA[2]}"
- DSPAM_PgSQL_PWD="${DSPAM_DB_DATA[3]}"
- DSPAM_PgSQL_DB="${DSPAM_DB_DATA[4]}"
-
- ewarn "When prompted for a password, please enter your PgSQL postgres password"
- ewarn
-
- einfo "Creating DSPAM PostgreSQL database \"${DSPAM_PgSQL_DB}\" and user \"${DSPAM_PgSQL_USER}\""
- /usr/bin/psql -h localhost -d template1 -U postgres -c "CREATE USER ${DSPAM_PgSQL_USER} WITH PASSWORD '${DSPAM_PgSQL_PWD}' NOCREATEDB NOCREATEUSER; CREATE DATABASE ${DSPAM_PgSQL_DB}; GRANT ALL PRIVILEGES ON DATABASE ${DSPAM_PgSQL_DB} TO ${DSPAM_PgSQL_USER}; GRANT ALL PRIVILEGES ON SCHEMA public TO ${DSPAM_PgSQL_USER}; UPDATE pg_database SET datdba=(SELECT usesysid FROM pg_shadow WHERE usename='${DSPAM_PgSQL_USER}') WHERE datname='${DSPAM_PgSQL_DB}';"
-
- einfo "Creating DSPAM PostgreSQL tables"
- PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_objects.sql 1>/dev/null 2>&1
-
- if use virtual-users ; then
- einfo "Creating DSPAM PostgreSQL database for virtual-users users"
- PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_virtual-users.sql 1>/dev/null 2>&1
- fi
- elif use oci8 ; then
- einfo "We have not enought Oracle knowledge to configure Oracle"
- einfo "automatically. If you know how, please post a message in"
- einfo "Gentoo Bugzilla."
- einfo
- einfo "You need manually to create the Oracle user for DSPAM and"
- einfo "the necessary database."
- einfo "But the DSPAM configuration file dspam.conf and oracle.data"
- einfo "was already configured with the necessary information to"
- einfo "access the database."
- einfo "Please read your dspam.conf, oracle.data and the README for"
- einfo "more info on how to setup DSPAM with Oracle."
- einfo "objects for each user upon first use of DSPAM by that user."
- fi
-
-}
diff --git a/mail-filter/dspam/dspam-3.6.5.ebuild b/mail-filter/dspam/dspam-3.6.5.ebuild
deleted file mode 100644
index 0f0a3eb2393d..000000000000
--- a/mail-filter/dspam/dspam-3.6.5.ebuild
+++ /dev/null
@@ -1,487 +0,0 @@
-# Copyright 1999-2006 Gentoo Foundation
-# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/dspam-3.6.5.ebuild,v 1.2 2006/06/01 16:08:37 mr_bones_ Exp $
-
-inherit eutils
-
-DESCRIPTION="A statistical-algorithmic hybrid anti-spam filter"
-SRC_URI="http://dspam.nuclearelephant.com/sources/${P}.tar.gz
- http://dspam.nuclearelephant.com/sources/extras/dspam_sa_trainer.tar.gz"
-HOMEPAGE="http://dspam.nuclearelephant.com/"
-LICENSE="GPL-2"
-
-IUSE="berkdb clamav cyrus daemon debug large-domain ldap logrotate mysql oci8 postgres procmail sqlite sqlite3 virtual-users user-homedirs"
-
-DEPEND="berkdb? ( >=sys-libs/db-4.0 )
- clamav? ( >=app-antivirus/clamav-0.86 )
- ldap? ( >=net-nds/openldap-2.2 )
- daemon? ( || ( mysql? ( >=dev-db/mysql-3.23 ) ) ( postgres? ( >=dev-db/postgresql-7.4.3 ) ) )
- sqlite? ( <dev-db/sqlite-3 )
- sqlite3? ( =dev-db/sqlite-3* )"
-
-RDEPEND="${DEPEND}
- sys-process/cronbase
- cyrus? ( net-mail/cyrus-imapd )
- logrotate? ( app-admin/logrotate )
- procmail? ( mail-filter/procmail )"
-
-KEYWORDS="~x86 ~ppc ~alpha ~amd64"
-SLOT="0"
-
-# some FHS-like structure
-HOMEDIR="/var/spool/dspam"
-CONFDIR="/etc/mail/dspam"
-LOGDIR="/var/log/dspam"
-
-pkg_setup() {
- local multiple_dbs="0"
- local supported_dbs="berkdb mysql postgres oci8 sqlite sqlite3"
- for foo in ${supported_dbs}; do
- if use ${foo}; then
- let multiple_dbs="((multiple_dbs + 1 ))"
- einfo " ${foo} database support in your USE flags."
- fi
- done
-
- if [ "${multiple_dbs}" -ge "2" ]; then
- echo
- ewarn "You have multiple database backends active in your USE flags."
- ewarn "Will default to MySQL as your dspam database backend."
- ewarn "If you want to build with another database backend; hit Control-C now."
- ewarn "Change your USE flag -mysql and emerge again."
- echo
- has_version ">=sys-apps/portage-2.0.50" && (
- einfo "It would be best practice to add the set of USE flags that you use for this"
- einfo "package to the file: /etc/portage/package.use. Example:"
- einfo "\`echo \"mail-filter/dspam -mysql postgres -oci8 -sqlite -sqlite3\" >> /etc/portage/package.use\`"
- einfo "to build dspam with a PostgreSQL database as your dspam backend."
- )
- elif [ "${multiple_dbs}" -eq "0" ]; then
- echo
- ewarn "You did not select any SQL based database backend."
- ewarn "DSPAM will use self-contained Hash driver for storing data."
- ewarn "If you don't want that, then enable one of the following"
- ewarn "USE flags: ${supported_dbs}"
- fi
-
- if use daemon && has_version ">sys-kernel/linux-headers-2.6"; then
- einfo "To use the new DSPAM daemon mode, you need to emerge"
- einfo ">sys-kernel/linux-headers-2.6 and rebuild glibc to support NPTL"
- fi
-
- if use daemon && ! use mysql && ! use postgres ; then
- echo
- ewarn "To use the new DSPAM daemon mode, you need to emerge either MySQL or PostgreSQL"
- fi
-
- if use virtual-users && use user-homedirs ; then
- ewarn "If the users are virtual, then they probably should not have home directories."
- fi
-
- if use user-homedirs ; then
- ewarn "WARNING: dspam-web will not work with user-homedirs. Disable this USE flag"
- ewarn "if you intend on using dspam-web."
- fi
-
- id dspam 2>/dev/null || enewgroup dspam 26
- id dspam 2>/dev/null || enewuser dspam 26 /bin/bash ${HOMEDIR} dspam
-}
-
-src_compile() {
- local myconf
-
- myconf="${myconf} --enable-long-username"
-
- use large-domain && myconf="${myconf} --enable-large-scale" ||\
- myconf="${myconf} --enable-domain-scale"
-
- myconf="${myconf} --with-dspam-home=${HOMEDIR}"
- myconf="${myconf} --sysconfdir=${CONFDIR}"
- use user-homedirs && myconf="${myconf} --enable-homedir"
- use clamav && myconf="${myconf} --enable-clamav"
- use ldap && myconf="${myconf} --enable-ldap"
-
- if use cyrus; then
- myconf="${myconf} --with-delivery-agent=/usr/lib/cyrus/deliver"
- elif use procmail; then
- myconf="${myconf} --with-delivery-agent=/usr/bin/procmail"
- fi
-
- # enables support for debugging (touch /etc/dspam/.debug to turn on)
- # optional: even MORE debugging output, use with extreme caution!
- use debug && myconf="${myconf} --enable-debug --enable-verbose-debug --enable-bnr-debug"
-
- if use daemon && has_version ">sys-kernel/linux-headers-2.6"; then
- myconf="${myconf} --enable-daemon"
- fi
-
- # select storage driver
- if use sqlite ; then
- myconf="${myconf} --with-storage-driver=sqlite_drv"
- myconf="${myconf} --enable-virtual-users"
- elif use sqlite3 ; then
- myconf="${myconf} --with-storage-driver=sqlite3_drv"
- myconf="${myconf} --enable-virtual-users"
- elif use mysql; then
- myconf="${myconf} --with-storage-driver=mysql_drv"
- myconf="${myconf} --with-mysql-includes=/usr/include/mysql"
- myconf="${myconf} --with-mysql-libraries=/usr/lib/mysql"
- myconf="${myconf} --enable-preferences-extension"
-
- use virtual-users && myconf="${myconf} --enable-virtual-users"
- elif use postgres ; then
- myconf="${myconf} --with-storage-driver=pgsql_drv"
- myconf="${myconf} --with-pgsql-includes=/usr/include/postgresql"
- myconf="${myconf} --with-pgsql-libraries=/usr/lib/postgresql"
- myconf="${myconf} --enable-preferences-extension"
-
- use virtual-users && myconf="${myconf} --enable-virtual-users"
- elif use oci8 ; then
- myconf="${myconf} --with-storage-driver=ora_drv"
- myconf="${myconf} --with-oracle-home=${ORACLE_HOME}"
- myconf="${myconf} --enable-virtual-users"
-
- # I am in no way a Oracle specialist. If someone knows
- # how to query the version of Oracle, then let me know.
- if (expr ${ORACLE_HOME/*\/} : 10 1>/dev/null 2>&1); then
- myconf="${myconf} --with-oracle-version=10"
- fi
- elif use berkdb ; then
- myconf="${myconf} --with-storage-driver=libdb4_drv"
- else
- myconf="${myconf} --with-storage-driver=hash_drv"
- fi
-
- econf ${myconf} || die
- emake || die
-}
-
-src_install () {
-
- # Fix issues with older dspam configuration
- CONFIG_PROTECT="${CONFIG_PROTECT} ${HOMEDIR} ${CONFDIR} /var/run/dspam"
- CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${HOMEDIR}/}"
- CONFIG_PROTECT_MASK="${CONFIG_PROTECTMASK/${CONFDIR}/}"
-
- # open up perms on $HOMEDIR
- diropts -m0775 -o dspam -g dspam
- dodir ${HOMEDIR}
- keepdir ${HOMEDIR}
-
- # keeps dspam data in $CONFDIR
- diropts -m0775 -o dspam -g dspam
- dodir ${CONFDIR}
- keepdir ${CONFDIR}
-
- # create logdir
- diropts -m0775 -o dspam -g dspam
- dodir ${LOGDIR}
- keepdir ${LOGDIR}
-
- # make install
- make DESTDIR=${D} install || die
- chmod o+s ${D}/usr/bin/dspam
- chmod o+s ${D}/usr/bin/dspam_stats
-
- # documentation
- dodoc CHANGELOG LICENSE README* RELEASE.NOTES UPGRADING
- dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
- docinto doc
- dodoc doc/*.txt
- docinto gentoo
- dodoc ${FILESDIR}/README.postfix ${FILESDIR}/README.qmail
- doman man/dspam*
- dodoc ${DISTDIR}/dspam_sa_trainer.tar.gz
-
- # build some initial configuration data
- [ ! -f ${CONFDIR}/dspam.conf ] \
- && cp src/dspam.conf ${T}/dspam.conf
-
- if use daemon; then
- if has_version ">sys-kernel/linux-headers-2.6"; then
- # keeps dspam socket for daemon in /var/run/dspam
- diropts -m0775 -o dspam -g dspam
- dodir /var/run/dspam
- keepdir /var/run/dspam
-
- # We use sockets for the daemon instead of tcp port 24
- sed -e 's:^#*\(ServerDomainSocketPath[\t ]\{1,\}\).*:\1\"/var/run/dspam/dspam.sock\":gI' \
- -e 's:^#*\(ServerPID[\t ]\{1,\}\).*:\1/var/run/dspam/dspam.pid:gI' \
- -i ${T}/dspam.conf
-
- # dspam init script
- exeinto /etc/init.d
- exeopts -m0755 -o root -g root
- newexe ${FILESDIR}/dspam.rc dspam
- fi
- fi
-
- # generate random password
- local PASSWORD="${RANDOM}${RANDOM}${RANDOM}${RANDOM}"
-
- # database related configuration and scripts
- if use sqlite; then
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- newins src/tools.sqlite_drv/purge-2.sql sqlite_purge.sql
- elif use sqlite3; then
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- newins src/tools.sqlite_drv/purge-3.sql sqlite3_purge.sql
- elif use mysql; then
- # Use existing configuration if possible
- if [[ -f ${ROOT}${CONFDIR}/mysql.data ]]; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="/var/run/mysqld/mysqld.sock"
- DSPAM_DB_DATA[1]=""
- DSPAM_DB_DATA[2]="dspam"
- DSPAM_DB_DATA[3]="${PASSWORD}"
- DSPAM_DB_DATA[4]="dspam"
- DSPAM_DB_DATA[5]="true"
- fi
-
- # Modify configuration and create mysql.data file
- sed -e "s:^#*\(MySQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^#*\(MySQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^#*\(MySQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^#*\(MySQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
- -e "s:^#*\(MySQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
- -e "s:^#*\(MySQLCompress[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[5]}:gI" \
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/mysql.data
- done
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/mysql.data
- newins src/tools.mysql_drv/mysql_objects-space.sql mysql_objects-space.sql
- newins src/tools.mysql_drv/mysql_objects-speed.sql mysql_objects-speed.sql
- newins src/tools.mysql_drv/mysql_objects-4.1.sql mysql_objects-4.1.sql
- newins src/tools.mysql_drv/virtual_users.sql mysql_virtual_users.sql
- newins src/tools.mysql_drv/purge.sql mysql_purge.sql
- newins src/tools.mysql_drv/purge-4.1.sql mysql_purge-4.1.sql
-
- elif use postgres ; then
- # Use existing configuration if possible
- if [ -f ${ROOT}${CONFDIR}/pgsql.data ]; then
- DSPAM_DB_DATA=( $(cat "${ROOT}${CONFDIR}/pgsql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="127.0.0.1"
- DSPAM_DB_DATA[1]="5432"
- DSPAM_DB_DATA[2]="dspam"
- DSPAM_DB_DATA[3]="${PASSWORD}"
- DSPAM_DB_DATA[4]="dspam"
- fi
-
- # Modify configuration and create pgsql.data file
- sed -e "s:^#*\(PgSQLServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^#*\(PgSQLPort[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^#*\(PgSQLUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^#*\(PgSQLPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI" \
- -e "s:^#*\(PgSQLDb[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[4]}:gI" \
- -e "s:^#*\(PgSQLConnectionCache[\t ]*.\):\1:gI" \
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/pgsql.data
- done
-
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/pgsql.data
- newins src/tools.pgsql_drv/pgsql_objects.sql pgsql_objects.sql
- newins src/tools.pgsql_drv/virtual_users.sql pgsql_virtual_users.sql
- newins src/tools.pgsql_drv/purge.sql pgsql_purge.sql
-
- elif use oci8 ; then
- # Use existing configuration if possible
- if [ -f ${ROOT}${CONFDIR}/oracle.data ]; then
- DSPAM_DB_DATA=( $(cat "${ROOT}${CONFDIR}/oracle.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- else
- DSPAM_DB_DATA[0]="(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=PROD)))"
- DSPAM_DB_DATA[1]="dspam"
- DSPAM_DB_DATA[2]="${PASSWORD}"
- DSPAM_DB_DATA[3]="dspam"
- fi
-
- # Modify configuration and create oracle.data file
- sed -e "s:^#*\(OraServer[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[0]}:gI" \
- -e "s:^\(OraUser[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[1]}:gI" \
- -e "s:^\(OraPass[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[2]}:gI" \
- -e "s:^\(OraSchema[\t ]\{1,\}\).*:\1${DSPAM_DB_DATA[3]}:gI"\
- -i ${T}/dspam.conf
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- echo "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" >> ${T}/oracle.data
- done
-
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/oracle.data
- newins src/tools.ora_drv/oral_objects.sql ora_objects.sql
- newins src/tools.ora_drv/virtual_users.sql ora_virtual_users.sql
- newins src/tools.ora_drv/purge.sql ora_purge.sql
- fi
-
- sed -e "s:^\(Purge.*\):###\1:g" \
- -e "s:^#\(Purge.*\):\1:g" \
- -e "s:^###\(Purge.*\):#\1:g" \
- -i ${T}/dspam.conf
- insinto ${CONFDIR}
- insopts -m644 -o dspam -g dspam
- doins ${T}/dspam.conf
-
- # installs the notification messages
- # -> The documentation is wrong! The files need to be in ./txt
- diropts -m0775 -o dspam -g dspam
- dodir ${HOMEDIR}/txt
- keepdir ${HOMEDIR}/txt
- insinto ${HOMEDIR}/txt
- insopts -m644 -o dspam -g dspam
- doins ${S}/txt/*.txt
-
- # Create the opt-in / opt-out directories
- diropts -m0775 -o dspam -g dspam
- dodir ${HOMEDIR}/opt-in
- keepdir ${HOMEDIR}/opt-in
- dodir ${HOMEDIR}/opt-out
- keepdir ${HOMEDIR}/opt-out
-
- # logrotation scripts
- diropts -m0755 -o dspam -g dspam
- dodir /etc/logrotate.d
- keepdir /etc/logrotate.d
- insinto /etc/logrotate.d
- insopts -m0644 -o dspam -g dspam
- newins ${FILESDIR}/logrotate.dspam dspam
-
- # dspam cron job
- diropts -m0755 -o dspam -g dspam
- dodir /etc/cron.daily
- keepdir /etc/cron.daily
- exeinto /etc/cron.daily
- exeopts -m0755 -o dspam -g dspam
- doexe ${FILESDIR}/dspam.cron
-
- # dspam enviroment
- echo -ne "CONFIG_PROTECT=\"${CONFDIR} /var/run/dspam\"\n\n" > ${T}/40dspam
- doenvd ${T}/40dspam || die
-}
-
-pkg_postinst() {
- env-update
- if use mysql || use postgres || use oci8; then
- echo
- einfo "To setup DSPAM to run out-of-the-box on your system with a MySQL,"
- einfo "PostgreSQL or Oracle database, run:"
- einfo "emerge --config =${PF}"
- fi
-
- if has_version ">dev-db/postgresql-8.0"; then
- echo
- einfo "Before executing the configuration command mentioned above you have"
- einfo "to execute the following command:"
- einfo "createlang plpgsql -U postgres dspam"
- fi
-
- if use daemon; then
- if has_version ">sys-kernel/linux-headers-2.6"; then
- einfo "If you want to run DSPAM in the new daemon mode remember"
- einfo "to make the DSPAM daemon start during boot:"
- einfo " rc-update add dspam default"
- fi
- fi
- if use exim ; then
- echo
- einfo "To use dspam in conjunction with your exim system, you should read the README"
- fi
-}
-
-pkg_config () {
- if use sqlite ; then
- einfo "sqlite_drv will automatically create the necessary database"
- elif use mysql ; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/mysql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- DSPAM_MySQL_USER="${DSPAM_DB_DATA[2]}"
- DSPAM_MySQL_PWD="${DSPAM_DB_DATA[3]}"
- DSPAM_MySQL_DB="${DSPAM_DB_DATA[4]}"
-
- ewarn "When prompted for a password, please enter your MySQL root password"
- ewarn
-
- einfo "Creating DSPAM MySQL database \"${DSPAM_MySQL_DB}\""
- /usr/bin/mysqladmin -u root -p create ${DSPAM_MySQL_DB}
-
- einfo "Creating DSPAM MySQL tables for data objects"
- einfo " Please select what kind of object database you like to use."
- einfo " [1] Space optimized database"
- einfo " [2] Speed optimized database"
- einfo
- while true
- do
- read -n 1 -s -p " Press 1 or 2 on the keyboard to select database" DSPAM_MySQL_DB_Type
- [[ "${DSPAM_MySQL_DB_Type}" == "1" || "${DSPAM_MySQL_DB_Type}" == "2" ]] && echo && break
- done
-
- if [ "${DSPAM_MySQL_DB_Type}" == "1" ]
- then
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-space.sql
- else
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_objects-speed.sql
- fi
-
- if use virtual-users ; then
- einfo "Creating DSPAM MySQL database for virtual-users users"
- /usr/bin/mysql -u root -p ${DSPAM_MySQL_DB} < ${CONFDIR}/mysql_virtual_users.sql
- fi
-
- einfo "Creating DSPAM MySQL user \"${DSPAM_MySQL_USER}\""
- /usr/bin/mysql -u root -p -e "GRANT SELECT,INSERT,UPDATE,DELETE ON ${DSPAM_MySQL_DB}.* TO ${DSPAM_MySQL_USER}@localhost IDENTIFIED BY '${DSPAM_MySQL_PWD}';FLUSH PRIVILEGES;" -D mysql
- elif use postgres ; then
- DSPAM_DB_DATA=( $(sed "s:^[\t ]*$:###:gI" "${ROOT}${CONFDIR}/pgsql.data") )
- for DB_DATA_INDEX in $(seq 0 $((${#DSPAM_DB_DATA[@]} - 1))); do
- [[ "${DSPAM_DB_DATA[$DB_DATA_INDEX]}" = "###" ]] && DSPAM_DB_DATA[$DB_DATA_INDEX]=""
- done
- DSPAM_PgSQL_USER="${DSPAM_DB_DATA[2]}"
- DSPAM_PgSQL_PWD="${DSPAM_DB_DATA[3]}"
- DSPAM_PgSQL_DB="${DSPAM_DB_DATA[4]}"
-
- ewarn "When prompted for a password, please enter your PgSQL postgres password"
- ewarn
-
- einfo "Creating DSPAM PostgreSQL database \"${DSPAM_PgSQL_DB}\" and user \"${DSPAM_PgSQL_USER}\""
- /usr/bin/psql -h localhost -d template1 -U postgres -c "CREATE USER ${DSPAM_PgSQL_USER} WITH PASSWORD '${DSPAM_PgSQL_PWD}' NOCREATEDB NOCREATEUSER; CREATE DATABASE ${DSPAM_PgSQL_DB}; GRANT ALL PRIVILEGES ON DATABASE ${DSPAM_PgSQL_DB} TO ${DSPAM_PgSQL_USER}; GRANT ALL PRIVILEGES ON SCHEMA public TO ${DSPAM_PgSQL_USER}; UPDATE pg_database SET datdba=(SELECT usesysid FROM pg_shadow WHERE usename='${DSPAM_PgSQL_USER}') WHERE datname='${DSPAM_PgSQL_DB}';"
-
- einfo "Creating DSPAM PostgreSQL tables"
- PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_objects.sql 1>/dev/null 2>&1
-
- if use virtual-users ; then
- einfo "Creating DSPAM PostgreSQL database for virtual-users users"
- PGUSER=${DSPAM_PgSQL_USER} PGPASSWORD=${DSPAM_PgSQL_PWD} /usr/bin/psql -d ${DSPAM_PgSQL_DB} -U ${DSPAM_PgSQL_USER} -f ${CONFDIR}/pgsql_virtual_users.sql 1>/dev/null 2>&1
- fi
- elif use oci8 ; then
- einfo "We have not enought Oracle knowledge to configure Oracle"
- einfo "automatically. If you know how, please post a message in"
- einfo "Gentoo Bugzilla."
- einfo
- einfo "You need manually to create the Oracle user for DSPAM and"
- einfo "the necessary database."
- einfo "But the DSPAM configuration file dspam.conf and oracle.data"
- einfo "was already configured with the necessary information to"
- einfo "access the database."
- einfo "Please read your dspam.conf, oracle.data and the README for"
- einfo "more info on how to setup DSPAM with Oracle."
- einfo "objects for each user upon first use of DSPAM by that user."
- fi
-}
diff --git a/mail-filter/dspam/files/crontab.db4 b/mail-filter/dspam/files/crontab.db4
deleted file mode 100644
index 97634d1c45eb..000000000000
--- a/mail-filter/dspam/files/crontab.db4
+++ /dev/null
@@ -1,3 +0,0 @@
-#!/bin/sh
-/usr/bin/dspam_clean -s -p -u 2>&1 > /dev/null
-
diff --git a/mail-filter/dspam/files/crontab.mysql b/mail-filter/dspam/files/crontab.mysql
deleted file mode 100644
index e148bf9029cb..000000000000
--- a/mail-filter/dspam/files/crontab.mysql
+++ /dev/null
@@ -1,4 +0,0 @@
-#!/bin/sh
-# Remove old signatures and unimportant tokens from the database
-@confdir@/mysql_purge_db 2>&1 > /dev/null
-
diff --git a/mail-filter/dspam/files/digest-dspam-3.2.7 b/mail-filter/dspam/files/digest-dspam-3.2.7
deleted file mode 100644
index b4002f859213..000000000000
--- a/mail-filter/dspam/files/digest-dspam-3.2.7
+++ /dev/null
@@ -1 +0,0 @@
-MD5 f2bc9fb56ab6f21ef0b0ec7a3d453121 dspam-3.2.7.tar.gz 621245
diff --git a/mail-filter/dspam/files/digest-dspam-3.4.9 b/mail-filter/dspam/files/digest-dspam-3.4.9
deleted file mode 100644
index a00a9c2bd108..000000000000
--- a/mail-filter/dspam/files/digest-dspam-3.4.9
+++ /dev/null
@@ -1,4 +0,0 @@
-MD5 ef7ceba47e63edb02a59be3c36cf0f6f dspam-3.4.9.tar.gz 701069
-MD5 8ffe9d41e6104a4c6d19067528193145 dspam_sa_trainer.tar.gz 1230
-RMD160 c3d0fca7169d23ecf9d44c850ee255b42d97d818 dspam_sa_trainer.tar.gz 1230
-SHA256 8fb6b1ebe592acf00a028737ef8e174544af166768b987d29048b2319bc5a215 dspam_sa_trainer.tar.gz 1230
diff --git a/mail-filter/dspam/files/digest-dspam-3.6.0 b/mail-filter/dspam/files/digest-dspam-3.6.0
deleted file mode 100644
index 38ecbd8bd659..000000000000
--- a/mail-filter/dspam/files/digest-dspam-3.6.0
+++ /dev/null
@@ -1,4 +0,0 @@
-MD5 d9ee63a8cf67ea933d711b00851ce916 dspam-3.6.0.tar.gz 732042
-MD5 8ffe9d41e6104a4c6d19067528193145 dspam_sa_trainer.tar.gz 1230
-RMD160 c3d0fca7169d23ecf9d44c850ee255b42d97d818 dspam_sa_trainer.tar.gz 1230
-SHA256 8fb6b1ebe592acf00a028737ef8e174544af166768b987d29048b2319bc5a215 dspam_sa_trainer.tar.gz 1230
diff --git a/mail-filter/dspam/files/digest-dspam-3.6.1 b/mail-filter/dspam/files/digest-dspam-3.6.1
deleted file mode 100644
index a64e4f90c90c..000000000000
--- a/mail-filter/dspam/files/digest-dspam-3.6.1
+++ /dev/null
@@ -1,4 +0,0 @@
-MD5 6aad568823f297852dff4989da332e22 dspam-3.6.1.tar.gz 739389
-MD5 8ffe9d41e6104a4c6d19067528193145 dspam_sa_trainer.tar.gz 1230
-RMD160 c3d0fca7169d23ecf9d44c850ee255b42d97d818 dspam_sa_trainer.tar.gz 1230
-SHA256 8fb6b1ebe592acf00a028737ef8e174544af166768b987d29048b2319bc5a215 dspam_sa_trainer.tar.gz 1230
diff --git a/mail-filter/dspam/files/digest-dspam-3.6.2 b/mail-filter/dspam/files/digest-dspam-3.6.2
deleted file mode 100644
index 2c3963b23d15..000000000000
--- a/mail-filter/dspam/files/digest-dspam-3.6.2
+++ /dev/null
@@ -1,4 +0,0 @@
-MD5 cde38b1fe37daf531475251e95253033 dspam-3.6.2.tar.gz 740001
-MD5 8ffe9d41e6104a4c6d19067528193145 dspam_sa_trainer.tar.gz 1230
-RMD160 c3d0fca7169d23ecf9d44c850ee255b42d97d818 dspam_sa_trainer.tar.gz 1230
-SHA256 8fb6b1ebe592acf00a028737ef8e174544af166768b987d29048b2319bc5a215 dspam_sa_trainer.tar.gz 1230
diff --git a/mail-filter/dspam/files/digest-dspam-3.6.3 b/mail-filter/dspam/files/digest-dspam-3.6.3
deleted file mode 100644
index 75f25c05c720..000000000000
--- a/mail-filter/dspam/files/digest-dspam-3.6.3
+++ /dev/null
@@ -1,4 +0,0 @@
-MD5 db1aedb9677e6bf5c7a47a72d4f130e5 dspam-3.6.3.tar.gz 740097
-MD5 8ffe9d41e6104a4c6d19067528193145 dspam_sa_trainer.tar.gz 1230
-RMD160 c3d0fca7169d23ecf9d44c850ee255b42d97d818 dspam_sa_trainer.tar.gz 1230
-SHA256 8fb6b1ebe592acf00a028737ef8e174544af166768b987d29048b2319bc5a215 dspam_sa_trainer.tar.gz 1230
diff --git a/mail-filter/dspam/files/digest-dspam-3.6.4 b/mail-filter/dspam/files/digest-dspam-3.6.4
deleted file mode 100644
index b8dc57612d69..000000000000
--- a/mail-filter/dspam/files/digest-dspam-3.6.4
+++ /dev/null
@@ -1,6 +0,0 @@
-MD5 e9fdb00a23a99e05c9e4c22aa8aa3655 dspam-3.6.4.tar.gz 743664
-RMD160 fcd431205e3fd737cfdfb90b695ba7c84bbb27d5 dspam-3.6.4.tar.gz 743664
-SHA256 bdb10acbff97483db8ef7aafee8ba2e9113f6b7d5fc76cf569334b32937ca304 dspam-3.6.4.tar.gz 743664
-MD5 8ffe9d41e6104a4c6d19067528193145 dspam_sa_trainer.tar.gz 1230
-RMD160 c3d0fca7169d23ecf9d44c850ee255b42d97d818 dspam_sa_trainer.tar.gz 1230
-SHA256 8fb6b1ebe592acf00a028737ef8e174544af166768b987d29048b2319bc5a215 dspam_sa_trainer.tar.gz 1230
diff --git a/mail-filter/dspam/files/digest-dspam-3.6.5 b/mail-filter/dspam/files/digest-dspam-3.6.5
deleted file mode 100644
index bede4e86d744..000000000000
--- a/mail-filter/dspam/files/digest-dspam-3.6.5
+++ /dev/null
@@ -1,6 +0,0 @@
-MD5 da4f0e00633bff49d71fde418caaf14b dspam-3.6.5.tar.gz 747196
-RMD160 363217410de515f15baaa0a864ee23617ae8f6c2 dspam-3.6.5.tar.gz 747196
-SHA256 d8033773840f51cad27466b018e26c5232990f576108af79f6aa910bc2556fda dspam-3.6.5.tar.gz 747196
-MD5 8ffe9d41e6104a4c6d19067528193145 dspam_sa_trainer.tar.gz 1230
-RMD160 c3d0fca7169d23ecf9d44c850ee255b42d97d818 dspam_sa_trainer.tar.gz 1230
-SHA256 8fb6b1ebe592acf00a028737ef8e174544af166768b987d29048b2319bc5a215 dspam_sa_trainer.tar.gz 1230