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