spamassassin-vl.spec 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496
  1. %define pdir Mail
  2. %define pnam SpamAssassin
  3. %define version 3.3.2
  4. %define real_version 3.3.2
  5. %global saversion 3.003002
  6. %define release 1%{_dist_release}
  7. %define cfdate 20140113
  8. %define name spamassassin
  9. %define _initrddir /etc/rc.d/init.d
  10. %define initdir %{_initrddir}
  11. #%define __find_provides /usr/lib/rpm/find-provides.perl
  12. #%define __find_requires /usr/lib/rpm/find-requires.perl
  13. Summary: a spam filter for email which can be invoked from mail delivery agents
  14. Summary(ja): MDA から起動できる spam email filter
  15. Group: Applications/Internet
  16. Name: %{name}
  17. Version: %{version}
  18. Release: %{release}
  19. License: Apache License 2.0
  20. URL: http://spamassassin.org/
  21. Source0: http://spamassassin.org/released/Mail-SpamAssassin-%{real_version}.tar.bz2
  22. Source1: http://spamassassin.org/released/Mail-SpamAssassin-rules-%{real_version}-r1104058.tar.gz
  23. Source2: sample-japanese-local.cf-%{cfdate}
  24. Source3: README.vine
  25. Source4: filter.sh
  26. Source5: spamassassin.sysconfig
  27. Source6: sa-update.logrotate
  28. Source7: sa-update.crontab
  29. Source8: sa-update.cronscript
  30. Source9: sa-update.force-sysconfig
  31. Source11: spamassassin-official.conf
  32. Source12: sought.conf
  33. Patch0: spamassassin-3.1.7_rules.patch
  34. Buildroot: %{_tmppath}/%{name}-%{version}-root
  35. Requires(pre): /sbin/chkconfig
  36. Requires(pre): perl-Mail-SpamAssassin = %{version}-%{release}
  37. Requires(pre): spamassassin-tools = %{version}-%{release}
  38. Requires: perl >= 1:5.10.0
  39. Requires: perl(Pod::Usage), perl(HTML::Parser) >= 3.43 perl(Digest::SHA1)
  40. Requires: perl(Net::DNS)
  41. # sa-update's Requires
  42. Requires: perl(Archive::Tar) >= 1.23 perl(IO::Zlib) >= 1.04 perl(LWP)
  43. BuildRequires: perl >= 1:5.10.0 perl(HTML::Parser) >= 3.43 perl(Digest::SHA1)
  44. BuildRequires: perl(Archive::Tar) >= 1.23 perl(IO::Zlib) >= 1.04
  45. BuildRequires: perl(Net::DNS)
  46. BuildRequires: perl(NetAddr::IP)
  47. Vendor: Project Vine
  48. Distribution: Vine Linux
  49. %description
  50. SpamAssassin provides you with a way to reduce if not completely eliminate
  51. Unsolicited Commercial Email (spam) from your incoming email. It can
  52. be invoked by a MDA such as sendmail or postfix, or can be called from
  53. a procmail script, .forward file, etc. It uses a genetic-algorithm
  54. evolved scoring system to identify messages which look spammy, then
  55. adds headers to the message so they can be filtered by the user's mail
  56. reading software. This distribution includes the spamd/spamc components
  57. which create a server that considerably speeds processing of mail.
  58. %description -l ja
  59. SpamAssassin は商用電子メール(スパム)を除去する手段を提供する filter です。
  60. sendmail または postfix のような MDA から SpamAssassin を起動することが
  61. 可能です。
  62. また procmail スクリプト、.forward ファイルなどからも呼ぶことができます。
  63. SpamAssassin は、スパムメッセージを識別するために遺伝的アルゴリズムを
  64. 発展させた、得点システムを使用しています。
  65. ユーザのメールソフト (MUA) がそれらをフィルタリングすることができるように、
  66. メッセージにヘッダーを加えます。
  67. また、メイルの処理速度を要求されるサーバーで用いる spamd/spamc コンポー
  68. ネントを含んでいます。
  69. 日本語のスパムメール用の local.cf を含めています。
  70. /usr/doc/spamassassin-*/sample-japanese-local.conf を見てください。
  71. %package tools
  72. Summary: Miscellaneous tools for SpamAssassin
  73. Summary(ja): SpamAssassin 向けの各種ツール
  74. Group: Applications/Internet
  75. Requires(pre): perl-Mail-SpamAssassin = %{version}-%{release}
  76. Requires: perl >= 1:5.6.1
  77. Autoreq: no
  78. %description tools
  79. Miscellaneous tools from various authors, distributed with SpamAssassin.
  80. See /usr/share/doc/SpamAssassin-tools-*/.
  81. %package -n perl-Mail-SpamAssassin
  82. Summary: %{pdir}::%{pnam} -- SpamAssassin e-mail filter Perl modules
  83. Requires: perl >= 1:5.6.1 perl(Pod::Usage) perl(HTML::Parser) >= 3.43
  84. Group: Development/Libraries
  85. %description -n perl-Mail-SpamAssassin
  86. Mail::SpamAssassin is a module to identify spam using text analysis and
  87. several internet-based realtime blacklists. Using its rule base, it uses a
  88. wide range of heuristic tests on mail headers and body text to identify
  89. ``spam'', also known as unsolicited commercial email. Once identified, the
  90. mail can then be optionally tagged as spam for later filtering using the
  91. user's own mail user-agent application.
  92. %prep -q
  93. %setup -q -n %{pdir}-%{pnam}-%{real_version}
  94. # %setup -D -a 1 -T -n %{pdir}-%{pnam}-%{real_version}
  95. %patch0 -p0 -b .rules
  96. # Japanese sample file / README
  97. cp -p %{SOURCE2} sample-japanese-local.cf
  98. cp -p %{SOURCE3} README.vine
  99. cp -p %{SOURCE4} filter.sh
  100. # sa-update sample
  101. cp -p %{SOURCE6} .
  102. cp -p %{SOURCE7} .
  103. cp -p %{SOURCE8} .
  104. # change README filename
  105. cp spamd/README spamd/README.spamd
  106. %build
  107. CFLAGS="$RPM_OPT_FLAGS"; export CFLAGS
  108. %{__perl} Makefile.PL INSTALLDIRS=vendor < /dev/null
  109. %{__make}
  110. %{__make} spamd/libspamc.so
  111. %install
  112. [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
  113. make DESTDIR=%{buildroot} install
  114. install -d %{buildroot}/%{initdir}
  115. install -m 0755 spamd/redhat-rc-script.sh %{buildroot}%{initdir}/spamassassin
  116. mkdir -p %{buildroot}%{_sysconfdir}/mail/spamassassin
  117. mkdir -p %{buildroot}%{_sysconfdir}/sysconfig
  118. mkdir -p %{buildroot}%{_sysconfdir}/logrotate.d
  119. mkdir -p %{buildroot}%{_sysconfdir}/cron.d
  120. install -m 0644 %{SOURCE5} %{buildroot}%{_sysconfdir}/sysconfig/spamassassin
  121. install -m 0644 %{SOURCE6} %{buildroot}/etc/logrotate.d/sa-update
  122. install -m 0644 %{SOURCE7} %{buildroot}/etc/cron.d/sa-update
  123. install -m 0644 %{SOURCE9} %{buildroot}%{_sysconfdir}/sysconfig/sa-update
  124. # installed mode 744 as non root users can't run it, but can read it.
  125. install -m 0744 %{SOURCE8} %{buildroot}%{_datadir}/spamassassin/sa-update.cron
  126. # [ -x /usr/lib/rpm/brp-compress ] && /usr/lib/rpm/brp-compress
  127. find %{buildroot} \( -name perllocal.pod -o -name .packlist \) -exec rm -v {} \;
  128. find %{buildroot} -type d -depth -exec rmdir {} 2>/dev/null ';'
  129. # Default rules from separate tarball
  130. cd %{buildroot}%{_datadir}/spamassassin/
  131. tar xfvz %{SOURCE1}
  132. sed -i -e 's|\@\@VERSION\@\@|%{saversion}|' *.cf
  133. cd -
  134. find %{buildroot}/usr -type f -print |
  135. sed "s@^%{buildroot}@@g" |
  136. grep -v perllocal.pod |
  137. grep -v "\.packlist" > %{name}-%{version}-filelist
  138. if [ "$(cat %{name}-%{version}-filelist)X" = "X" ] ; then
  139. echo "ERROR: EMPTY FILE LIST"
  140. exit -1
  141. fi
  142. find %{buildroot}%{perl_vendorlib}/* -type d -print |
  143. sed "s@^%{buildroot}@%dir @g" >> %{name}-%{version}-filelist
  144. # sa-update channels and keyring directory
  145. mkdir -m 0700 %{buildroot}%{_sysconfdir}/mail/spamassassin/sa-update-keys/
  146. mkdir -m 0755 %{buildroot}%{_sysconfdir}/mail/spamassassin/channel.d/
  147. install -m 0644 %{SOURCE11} %{buildroot}%{_sysconfdir}/mail/spamassassin/channel.d/
  148. install -m 0644 %{SOURCE12} %{buildroot}%{_sysconfdir}/mail/spamassassin/channel.d/
  149. %clean
  150. [ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
  151. %post
  152. # install
  153. if [ $1 = 1 ]; then
  154. /sbin/chkconfig --add spamassassin
  155. fi
  156. # update
  157. if [ $1 = 2 ]; then
  158. if [ -x /usr/bin/sa-learn ] ; then
  159. echo "Sync DB (sa-learn --sync)"
  160. /usr/bin/sa-learn --sync
  161. fi
  162. if [ -f /var/lock/subsys/spamassassin ]; then
  163. echo "restarting spamd"
  164. %{initdir}/spamassassin restart
  165. else
  166. echo 'If you use spamd,'
  167. echo ' "/etc/rc.d/init.d/spamassassin start"'
  168. echo 'to start the spamd daemon.'
  169. fi
  170. fi
  171. %post tools
  172. if [ -x /usr/bin/sa-update ] ; then
  173. echo "Update rules"
  174. /usr/bin/sa-update ||:
  175. fi
  176. %post -n perl-Mail-SpamAssassin
  177. if [ -x /usr/bin/sa-update ] ; then
  178. echo "Update rules"
  179. /usr/bin/sa-update ||:
  180. fi
  181. %pre -n perl-Mail-SpamAssassin
  182. # update
  183. if [ $1 = 2 ]; then
  184. if [ -x /usr/bin/sa-learn ] ; then
  185. echo "Sync DB (sa-learn --sync)"
  186. /usr/bin/sa-learn --sync ||:
  187. fi
  188. fi
  189. %preun
  190. # remove
  191. if [ $1 = 0 ]; then
  192. if [ -f /var/lock/subsys/spamassassin ]; then
  193. %{initdir}/spamassassin stop 1>&2
  194. fi
  195. /sbin/chkconfig --del spamassassin
  196. fi
  197. %files
  198. %defattr(-,root,root)
  199. %doc CREDITS Changes INSTALL INSTALL.VMS LICENSE MANIFEST MANIFEST.SKIP
  200. %doc NOTICE PACKAGING README README.vine TRADEMARK UPGRADE USAGE
  201. %doc sql
  202. %doc filter.sh
  203. %doc sample-nonspam.txt sample-spam.txt
  204. %doc spamd/README.spamd
  205. %doc sample-japanese-local.cf
  206. %doc sa-update.*
  207. %config(noreplace) %{_sysconfdir}/sysconfig/spamassassin
  208. %attr(755,root,root) %{_bindir}/spam*
  209. %config %attr(755,root,root) %{initdir}/spamassassin
  210. %{_mandir}/man1/spam*
  211. %files -n spamassassin-tools
  212. %defattr(644,root,root,755)
  213. %doc sql
  214. %config(noreplace) %{_sysconfdir}/sysconfig/sa-update
  215. %config(noreplace) %{_sysconfdir}/logrotate.d/sa-update
  216. %{_sysconfdir}/cron.d/sa-update
  217. %attr(755,root,root) %{_bindir}/sa-*
  218. %{_mandir}/man1/sa-*
  219. %files -n perl-Mail-SpamAssassin
  220. %defattr(-,root,root)
  221. %{perl_vendorlib}/Mail/*
  222. %{perl_vendorlib}/spamassassin-run.pod
  223. %config(noreplace) %{_sysconfdir}/mail/spamassassin
  224. %{_datadir}/spamassassin
  225. %{_mandir}/man3/*
  226. %changelog
  227. * Mon Jan 13 2014 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.3.2-1
  228. - new upstream release.
  229. - added official rules.
  230. * Fri Apr 08 2011 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.3.1-1
  231. - new upstream release.
  232. - replaced "Prereq:" and "BuildPrereq".
  233. - updated sample-japanese-local.cf.
  234. - added Patch1 and Patch2 for perl-5.12.x.
  235. * Mon Jun 22 2009 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.2.5-1
  236. - new upstream release.
  237. - wrote spec in UTF-8.
  238. - updated sample-japanese-local.cf.
  239. * Thu May 1 2008 Tomohiro 'Tomo-p' KATO <tomop@teamgedoh.net>
  240. - 3.2.4-1
  241. - rebuilt with perl-5.10.0.
  242. * Sun Feb 24 2008 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  243. - 3.2.4-0vl1
  244. - new upstream release (built for VineSeed)
  245. - update Requires/BuildRequires tag perl(HTML::Parser) >= 3.43
  246. - enable Requires for sa-update
  247. - remove "(noreplace)" from init script
  248. - remove Vine 3.x if-endif section
  249. - remove script for upgrading from sa 2.x
  250. - turn on daemon restart message
  251. - update sample-japanese-local.cf
  252. * Wed Jan 02 2008 Shu KONNO <owa@bg.wakwak.com> 3.2.3-0vl1
  253. - new upstream release
  254. * Tue Feb 20 2007 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  255. - 3.1.8-0vl2
  256. - rebuilt for VinePlus 4.x
  257. - installed perl modules to vendor_perl dir
  258. * Sun Feb 18 2007 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  259. - 3.1.8-0vl1
  260. - built for VinePlus 3.x
  261. - installed perl modules to site_perl dir
  262. - add restart spamd process automactically (update)
  263. - * Thu Dec 07 2006 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  264. - 3.1.7-0vl1.1
  265. - fix file list
  266. - sample-japanese-local.cf update
  267. - README.vine update
  268. * Sun Feb 18 2007 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  269. - 3.1.8-0vl0.1
  270. - test package (not released)
  271. - built for VinePlus 4.0
  272. - new upstream release with security fix (CVE-2007-0451)
  273. - add Source4,5,6 for sa-update sample file
  274. * Tue Nov 07 2006 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  275. - 3.1.7-0vl3
  276. - fix file list
  277. - sample-japanese-local.cf update
  278. - README.vine update
  279. - fix changelog missing
  280. * Mon Oct 16 2006 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  281. - 3.1.7-0vl2
  282. - built for VinePlus 4.0
  283. - This package is based on VinePlus 3.x package
  284. - installed perl modules to vendor_perl dir
  285. - * Tue Jul 11 2006 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.64-0vl3
  286. - rebuilt with perl 5.8.6
  287. - changed Group to Applications/Internet
  288. - installed perl modules to vendor_perl dir
  289. * Sat Oct 14 2006 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  290. - 3.1.7-0vl1
  291. - new upstream release
  292. - add %pre -n perl-Mail-SpamAssassin script for updating package
  293. - add README.vine filter.sh
  294. - change License to Apache License 2.0
  295. * Sat Oct 07 2006 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  296. - 3.1.5-0vl1
  297. - new upstream release
  298. - built for VinePlus 3.2
  299. * Sat Nov 27 2004 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  300. - 2.64-0vl2
  301. - rebuild for VinePlus 3.0
  302. * Sat Nov 27 2004 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  303. - 2.64-0vl1
  304. - rebuild for VinePlus 2.5/2.6
  305. - Source version up
  306. - Sample-japanese-local.cf update
  307. * Sat Apr 10 2004 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  308. - 2.63-0vl4
  309. - rebuild for VineSeed Plus
  310. - Sample-japanese-local.cf update
  311. * Mon Apr 05 2004 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  312. - 2.63-0vl3
  313. - Source version up
  314. - Sample-japanese-local.cf update
  315. * Sun Apr 04 2004 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  316. - 2.63-0vl2
  317. - Source version up
  318. - Sample-japanese-local.cf update
  319. * Tue Dec 23 2003 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  320. - 2.61-0vl1
  321. - Source version up
  322. - Sample-japanese-local.cf update
  323. - Change make & install method for 2.61
  324. - fix Require
  325. - add post/preun script for update from 2.5x
  326. - add Vendor/Distribution tag
  327. * Sat May 24 2003 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  328. - 2.55-0vl2
  329. - Sample-japanese-local.cf update
  330. * Sat May 24 2003 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  331. - 2.55-0vl1
  332. - Source version up
  333. * Fri Apr 25 2003 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  334. - 2.53-0vl1
  335. - Source version up
  336. - Sample-japanese-local.cf update
  337. * Fri Mar 28 2003 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  338. - 2.52-0vl1
  339. - Source version up
  340. * Thu Feb 06 2003 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  341. - 2.44-0vl1
  342. - Source version up
  343. - Sample-japanese-local.cf update
  344. - Fix japanese discription
  345. * Wed Oct 23 2002 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  346. - 2.43-0vl2
  347. - Update & fix sample-japanese-local.cf
  348. * Fri Oct 18 2002 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  349. - 2.43-0vl1
  350. - Source version up
  351. - Change make & install method for 2.43
  352. - Update sample-japanese-local.cf
  353. - Thanx to MATSUDA Yoh-ichi <matsuda@palnet.or.jp> san
  354. - Change Buildprereq, Requires (perl 5.6.0 -> 5.6.1) for Vine 2.5
  355. - Add doc qmail
  356. - Fix cvs version tags (Patch0)
  357. * Thu Oct 10 2002 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  358. - 2.42-3vl3
  359. - stop install sample-japanese-local.cf to /etc/mail/spamassassin
  360. - add japanese discription
  361. - Fix Buildrequires
  362. * Tue Oct 08 2002 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  363. - 2.42-3vl2
  364. - Fix Requires, Buildrequires
  365. - add local.cf for Japanese (from Linux-Users ML spam filter)
  366. * Mon Oct 07 2002 Satoshi IWAMOTO <satoshi.iwamoto@nifty.ne.jp>
  367. - 2.42-3vl1
  368. - first build for Vine Linux
  369. - NO run post/preun script
  370. - add requires perl(Time::HiRes)
  371. - add define _initrcdir
  372. * Sat Oct 05 2002 Theo Van Dinter <felicity@kluge.net> -3
  373. - fixed some small typos in the spec file
  374. * Fri Oct 04 2002 Theo Van Dinter <felicity@kluge.net> -2
  375. - small bug where 2.42 still called itself 2.42-cvs
  376. * Fri Oct 04 2002 Theo Van Dinter <felicity@kluge.net> -1
  377. - updated to SA 2.42
  378. * Wed Sep 11 2002 Justin Mason <jm-spec@jmason.org>
  379. - spamassassin RPM now requires perl-Mail-SpamAssassin; from Theo
  380. * Tue Sep 03 2002 Theo Van Dinter <felicity@kluge.net>
  381. - added INSTALL to documentation files
  382. - install man pages via _manpage macro to make things consistent
  383. - added perl requires statement
  384. - cleaned out some cruft
  385. - fixed "file listed twice" bug
  386. * Wed Aug 28 2002 Justin Mason <jm-spec@jmason.org>
  387. - merged code from PLD rpm, split into spamassassin, perl-Mail-SpamAssassin,
  388. and spamassassin-tools rpms
  389. * Mon Jul 29 2002 Justin Mason <jm-spec@jmason.org>
  390. - removed migrate_cfs code, obsolete
  391. * Thu Jul 25 2002 Justin Mason <jm-spec@jmason.org>
  392. - removed findbin patch, obsolete
  393. * Fri Apr 19 2002 Theo Van Dinter <felicity@kluge.net>
  394. - Updated for 2.20 release
  395. - made /etc/mail/spamassassin a config directory so local.cf doesn't get wiped out
  396. - added a patch to remove findbin stuff
  397. * Wed Feb 27 2002 Craig Hughes <craig@hughes-family.org>
  398. - Updated for 2.1 release
  399. * Sat Feb 02 2002 Theo Van Dinter <felicity@kluge.net>
  400. - Updates for 2.01 release
  401. - Fixed rc file
  402. - RPM now buildable as non-root
  403. - fixed post_service errors
  404. - fixed provides to include perl modules
  405. - use file find instead of manually specifying files
  406. * Tue Jan 15 2002 Craig Hughes <craig@hughes-family.org>
  407. - Updated for 2.0 release
  408. * Wed Dec 05 2001 Craig Hughes <craig@hughes-family.org>
  409. - Updated for final 1.5 distribution.
  410. * Sun Nov 18 2001 Craig Hughes <craig@hughes-family.org>
  411. - first version of rpm.