rspamd-vl.spec 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254
  1. %bcond_with systemd
  2. %define rspamd_user _rspamd
  3. %define rspamd_group %{rspamd_user}
  4. %define rspamd_home %{_localstatedir}/lib/rspamd
  5. %define rspamd_logdir %{_localstatedir}/log/rspamd
  6. %define rspamd_confdir %{_sysconfdir}/rspamd
  7. %define rspamd_pluginsdir %{_datadir}/rspamd/plugins
  8. %define rspamd_rulesdir %{_datadir}/rspamd/rules
  9. %define rspamd_wwwdir %{_datadir}/rspamd/www
  10. Name: rspamd
  11. Version: 2.5
  12. Release: 3%{?_dist_release}%{?with_systemd:.systemd}
  13. Summary: Rapid spam filtering system
  14. Group: servers
  15. Vendor: Project Vine
  16. Distribution: Vine Linux
  17. License: ASL 2.0
  18. URL: https://rspamd.com
  19. Source0: https://github.com/rspamd/rspamd/archive/%{version}.tar.gz#/%{name}-%{version}.tar.xz
  20. BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
  21. BuildRequires: cmake
  22. BuildRequires: file-devel
  23. BuildRequires: glib2-devel
  24. BuildRequires: gmime-devel
  25. %ifarch x86_64
  26. BuildRequires: hyperscan-devel
  27. %endif
  28. BuildRequires: libevent-devel
  29. BuildRequires: libicu-devel
  30. BuildRequires: libsodium-devel
  31. BuildRequires: libunwind-devel
  32. BuildRequires: lua-devel
  33. BuildRequires: openssl-devel
  34. BuildRequires: pcre2-devel
  35. BuildRequires: perl
  36. BuildRequires: ragel
  37. BuildRequires: sqlite3-devel
  38. %if %{with systemd}
  39. BuildRequires: systemd
  40. %endif
  41. Requires: logrotate
  42. Requires(pre): shadow-utils
  43. %if %{with systemd}
  44. Requires(pre): systemd
  45. Requires(post): systemd
  46. Requires(preun): systemd
  47. Requires(postun): systemd
  48. %else
  49. Requires(post): chkconfig
  50. Requires(preun): chkconfig, initscripts
  51. Requires(postun): initscripts
  52. %endif
  53. %description
  54. Rspamd is a rapid, modular and lightweight spam filter. It is designed to work
  55. with big amount of mail and can be easily extended with own filters written in
  56. lua.
  57. %debug_package
  58. %prep
  59. %setup -q
  60. %build
  61. %{__cmake} \
  62. -DCMAKE_C_OPT_FLAGS="%{optflags}" \
  63. -DCMAKE_INSTALL_PREFIX=%{_prefix} \
  64. -DCONFDIR=%{_sysconfdir}/rspamd \
  65. -DINCLUDEDIR=%{_includedir} \
  66. -DLIBDIR=%{_libdir}/rspamd/ \
  67. -DMANDIR=%{_mandir} \
  68. -DSHAREDIR=%{_datadir}/rspamd \
  69. -DDBDIR=%{_localstatedir}/lib/rspamd \
  70. -DRUNDIR=%{_localstatedir}/run/rspamd \
  71. -DLOGDIR=%{_localstatedir}/log/rspamd \
  72. -DEXAMPLESDIR=%{_datadir}/examples/rspamd \
  73. -DNO_SHARED=ON \
  74. -DDEBIAN_BUILD=0 \
  75. -DRSPAMD_GROUP=%{rspamd_group} \
  76. -DRSPAMD_USER=%{rspamd_user} \
  77. %if %{with systemd}
  78. -DWANT_SYSTEMD_UNITS=ON \
  79. -DSYSTEMDDIR=%{_unitdir} \
  80. %else
  81. -DWANT_SYSTEMD_UNITS=OFF \
  82. -DDISABLE_PTHREAD_MUTEX=1 \
  83. %endif
  84. %ifarch x86_64
  85. -DENABLE_HYPERSCAN=ON \
  86. %endif
  87. -DENABLE_LIBUNWIND=ON \
  88. -DENABLE_LUAJIT=OFF \
  89. -DENABLE_PCRE2=ON \
  90. %nil
  91. #-DCMAKE_SKIP_INSTALL_RPATH=ON \
  92. %{__make} %{?_smp_mflags}
  93. %install
  94. %{__make} install DESTDIR=%{buildroot} INSTALLDIRS=vendor
  95. pushd ./centos/sources/
  96. %{__install} -p -D -m 0644 80-rspamd.preset %{buildroot}%{_presetdir}/80-rspamd.preset
  97. %if %{with systemd}
  98. %{__install} -p -D -m 0644 %{name}.logrotate.systemd %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
  99. %{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir}
  100. %else
  101. %{__install} -p -D -m 0755 %{name}.init %{buildroot}%{_initrddir}/%{name}
  102. %{__install} -d -p -m 0755 %{buildroot}%{_localstatedir}/run/rspamd
  103. %{__install} -p -D -m 0644 %{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
  104. %{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir}
  105. %endif
  106. %{__install} -d -p -m 0755 %{buildroot}%{rspamd_home}
  107. %{__install} -p -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/local.d/
  108. %{__install} -p -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/override.d/
  109. popd
  110. %clean
  111. rm -rf %{buildroot}
  112. %pre
  113. %{_sbindir}/groupadd -r %{rspamd_group} 2>/dev/null || :
  114. %{_sbindir}/useradd -g %{rspamd_group} -c "Rspamd user" -s /bin/false -r -d %{rspamd_home} %{rspamd_user} 2>/dev/null || :
  115. %post
  116. #to allow easy upgrade from 0.8.1
  117. %{__chown} -R %{rspamd_user}:%{rspamd_group} %{rspamd_home}
  118. %if %{with systemd}
  119. #Macro is not used as we want to do this on upgrade
  120. #%systemd_post %{name}.service
  121. systemctl --no-reload preset %{name}.service >/dev/null 2>&1 || :
  122. %{__chown} %{rspamd_user}:%{rspamd_group} %{rspamd_logdir}
  123. %else
  124. /sbin/chkconfig --add %{name}
  125. %endif
  126. %preun
  127. %if %{with systemd}
  128. %systemd_preun %{name}.service
  129. %else
  130. if [ $1 = 0 -o -x /bin/systemctl ]; then
  131. /sbin/service %{name} stop >/dev/null 2>&1
  132. /sbin/chkconfig --del %{name}
  133. fi
  134. %endif
  135. %postun
  136. %if %{with systemd}
  137. %systemd_postun_with_restart %{name}.service
  138. %else
  139. if [ $1 -ge 1 ]; then
  140. /sbin/service %{name} condrestart > /dev/null 2>&1 || :
  141. fi
  142. %endif
  143. %files
  144. %defattr(-,root,root,-)
  145. %license LICENSE.md
  146. %doc AUTHORS.md ChangeLog README.md
  147. %if %{with systemd}
  148. %{_unitdir}/%{name}.service
  149. %{_presetdir}/80-rspamd.preset
  150. %else
  151. %{_initrddir}/%{name}
  152. %dir %{_localstatedir}/run/rspamd
  153. %endif
  154. %config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
  155. %dir %{rspamd_logdir}
  156. %{_mandir}/man8/%{name}.*
  157. %{_mandir}/man1/rspamc.*
  158. %{_mandir}/man1/rspamadm.*
  159. %{_bindir}/rspamd
  160. %{_bindir}/rspamd-*
  161. %{_bindir}/rspamd_stats
  162. %{_bindir}/rspamc
  163. %{_bindir}/rspamc-*
  164. %{_bindir}/rspamadm
  165. %{_bindir}/rspamadm-*
  166. %attr(-, %{rspamd_user}, %{rspamd_group}) %dir %{rspamd_home}
  167. %dir %{rspamd_rulesdir}/regexp
  168. %dir %{rspamd_rulesdir}
  169. %dir %{rspamd_confdir}
  170. %dir %{rspamd_confdir}/modules.d
  171. %dir %{rspamd_confdir}/local.d
  172. %dir %{rspamd_confdir}/maps.d
  173. %dir %{rspamd_confdir}/override.d
  174. %dir %{rspamd_confdir}/scores.d
  175. %dir %{rspamd_wwwdir}
  176. %dir %{_libdir}/rspamd
  177. %config(noreplace) %{rspamd_confdir}/*.conf
  178. %config(noreplace) %{rspamd_confdir}/*.inc
  179. %config(noreplace) %{rspamd_confdir}/maps.d/*
  180. %config(noreplace) %{rspamd_confdir}/modules.d/*
  181. %config(noreplace) %{rspamd_confdir}/scores.d/*
  182. %dir %{rspamd_pluginsdir}
  183. %{rspamd_pluginsdir}/*.lua
  184. %dir %{_datadir}/rspamd/lualib
  185. %dir %{_datadir}/rspamd/lualib/lua_content
  186. %dir %{_datadir}/rspamd/lualib/lua_ffi
  187. %dir %{_datadir}/rspamd/lualib/lua_magic
  188. %dir %{_datadir}/rspamd/lualib/lua_selectors
  189. %dir %{_datadir}/rspamd/lualib/lua_scanners
  190. %dir %{_datadir}/rspamd/lualib/rspamadm
  191. %{_datadir}/rspamd/lualib/*.lua
  192. %{_datadir}/rspamd/lualib/lua_content/*.lua
  193. %{_datadir}/rspamd/lualib/lua_ffi/*.lua
  194. %{_datadir}/rspamd/lualib/lua_magic/*.lua
  195. %{_datadir}/rspamd/lualib/lua_selectors/*.lua
  196. %{_datadir}/rspamd/lualib/lua_scanners/*.lua
  197. %{_datadir}/rspamd/lualib/rspamadm/*.lua
  198. %{rspamd_rulesdir}/regexp/*.lua
  199. %{rspamd_rulesdir}/*.lua
  200. %{rspamd_wwwdir}/*
  201. %{_libdir}/rspamd/*
  202. %{_datadir}/rspamd/effective_tld_names.dat
  203. %dir %{_datadir}/rspamd/languages
  204. %{_datadir}/rspamd/languages/*
  205. %dir %{_datadir}/rspamd/elastic
  206. %{_datadir}/rspamd/elastic/*
  207. %changelog
  208. * Tue Aug 18 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-3
  209. - rebuilt with current envirionment.
  210. * Fri Apr 24 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-2
  211. - rebuilt with icu-67.
  212. * Thu Apr 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-1
  213. - new upstream release.
  214. * Thu Mar 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4-2
  215. - rebuilt with libicu66.
  216. * Sat Mar 07 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4-1
  217. - initial build for Vine Linux.