rspamd-vl.spec 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  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.9.1
  15. Release: 1%{?_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. %ifarch x86_64
  31. BuildRequires: hyperscan-devel
  32. %endif
  33. %if %{with jemalloc}
  34. BuildRequires: jemalloc-devel
  35. %endif
  36. BuildRequires: libarchive-devel
  37. BuildRequires: libicu-devel
  38. BuildRequires: libsodium-devel
  39. BuildRequires: libunwind-devel
  40. BuildRequires: lua-devel
  41. BuildRequires: openssl-devel
  42. BuildRequires: pcre2-devel
  43. BuildRequires: perl
  44. BuildRequires: ragel
  45. BuildRequires: sqlite3-devel
  46. BuildRequires: xxhash-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=%{_rundir}/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. -DSYSTEM_XXHASH=ON \
  104. -DENABLE_LIBUNWIND=ON \
  105. -DENABLE_LUAJIT=OFF \
  106. -DENABLE_PCRE2=ON \
  107. %if %{with jemalloc}
  108. -DENABLE_JEMALLOC=ON \
  109. %endif
  110. %nil
  111. %cmake_build
  112. %install
  113. %cmake_install
  114. pushd ./rpm/
  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 [ -d /var/lib/rspamd/ ]; then
  138. find /var/lib/rspamd/ -name "*.unser" -delete
  139. fi
  140. %if %{with systemd}
  141. #Macro is not used as we want to do this on upgrade
  142. #%systemd_post %{name}.service
  143. systemctl --no-reload preset %{name}.service >/dev/null 2>&1 || :
  144. %{__chown} %{rspamd_user}:%{rspamd_group} %{rspamd_logdir}
  145. %else
  146. /sbin/chkconfig --add %{name}
  147. %endif
  148. %preun
  149. %if %{with systemd}
  150. %systemd_preun %{name}.service
  151. %else
  152. if [ $1 = 0 -o -x /bin/systemctl ]; then
  153. /sbin/service %{name} stop >/dev/null 2>&1
  154. /sbin/chkconfig --del %{name}
  155. fi
  156. %endif
  157. %postun
  158. %if %{with systemd}
  159. %systemd_postun_with_restart %{name}.service
  160. %else
  161. if [ $1 -ge 1 ]; then
  162. /sbin/service %{name} condrestart > /dev/null 2>&1 || :
  163. fi
  164. %endif
  165. %files
  166. %defattr(-,root,root,-)
  167. %license LICENSE.md
  168. %doc AUTHORS.md ChangeLog README.md
  169. %if %{with systemd}
  170. %{_unitdir}/%{name}.service
  171. %{_presetdir}/80-rspamd.preset
  172. %else
  173. %{_initrddir}/%{name}
  174. %dir %{_localstatedir}/run/rspamd
  175. %endif
  176. %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
  177. %dir %{rspamd_logdir}
  178. %{_mandir}/man8/%{name}.*
  179. %{_mandir}/man1/rspamc.*
  180. %{_mandir}/man1/rspamadm.*
  181. %{_bindir}/rspamd
  182. %{_bindir}/rspamd-*
  183. %{_bindir}/rspamd_stats
  184. %{_bindir}/rspamc
  185. %{_bindir}/rspamc-*
  186. %{_bindir}/rspamadm
  187. %{_bindir}/rspamadm-*
  188. %attr(-, %{rspamd_user}, %{rspamd_group}) %dir %{rspamd_home}
  189. %dir %{rspamd_confdir}
  190. %dir %{rspamd_confdir}/modules.d
  191. %dir %{rspamd_confdir}/local.d
  192. %dir %{rspamd_confdir}/maps.d
  193. %dir %{rspamd_confdir}/override.d
  194. %dir %{rspamd_confdir}/scores.d
  195. %dir %{rspamd_wwwdir}
  196. %dir %{_libdir}/rspamd
  197. %config(noreplace) %{rspamd_confdir}/*.conf
  198. %config(noreplace) %{rspamd_confdir}/*.inc
  199. %config(noreplace) %{rspamd_confdir}/maps.d/*
  200. %config(noreplace) %{rspamd_confdir}/modules.d/*
  201. %config(noreplace) %{rspamd_confdir}/scores.d/*
  202. %dir %{rspamd_pluginsdir}
  203. %{rspamd_pluginsdir}/*.lua
  204. %dir %{_datadir}/rspamd/lualib
  205. %dir %{_datadir}/rspamd/lualib/lua_content
  206. %dir %{_datadir}/rspamd/lualib/lua_ffi
  207. %dir %{_datadir}/rspamd/lualib/lua_magic
  208. %dir %{_datadir}/rspamd/lualib/lua_selectors
  209. %dir %{_datadir}/rspamd/lualib/lua_scanners
  210. %dir %{_datadir}/rspamd/lualib/plugins
  211. %dir %{_datadir}/rspamd/lualib/redis_scripts
  212. %dir %{_datadir}/rspamd/lualib/rspamadm
  213. %{_datadir}/rspamd/lualib/*.lua
  214. %{_datadir}/rspamd/lualib/lua_content/*.lua
  215. %{_datadir}/rspamd/lualib/lua_ffi/*.lua
  216. %{_datadir}/rspamd/lualib/lua_magic/*.lua
  217. %{_datadir}/rspamd/lualib/lua_selectors/*.lua
  218. %{_datadir}/rspamd/lualib/lua_scanners/*.lua
  219. %{_datadir}/rspamd/lualib/plugins/*.lua
  220. %{_datadir}/rspamd/lualib/redis_scripts/*.lua
  221. %{_datadir}/rspamd/lualib/rspamadm/*.lua
  222. %dir %{rspamd_rulesdir}
  223. %dir %{rspamd_rulesdir}/regexp
  224. %{rspamd_rulesdir}/regexp/*.lua
  225. %dir %{rspamd_rulesdir}/controller
  226. %{rspamd_rulesdir}/controller/*.lua
  227. %{rspamd_rulesdir}/*.lua
  228. %{rspamd_wwwdir}/*
  229. %{_libdir}/rspamd/*
  230. %{_datadir}/rspamd/effective_tld_names.dat
  231. %dir %{_datadir}/rspamd/languages
  232. %{_datadir}/rspamd/languages/*
  233. %dir %{_datadir}/rspamd/elastic
  234. %{_datadir}/rspamd/elastic/*
  235. %changelog
  236. * Tue Jul 23 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.9.1-1
  237. - new upstream release.
  238. * Sat Jul 13 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.9.0-1
  239. - new upstream release.
  240. * Mon Feb 26 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.4-1
  241. - new upstream release.
  242. * Sun Feb 25 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.3-1
  243. - new upstream release.
  244. * Wed Feb 21 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.2-1
  245. - new upstream release.
  246. * Sat Jan 27 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.8.1-1
  247. - new upstream release.
  248. * Sat Dec 16 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.7.5-1
  249. - new upstream release.
  250. * Wed Nov 15 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.7.4-1
  251. - new upstream release.
  252. * Wed Nov 01 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.7.3-2
  253. - rebuilt with icu-74.
  254. * Fri Oct 27 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.7.3-1
  255. - new upstream release.
  256. * Fri Oct 27 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.7.2-1
  257. - new upstream release.
  258. * Sun Oct 08 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.7.1-1
  259. - new upstream release.
  260. * Fri Aug 04 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.6-1
  261. - new upstream release.
  262. * Sat Mar 18 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.5-1
  263. - new upstream release.
  264. - dropped Patch2-4: fixed in upstream.
  265. * Sun Nov 20 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.4-3
  266. - imported Patch2-4 from upstream.
  267. - enabled hyperscan.
  268. * Wed Nov 02 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.4-2
  269. - disabled hyperscan.
  270. * Wed Nov 02 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.4-1
  271. - new upstream release.
  272. * Wed Oct 19 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.3-2
  273. - rebuilt with libicu72.
  274. * Sun Oct 02 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.3-1
  275. - new upstream release.
  276. * Sun Mar 27 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.2-1
  277. - new upstream release.
  278. * Tue Nov 02 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.1-2
  279. - made to use system fmt and zstd.
  280. * Tue Nov 02 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.1-1
  281. - new upstream release.
  282. - dropped Patch0 and 2: merged into upstream.
  283. - dropped Patch1: fixed in upstream.
  284. * Fri Oct 29 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-4
  285. - rebuilt with icu-70.1.
  286. * Sat Oct 16 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-3
  287. - disabled jemalloc as default: SIGSEGV was occured.
  288. * Sat Oct 16 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-2
  289. - added Patch2 to build with openssl-3.0.0.
  290. - built with jemalloc.
  291. * Thu Aug 19 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.0-1
  292. - new upstream release.
  293. - updated Patch0.
  294. - imported Patch1 from upstream of doctest to build with glibc-2.34+.
  295. * Thu Apr 08 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.7-2
  296. - rebuilt with icu69.
  297. * Sat Jan 09 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.7-1
  298. - new upstream release.
  299. * Tue Jan 05 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-3
  300. - updated Patch0.
  301. * Thu Oct 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-2
  302. - updated Patch0.
  303. * Fri Oct 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-1
  304. - new upstream release.
  305. - added Patch0 to build with lua-5.4.
  306. * Tue Aug 18 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-3
  307. - rebuilt with current envirionment.
  308. * Fri Apr 24 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-2
  309. - rebuilt with icu-67.
  310. * Thu Apr 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-1
  311. - new upstream release.
  312. * Thu Mar 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4-2
  313. - rebuilt with libicu66.
  314. * Sat Mar 07 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4-1
  315. - initial build for Vine Linux.