rspamd-vl.spec 8.5 KB

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