rspamd-vl.spec 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359
  1. %bcond_with systemd
  2. %bcond_with jemalloc
  3. %bcond_without 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.7.3
  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. %cmake_build
  111. %install
  112. %cmake_install
  113. pushd ./rpm/
  114. %if %{with systemd}
  115. %{__install} -p -D -m 0644 80-rspamd.preset %{buildroot}%{_presetdir}/80-rspamd.preset
  116. %{__install} -p -D -m 0644 %{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
  117. %{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir}
  118. %else
  119. %{__install} -p -D -m 0755 %{SOURCE1000} %{buildroot}%{_initrddir}/%{name}
  120. %{__install} -p -D -m 0644 %{SOURCE1001} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
  121. %{__install} -d -p -m 0755 %{buildroot}%{_localstatedir}/run/rspamd
  122. %{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir}
  123. %endif
  124. %{__install} -d -p -m 0755 %{buildroot}%{rspamd_home}
  125. %{__install} -p -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/local.d/
  126. %{__install} -p -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/override.d/
  127. popd
  128. %clean
  129. rm -rf %{buildroot}
  130. %pre
  131. %{_sbindir}/groupadd -r %{rspamd_group} 2>/dev/null || :
  132. %{_sbindir}/useradd -g %{rspamd_group} -c "Rspamd user" -s /bin/false -r -d %{rspamd_home} %{rspamd_user} 2>/dev/null || :
  133. %post
  134. #to allow easy upgrade from 0.8.1
  135. %{__chown} -R %{rspamd_user}:%{rspamd_group} %{rspamd_home}
  136. if [ -d /var/lib/rspamd/ ]; then
  137. find /var/lib/rspamd/ -name "*.unser" -delete
  138. fi
  139. %if %{with systemd}
  140. #Macro is not used as we want to do this on upgrade
  141. #%systemd_post %{name}.service
  142. systemctl --no-reload preset %{name}.service >/dev/null 2>&1 || :
  143. %{__chown} %{rspamd_user}:%{rspamd_group} %{rspamd_logdir}
  144. %else
  145. /sbin/chkconfig --add %{name}
  146. %endif
  147. %preun
  148. %if %{with systemd}
  149. %systemd_preun %{name}.service
  150. %else
  151. if [ $1 = 0 -o -x /bin/systemctl ]; then
  152. /sbin/service %{name} stop >/dev/null 2>&1
  153. /sbin/chkconfig --del %{name}
  154. fi
  155. %endif
  156. %postun
  157. %if %{with systemd}
  158. %systemd_postun_with_restart %{name}.service
  159. %else
  160. if [ $1 -ge 1 ]; then
  161. /sbin/service %{name} condrestart > /dev/null 2>&1 || :
  162. fi
  163. %endif
  164. %files
  165. %defattr(-,root,root,-)
  166. %license LICENSE.md
  167. %doc AUTHORS.md ChangeLog README.md
  168. %if %{with systemd}
  169. %{_unitdir}/%{name}.service
  170. %{_presetdir}/80-rspamd.preset
  171. %else
  172. %{_initrddir}/%{name}
  173. %dir %{_localstatedir}/run/rspamd
  174. %endif
  175. %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
  176. %dir %{rspamd_logdir}
  177. %{_mandir}/man8/%{name}.*
  178. %{_mandir}/man1/rspamc.*
  179. %{_mandir}/man1/rspamadm.*
  180. %{_bindir}/rspamd
  181. %{_bindir}/rspamd-*
  182. %{_bindir}/rspamd_stats
  183. %{_bindir}/rspamc
  184. %{_bindir}/rspamc-*
  185. %{_bindir}/rspamadm
  186. %{_bindir}/rspamadm-*
  187. %attr(-, %{rspamd_user}, %{rspamd_group}) %dir %{rspamd_home}
  188. %dir %{rspamd_confdir}
  189. %dir %{rspamd_confdir}/modules.d
  190. %dir %{rspamd_confdir}/local.d
  191. %dir %{rspamd_confdir}/maps.d
  192. %dir %{rspamd_confdir}/override.d
  193. %dir %{rspamd_confdir}/scores.d
  194. %dir %{rspamd_wwwdir}
  195. %dir %{_libdir}/rspamd
  196. %config(noreplace) %{rspamd_confdir}/*.conf
  197. %config(noreplace) %{rspamd_confdir}/*.inc
  198. %config(noreplace) %{rspamd_confdir}/maps.d/*
  199. %config(noreplace) %{rspamd_confdir}/modules.d/*
  200. %config(noreplace) %{rspamd_confdir}/scores.d/*
  201. %dir %{rspamd_pluginsdir}
  202. %{rspamd_pluginsdir}/*.lua
  203. %dir %{_datadir}/rspamd/lualib
  204. %dir %{_datadir}/rspamd/lualib/lua_content
  205. %dir %{_datadir}/rspamd/lualib/lua_ffi
  206. %dir %{_datadir}/rspamd/lualib/lua_magic
  207. %dir %{_datadir}/rspamd/lualib/lua_selectors
  208. %dir %{_datadir}/rspamd/lualib/lua_scanners
  209. %dir %{_datadir}/rspamd/lualib/plugins
  210. %dir %{_datadir}/rspamd/lualib/redis_scripts
  211. %dir %{_datadir}/rspamd/lualib/rspamadm
  212. %{_datadir}/rspamd/lualib/*.lua
  213. %{_datadir}/rspamd/lualib/lua_content/*.lua
  214. %{_datadir}/rspamd/lualib/lua_ffi/*.lua
  215. %{_datadir}/rspamd/lualib/lua_magic/*.lua
  216. %{_datadir}/rspamd/lualib/lua_selectors/*.lua
  217. %{_datadir}/rspamd/lualib/lua_scanners/*.lua
  218. %{_datadir}/rspamd/lualib/plugins/*.lua
  219. %{_datadir}/rspamd/lualib/redis_scripts/*.lua
  220. %{_datadir}/rspamd/lualib/rspamadm/*.lua
  221. %dir %{rspamd_rulesdir}
  222. %dir %{rspamd_rulesdir}/regexp
  223. %{rspamd_rulesdir}/regexp/*.lua
  224. %dir %{rspamd_rulesdir}/controller
  225. %{rspamd_rulesdir}/controller/*.lua
  226. %{rspamd_rulesdir}/*.lua
  227. %{rspamd_wwwdir}/*
  228. %{_libdir}/rspamd/*
  229. %{_datadir}/rspamd/effective_tld_names.dat
  230. %dir %{_datadir}/rspamd/languages
  231. %{_datadir}/rspamd/languages/*
  232. %dir %{_datadir}/rspamd/elastic
  233. %{_datadir}/rspamd/elastic/*
  234. %changelog
  235. * Wed Nov 01 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.7.3-2
  236. - rebuilt with icu-74.
  237. * Fri Oct 27 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.7.3-1
  238. - new upstream release.
  239. * Fri Oct 27 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.7.2-1
  240. - new upstream release.
  241. * Sun Oct 08 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.7.1-1
  242. - new upstream release.
  243. * Fri Aug 04 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.6-1
  244. - new upstream release.
  245. * Sat Mar 18 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5-1
  246. - new upstream release.
  247. - dropped Patch2-4: fixed in upstream.
  248. * Sun Nov 20 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.4-3
  249. - imported Patch2-4 from upstream.
  250. - enabled hyperscan.
  251. * Wed Nov 02 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.4-2
  252. - disabled hyperscan.
  253. * Wed Nov 02 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.4-1
  254. - new upstream release.
  255. * Wed Oct 19 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.3-2
  256. - rebuilt with libicu72.
  257. * Sun Oct 02 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.3-1
  258. - new upstream release.
  259. * Sun Mar 27 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.2-1
  260. - new upstream release.
  261. * Tue Nov 02 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.1-2
  262. - made to use system fmt and zstd.
  263. * Tue Nov 02 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.1-1
  264. - new upstream release.
  265. - dropped Patch0 and 2: merged into upstream.
  266. - dropped Patch1: fixed in upstream.
  267. * Fri Oct 29 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-4
  268. - rebuilt with icu-70.1.
  269. * Sat Oct 16 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-3
  270. - disabled jemalloc as default: SIGSEGV was occured.
  271. * Sat Oct 16 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-2
  272. - added Patch2 to build with openssl-3.0.0.
  273. - built with jemalloc.
  274. * Thu Aug 19 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-1
  275. - new upstream release.
  276. - updated Patch0.
  277. - imported Patch1 from upstream of doctest to build with glibc-2.34+.
  278. * Thu Apr 08 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.7-2
  279. - rebuilt with icu69.
  280. * Sat Jan 09 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.7-1
  281. - new upstream release.
  282. * Tue Jan 05 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-3
  283. - updated Patch0.
  284. * Thu Oct 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-2
  285. - updated Patch0.
  286. * Fri Oct 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-1
  287. - new upstream release.
  288. - added Patch0 to build with lua-5.4.
  289. * Tue Aug 18 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-3
  290. - rebuilt with current envirionment.
  291. * Fri Apr 24 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-2
  292. - rebuilt with icu-67.
  293. * Thu Apr 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-1
  294. - new upstream release.
  295. * Thu Mar 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4-2
  296. - rebuilt with libicu66.
  297. * Sat Mar 07 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4-1
  298. - initial build for Vine Linux.