[12476] | 1 | %bcond_with systemd |
---|
| 2 | |
---|
| 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 | |
---|
[12502] | 12 | Summary: Rapid spam filtering system |
---|
[12476] | 13 | Name: rspamd |
---|
[12520] | 14 | Version: 2.7 |
---|
| 15 | Release: 1%{?_dist_release}%{?with_systemd:.systemd} |
---|
[12476] | 16 | Group: servers |
---|
| 17 | Vendor: Project Vine |
---|
| 18 | Distribution: Vine Linux |
---|
| 19 | |
---|
| 20 | License: ASL 2.0 |
---|
| 21 | URL: https://rspamd.com |
---|
| 22 | Source0: https://github.com/rspamd/rspamd/archive/%{version}.tar.gz#/%{name}-%{version}.tar.xz |
---|
[12520] | 23 | Patch0: rspamd-2.7-lua54.patch |
---|
[12502] | 24 | |
---|
[12476] | 25 | BuildRoot: %{_tmppath}/%{name}-%{version}-%{release} |
---|
| 26 | |
---|
| 27 | BuildRequires: cmake |
---|
| 28 | BuildRequires: file-devel |
---|
| 29 | BuildRequires: glib2-devel |
---|
| 30 | BuildRequires: gmime-devel |
---|
| 31 | %ifarch x86_64 |
---|
| 32 | BuildRequires: hyperscan-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 | |
---|
| 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 | |
---|
| 61 | %description |
---|
| 62 | Rspamd is a rapid, modular and lightweight spam filter. It is designed to work |
---|
| 63 | with big amount of mail and can be easily extended with own filters written in |
---|
| 64 | lua. |
---|
| 65 | |
---|
| 66 | |
---|
| 67 | %debug_package |
---|
| 68 | |
---|
| 69 | |
---|
| 70 | %prep |
---|
[12502] | 71 | %autosetup -p1 |
---|
[12476] | 72 | |
---|
| 73 | |
---|
| 74 | %build |
---|
| 75 | %{__cmake} \ |
---|
| 76 | -DCMAKE_C_OPT_FLAGS="%{optflags}" \ |
---|
| 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=%{_localstatedir}/run/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 | -DENABLE_HYPERSCAN=ON \ |
---|
| 100 | %endif |
---|
| 101 | -DENABLE_LIBUNWIND=ON \ |
---|
| 102 | -DENABLE_LUAJIT=OFF \ |
---|
| 103 | -DENABLE_PCRE2=ON \ |
---|
| 104 | %nil |
---|
| 105 | |
---|
| 106 | #-DCMAKE_SKIP_INSTALL_RPATH=ON \ |
---|
| 107 | |
---|
| 108 | %{__make} %{?_smp_mflags} |
---|
| 109 | |
---|
| 110 | |
---|
| 111 | %install |
---|
| 112 | %{__make} install DESTDIR=%{buildroot} INSTALLDIRS=vendor |
---|
| 113 | |
---|
| 114 | pushd ./centos/sources/ |
---|
| 115 | |
---|
[12520] | 116 | %if %{with systemd} |
---|
[12476] | 117 | %{__install} -p -D -m 0644 80-rspamd.preset %{buildroot}%{_presetdir}/80-rspamd.preset |
---|
| 118 | %{__install} -p -D -m 0644 %{name}.logrotate.systemd %{buildroot}%{_sysconfdir}/logrotate.d/%{name} |
---|
| 119 | %{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir} |
---|
| 120 | %else |
---|
| 121 | %{__install} -p -D -m 0755 %{name}.init %{buildroot}%{_initrddir}/%{name} |
---|
| 122 | %{__install} -d -p -m 0755 %{buildroot}%{_localstatedir}/run/rspamd |
---|
| 123 | %{__install} -p -D -m 0644 %{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name} |
---|
| 124 | %{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir} |
---|
| 125 | %endif |
---|
| 126 | |
---|
| 127 | %{__install} -d -p -m 0755 %{buildroot}%{rspamd_home} |
---|
| 128 | %{__install} -p -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/local.d/ |
---|
| 129 | %{__install} -p -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/override.d/ |
---|
| 130 | |
---|
| 131 | popd |
---|
| 132 | |
---|
| 133 | |
---|
| 134 | %clean |
---|
| 135 | rm -rf %{buildroot} |
---|
| 136 | |
---|
| 137 | |
---|
| 138 | %pre |
---|
| 139 | %{_sbindir}/groupadd -r %{rspamd_group} 2>/dev/null || : |
---|
| 140 | %{_sbindir}/useradd -g %{rspamd_group} -c "Rspamd user" -s /bin/false -r -d %{rspamd_home} %{rspamd_user} 2>/dev/null || : |
---|
| 141 | |
---|
| 142 | %post |
---|
| 143 | #to allow easy upgrade from 0.8.1 |
---|
| 144 | %{__chown} -R %{rspamd_user}:%{rspamd_group} %{rspamd_home} |
---|
| 145 | |
---|
| 146 | %if %{with systemd} |
---|
| 147 | #Macro is not used as we want to do this on upgrade |
---|
| 148 | #%systemd_post %{name}.service |
---|
| 149 | systemctl --no-reload preset %{name}.service >/dev/null 2>&1 || : |
---|
| 150 | %{__chown} %{rspamd_user}:%{rspamd_group} %{rspamd_logdir} |
---|
| 151 | %else |
---|
| 152 | /sbin/chkconfig --add %{name} |
---|
| 153 | %endif |
---|
| 154 | |
---|
| 155 | %preun |
---|
| 156 | %if %{with systemd} |
---|
| 157 | %systemd_preun %{name}.service |
---|
| 158 | %else |
---|
| 159 | if [ $1 = 0 -o -x /bin/systemctl ]; then |
---|
| 160 | /sbin/service %{name} stop >/dev/null 2>&1 |
---|
| 161 | /sbin/chkconfig --del %{name} |
---|
| 162 | fi |
---|
| 163 | %endif |
---|
| 164 | |
---|
| 165 | %postun |
---|
| 166 | %if %{with systemd} |
---|
| 167 | %systemd_postun_with_restart %{name}.service |
---|
| 168 | %else |
---|
| 169 | if [ $1 -ge 1 ]; then |
---|
| 170 | /sbin/service %{name} condrestart > /dev/null 2>&1 || : |
---|
| 171 | fi |
---|
| 172 | %endif |
---|
| 173 | |
---|
| 174 | |
---|
| 175 | %files |
---|
| 176 | %defattr(-,root,root,-) |
---|
| 177 | %license LICENSE.md |
---|
| 178 | %doc AUTHORS.md ChangeLog README.md |
---|
| 179 | %if %{with systemd} |
---|
| 180 | %{_unitdir}/%{name}.service |
---|
| 181 | %{_presetdir}/80-rspamd.preset |
---|
| 182 | %else |
---|
| 183 | %{_initrddir}/%{name} |
---|
| 184 | %dir %{_localstatedir}/run/rspamd |
---|
| 185 | %endif |
---|
| 186 | %config(noreplace) %{_sysconfdir}/logrotate.d/%{name} |
---|
| 187 | %dir %{rspamd_logdir} |
---|
| 188 | %{_mandir}/man8/%{name}.* |
---|
| 189 | %{_mandir}/man1/rspamc.* |
---|
| 190 | %{_mandir}/man1/rspamadm.* |
---|
| 191 | %{_bindir}/rspamd |
---|
| 192 | %{_bindir}/rspamd-* |
---|
| 193 | %{_bindir}/rspamd_stats |
---|
| 194 | %{_bindir}/rspamc |
---|
| 195 | %{_bindir}/rspamc-* |
---|
| 196 | %{_bindir}/rspamadm |
---|
| 197 | %{_bindir}/rspamadm-* |
---|
| 198 | %attr(-, %{rspamd_user}, %{rspamd_group}) %dir %{rspamd_home} |
---|
| 199 | %dir %{rspamd_confdir} |
---|
| 200 | %dir %{rspamd_confdir}/modules.d |
---|
| 201 | %dir %{rspamd_confdir}/local.d |
---|
| 202 | %dir %{rspamd_confdir}/maps.d |
---|
| 203 | %dir %{rspamd_confdir}/override.d |
---|
| 204 | %dir %{rspamd_confdir}/scores.d |
---|
| 205 | %dir %{rspamd_wwwdir} |
---|
| 206 | %dir %{_libdir}/rspamd |
---|
| 207 | %config(noreplace) %{rspamd_confdir}/*.conf |
---|
| 208 | %config(noreplace) %{rspamd_confdir}/*.inc |
---|
| 209 | %config(noreplace) %{rspamd_confdir}/maps.d/* |
---|
| 210 | %config(noreplace) %{rspamd_confdir}/modules.d/* |
---|
| 211 | %config(noreplace) %{rspamd_confdir}/scores.d/* |
---|
| 212 | %dir %{rspamd_pluginsdir} |
---|
| 213 | %{rspamd_pluginsdir}/*.lua |
---|
| 214 | %dir %{_datadir}/rspamd/lualib |
---|
| 215 | %dir %{_datadir}/rspamd/lualib/lua_content |
---|
| 216 | %dir %{_datadir}/rspamd/lualib/lua_ffi |
---|
| 217 | %dir %{_datadir}/rspamd/lualib/lua_magic |
---|
| 218 | %dir %{_datadir}/rspamd/lualib/lua_selectors |
---|
| 219 | %dir %{_datadir}/rspamd/lualib/lua_scanners |
---|
[12520] | 220 | %dir %{_datadir}/rspamd/lualib/plugins |
---|
[12476] | 221 | %dir %{_datadir}/rspamd/lualib/rspamadm |
---|
| 222 | %{_datadir}/rspamd/lualib/*.lua |
---|
| 223 | %{_datadir}/rspamd/lualib/lua_content/*.lua |
---|
| 224 | %{_datadir}/rspamd/lualib/lua_ffi/*.lua |
---|
| 225 | %{_datadir}/rspamd/lualib/lua_magic/*.lua |
---|
| 226 | %{_datadir}/rspamd/lualib/lua_selectors/*.lua |
---|
| 227 | %{_datadir}/rspamd/lualib/lua_scanners/*.lua |
---|
[12520] | 228 | %{_datadir}/rspamd/lualib/plugins/*.lua |
---|
[12476] | 229 | %{_datadir}/rspamd/lualib/rspamadm/*.lua |
---|
[12502] | 230 | %dir %{rspamd_rulesdir} |
---|
| 231 | %dir %{rspamd_rulesdir}/regexp |
---|
[12476] | 232 | %{rspamd_rulesdir}/regexp/*.lua |
---|
[12502] | 233 | %dir %{rspamd_rulesdir}/controller |
---|
| 234 | %{rspamd_rulesdir}/controller/*.lua |
---|
[12476] | 235 | %{rspamd_rulesdir}/*.lua |
---|
| 236 | %{rspamd_wwwdir}/* |
---|
| 237 | %{_libdir}/rspamd/* |
---|
| 238 | %{_datadir}/rspamd/effective_tld_names.dat |
---|
| 239 | %dir %{_datadir}/rspamd/languages |
---|
| 240 | %{_datadir}/rspamd/languages/* |
---|
| 241 | %dir %{_datadir}/rspamd/elastic |
---|
| 242 | %{_datadir}/rspamd/elastic/* |
---|
| 243 | |
---|
| 244 | |
---|
| 245 | %changelog |
---|
[12520] | 246 | * Sat Jan 09 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.7-1 |
---|
| 247 | - new upstream release. |
---|
| 248 | |
---|
| 249 | * Tue Jan 05 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-3 |
---|
| 250 | - updated Patch0. |
---|
| 251 | |
---|
[12503] | 252 | * Thu Oct 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-2 |
---|
| 253 | - updated Patch0. |
---|
| 254 | |
---|
[12502] | 255 | * Fri Oct 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-1 |
---|
| 256 | - new upstream release. |
---|
| 257 | - added Patch0 to build with lua-5.4. |
---|
| 258 | |
---|
[12476] | 259 | * Tue Aug 18 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-3 |
---|
| 260 | - rebuilt with current envirionment. |
---|
| 261 | |
---|
| 262 | * Fri Apr 24 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-2 |
---|
| 263 | - rebuilt with icu-67. |
---|
| 264 | |
---|
| 265 | * Thu Apr 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-1 |
---|
| 266 | - new upstream release. |
---|
| 267 | |
---|
| 268 | * Thu Mar 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4-2 |
---|
| 269 | - rebuilt with libicu66. |
---|
| 270 | |
---|
| 271 | * Sat Mar 07 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4-1 |
---|
| 272 | - initial build for Vine Linux. |
---|