rspamd-vl.spec 8.7 KB

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