rspamd-vl.spec 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332
  1. %bcond_with systemd
  2. %bcond_with jemalloc
  3. %bcond_with hyperscan
  4. %define rspamd_user _rspamd
  5. %define rspamd_group %{rspamd_user}
  6. %define rspamd_home %{_localstatedir}/lib/rspamd
  7. %define rspamd_logdir %{_localstatedir}/log/rspamd
  8. %define rspamd_confdir %{_sysconfdir}/rspamd
  9. %define rspamd_pluginsdir %{_datadir}/rspamd/plugins
  10. %define rspamd_rulesdir %{_datadir}/rspamd/rules
  11. %define rspamd_wwwdir %{_datadir}/rspamd/www
  12. Summary: Rapid spam filtering system
  13. Name: rspamd
  14. Version: 3.4
  15. Release: 2%{?_dist_release}%{?with_systemd:.systemd}
  16. Group: servers
  17. Vendor: Project Vine
  18. Distribution: Vine Linux
  19. License: ASL 2.0
  20. URL: https://rspamd.com
  21. Source0: https://github.com/rspamd/rspamd/archive/%{version}.tar.gz#/%{name}-%{version}.tar.xz
  22. Source1000: rspamd.init
  23. Source1001: rspamd.logrotate
  24. Patch1: rspamd-3.1-32bit-noasm.patch
  25. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
  26. BuildRequires: cmake
  27. BuildRequires: file-devel
  28. BuildRequires: fmt-devel
  29. BuildRequires: glib2-devel
  30. BuildRequires: gmime-devel
  31. %ifarch x86_64
  32. BuildRequires: hyperscan-devel
  33. %endif
  34. %if %{with jemalloc}
  35. BuildRequires: jemalloc-devel
  36. %endif
  37. BuildRequires: libevent-devel
  38. BuildRequires: libicu-devel
  39. BuildRequires: libsodium-devel
  40. BuildRequires: libunwind-devel
  41. BuildRequires: lua-devel
  42. BuildRequires: openssl-devel
  43. BuildRequires: pcre2-devel
  44. BuildRequires: perl
  45. BuildRequires: ragel
  46. BuildRequires: sqlite3-devel
  47. %if %{with systemd}
  48. BuildRequires: systemd
  49. %endif
  50. BuildRequires: libzstd-devel
  51. Requires: logrotate
  52. Requires(pre): shadow-utils
  53. %if %{with systemd}
  54. Requires(pre): systemd
  55. Requires(post): systemd
  56. Requires(preun): systemd
  57. Requires(postun): systemd
  58. %else
  59. Requires(post): chkconfig
  60. Requires(preun): chkconfig, initscripts
  61. Requires(postun): initscripts
  62. %endif
  63. %description
  64. Rspamd is a rapid, modular and lightweight spam filter. It is designed to work
  65. with big amount of mail and can be easily extended with own filters written in
  66. lua.
  67. %debug_package
  68. %prep
  69. %autosetup -p1
  70. %build
  71. %if %{with hyperscan}
  72. %define opt_hyperscan -DENABLE_HYPERSCAN=ON
  73. %else
  74. %define opt_hyperscan -DENABLE_HYPERSCAN=OFF
  75. %endif
  76. %cmake \
  77. -DCMAKE_INSTALL_PREFIX=%{_prefix} \
  78. -DCONFDIR=%{_sysconfdir}/rspamd \
  79. -DINCLUDEDIR=%{_includedir} \
  80. -DLIBDIR=%{_libdir}/rspamd/ \
  81. -DMANDIR=%{_mandir} \
  82. -DSHAREDIR=%{_datadir}/rspamd \
  83. -DDBDIR=%{_localstatedir}/lib/rspamd \
  84. -DRUNDIR=%{_localstatedir}/run/rspamd \
  85. -DLOGDIR=%{_localstatedir}/log/rspamd \
  86. -DEXAMPLESDIR=%{_datadir}/examples/rspamd \
  87. -DNO_SHARED=ON \
  88. -DDEBIAN_BUILD=0 \
  89. -DRSPAMD_GROUP=%{rspamd_group} \
  90. -DRSPAMD_USER=%{rspamd_user} \
  91. %if %{with systemd}
  92. -DWANT_SYSTEMD_UNITS=ON \
  93. -DSYSTEMDDIR=%{_unitdir} \
  94. %else
  95. -DWANT_SYSTEMD_UNITS=OFF \
  96. -DDISABLE_PTHREAD_MUTEX=1 \
  97. %endif
  98. %ifarch x86_64
  99. %{opt_hyperscan} \
  100. %endif
  101. -DSYSTEM_FMT=ON \
  102. -DSYSTEM_ZSTD=ON \
  103. -DENABLE_LIBUNWIND=ON \
  104. -DENABLE_LUAJIT=OFF \
  105. -DENABLE_PCRE2=ON \
  106. %if %{with jemalloc}
  107. -DENABLE_JEMALLOC=ON \
  108. %endif
  109. %nil
  110. #-DCMAKE_SKIP_INSTALL_RPATH=ON \
  111. %cmake_build
  112. %install
  113. %cmake_install
  114. pushd ./centos/sources/
  115. %if %{with systemd}
  116. %{__install} -p -D -m 0644 80-rspamd.preset %{buildroot}%{_presetdir}/80-rspamd.preset
  117. %{__install} -p -D -m 0644 %{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
  118. %{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir}
  119. %else
  120. %{__install} -p -D -m 0755 %{SOURCE1000} %{buildroot}%{_initrddir}/%{name}
  121. %{__install} -p -D -m 0644 %{SOURCE1001} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
  122. %{__install} -d -p -m 0755 %{buildroot}%{_localstatedir}/run/rspamd
  123. %{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir}
  124. %endif
  125. %{__install} -d -p -m 0755 %{buildroot}%{rspamd_home}
  126. %{__install} -p -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/local.d/
  127. %{__install} -p -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/override.d/
  128. popd
  129. %clean
  130. rm -rf %{buildroot}
  131. %pre
  132. %{_sbindir}/groupadd -r %{rspamd_group} 2>/dev/null || :
  133. %{_sbindir}/useradd -g %{rspamd_group} -c "Rspamd user" -s /bin/false -r -d %{rspamd_home} %{rspamd_user} 2>/dev/null || :
  134. %post
  135. #to allow easy upgrade from 0.8.1
  136. %{__chown} -R %{rspamd_user}:%{rspamd_group} %{rspamd_home}
  137. %if %{with systemd}
  138. #Macro is not used as we want to do this on upgrade
  139. #%systemd_post %{name}.service
  140. systemctl --no-reload preset %{name}.service >/dev/null 2>&1 || :
  141. %{__chown} %{rspamd_user}:%{rspamd_group} %{rspamd_logdir}
  142. %else
  143. /sbin/chkconfig --add %{name}
  144. %endif
  145. %preun
  146. %if %{with systemd}
  147. %systemd_preun %{name}.service
  148. %else
  149. if [ $1 = 0 -o -x /bin/systemctl ]; then
  150. /sbin/service %{name} stop >/dev/null 2>&1
  151. /sbin/chkconfig --del %{name}
  152. fi
  153. %endif
  154. %postun
  155. %if %{with systemd}
  156. %systemd_postun_with_restart %{name}.service
  157. %else
  158. if [ $1 -ge 1 ]; then
  159. /sbin/service %{name} condrestart > /dev/null 2>&1 || :
  160. fi
  161. %endif
  162. %files
  163. %defattr(-,root,root,-)
  164. %license LICENSE.md
  165. %doc AUTHORS.md ChangeLog README.md
  166. %if %{with systemd}
  167. %{_unitdir}/%{name}.service
  168. %{_presetdir}/80-rspamd.preset
  169. %else
  170. %{_initrddir}/%{name}
  171. %dir %{_localstatedir}/run/rspamd
  172. %endif
  173. %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
  174. %dir %{rspamd_logdir}
  175. %{_mandir}/man8/%{name}.*
  176. %{_mandir}/man1/rspamc.*
  177. %{_mandir}/man1/rspamadm.*
  178. %{_bindir}/rspamd
  179. %{_bindir}/rspamd-*
  180. %{_bindir}/rspamd_stats
  181. %{_bindir}/rspamc
  182. %{_bindir}/rspamc-*
  183. %{_bindir}/rspamadm
  184. %{_bindir}/rspamadm-*
  185. %attr(-, %{rspamd_user}, %{rspamd_group}) %dir %{rspamd_home}
  186. %dir %{rspamd_confdir}
  187. %dir %{rspamd_confdir}/modules.d
  188. %dir %{rspamd_confdir}/local.d
  189. %dir %{rspamd_confdir}/maps.d
  190. %dir %{rspamd_confdir}/override.d
  191. %dir %{rspamd_confdir}/scores.d
  192. %dir %{rspamd_wwwdir}
  193. %dir %{_libdir}/rspamd
  194. %config(noreplace) %{rspamd_confdir}/*.conf
  195. %config(noreplace) %{rspamd_confdir}/*.inc
  196. %config(noreplace) %{rspamd_confdir}/maps.d/*
  197. %config(noreplace) %{rspamd_confdir}/modules.d/*
  198. %config(noreplace) %{rspamd_confdir}/scores.d/*
  199. %dir %{rspamd_pluginsdir}
  200. %{rspamd_pluginsdir}/*.lua
  201. %dir %{_datadir}/rspamd/lualib
  202. %dir %{_datadir}/rspamd/lualib/lua_content
  203. %dir %{_datadir}/rspamd/lualib/lua_ffi
  204. %dir %{_datadir}/rspamd/lualib/lua_magic
  205. %dir %{_datadir}/rspamd/lualib/lua_selectors
  206. %dir %{_datadir}/rspamd/lualib/lua_scanners
  207. %dir %{_datadir}/rspamd/lualib/plugins
  208. %dir %{_datadir}/rspamd/lualib/rspamadm
  209. %{_datadir}/rspamd/lualib/*.lua
  210. %{_datadir}/rspamd/lualib/lua_content/*.lua
  211. %{_datadir}/rspamd/lualib/lua_ffi/*.lua
  212. %{_datadir}/rspamd/lualib/lua_magic/*.lua
  213. %{_datadir}/rspamd/lualib/lua_selectors/*.lua
  214. %{_datadir}/rspamd/lualib/lua_scanners/*.lua
  215. %{_datadir}/rspamd/lualib/plugins/*.lua
  216. %{_datadir}/rspamd/lualib/rspamadm/*.lua
  217. %dir %{rspamd_rulesdir}
  218. %dir %{rspamd_rulesdir}/regexp
  219. %{rspamd_rulesdir}/regexp/*.lua
  220. %dir %{rspamd_rulesdir}/controller
  221. %{rspamd_rulesdir}/controller/*.lua
  222. %{rspamd_rulesdir}/*.lua
  223. %{rspamd_wwwdir}/*
  224. %{_libdir}/rspamd/*
  225. %{_datadir}/rspamd/effective_tld_names.dat
  226. %dir %{_datadir}/rspamd/languages
  227. %{_datadir}/rspamd/languages/*
  228. %dir %{_datadir}/rspamd/elastic
  229. %{_datadir}/rspamd/elastic/*
  230. %changelog
  231. * Wed Nov 02 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.4-2
  232. - disabled hyperscan.
  233. * Wed Nov 02 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.4-1
  234. - new upstream release.
  235. * Wed Oct 19 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.3-2
  236. - rebuilt with libicu72.
  237. * Sun Oct 02 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.3-1
  238. - new upstream release.
  239. * Sun Mar 27 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.2-1
  240. - new upstream release.
  241. * Tue Nov 02 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.1-2
  242. - made to use system fmt and zstd.
  243. * Tue Nov 02 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.1-1
  244. - new upstream release.
  245. - dropped Patch0 and 2: merged into upstream.
  246. - dropped Patch1: fixed in upstream.
  247. * Fri Oct 29 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-4
  248. - rebuilt with icu-70.1.
  249. * Sat Oct 16 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-3
  250. - disabled jemalloc as default: SIGSEGV was occured.
  251. * Sat Oct 16 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-2
  252. - added Patch2 to build with openssl-3.0.0.
  253. - built with jemalloc.
  254. * Thu Aug 19 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-1
  255. - new upstream release.
  256. - updated Patch0.
  257. - imported Patch1 from upstream of doctest to build with glibc-2.34+.
  258. * Thu Apr 08 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.7-2
  259. - rebuilt with icu69.
  260. * Sat Jan 09 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.7-1
  261. - new upstream release.
  262. * Tue Jan 05 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-3
  263. - updated Patch0.
  264. * Thu Oct 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-2
  265. - updated Patch0.
  266. * Fri Oct 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-1
  267. - new upstream release.
  268. - added Patch0 to build with lua-5.4.
  269. * Tue Aug 18 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-3
  270. - rebuilt with current envirionment.
  271. * Fri Apr 24 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-2
  272. - rebuilt with icu-67.
  273. * Thu Apr 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-1
  274. - new upstream release.
  275. * Thu Mar 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4-2
  276. - rebuilt with libicu66.
  277. * Sat Mar 07 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4-1
  278. - initial build for Vine Linux.