spamassassin-vl.spec 14 KB

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