rspamd-vl.spec 8.9 KB

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