source: projects/specs/trunk/r/rspamd/rspamd-vl.spec @ 12520

Revision 12520, 7.6 KB checked in by tomop, 3 years ago (diff)

updated 5 packages

dovecot-2.3.13-1

nodejs-14.15.4-1

php74-7.4.14-1

postfix-3.5.9-1

rspamd-2.7-1

Line 
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
12Summary:        Rapid spam filtering system
13Name:           rspamd
14Version:        2.7
15Release:        1%{?_dist_release}%{?with_systemd:.systemd}
16Group:          servers
17Vendor:         Project Vine
18Distribution:   Vine Linux
19
20License:        ASL 2.0
21URL:            https://rspamd.com
22Source0:        https://github.com/rspamd/rspamd/archive/%{version}.tar.gz#/%{name}-%{version}.tar.xz
23Patch0:         rspamd-2.7-lua54.patch
24
25BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}
26
27BuildRequires:  cmake
28BuildRequires:  file-devel
29BuildRequires:  glib2-devel
30BuildRequires:  gmime-devel
31%ifarch x86_64
32BuildRequires:  hyperscan-devel
33%endif
34BuildRequires:  libevent-devel
35BuildRequires:  libicu-devel
36BuildRequires:  libsodium-devel
37BuildRequires:  libunwind-devel
38BuildRequires:  lua-devel
39BuildRequires:  openssl-devel
40BuildRequires:  pcre2-devel
41BuildRequires:  perl
42BuildRequires:  ragel
43BuildRequires:  sqlite3-devel
44%if %{with systemd}
45BuildRequires:  systemd
46%endif
47
48Requires:       logrotate
49Requires(pre):  shadow-utils
50%if %{with systemd}
51Requires(pre):  systemd
52Requires(post): systemd
53Requires(preun): systemd
54Requires(postun): systemd
55%else
56Requires(post): chkconfig
57Requires(preun): chkconfig, initscripts
58Requires(postun): initscripts
59%endif
60
61%description
62Rspamd is a rapid, modular and lightweight spam filter. It is designed to work
63with big amount of mail and can be easily extended with own filters written in
64lua.
65
66
67%debug_package
68
69
70%prep
71%autosetup -p1
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
114pushd ./centos/sources/
115
116%if %{with systemd}
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
131popd
132
133
134%clean
135rm -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
149systemctl --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
159if [ $1 = 0 -o -x /bin/systemctl ]; then
160    /sbin/service %{name} stop >/dev/null 2>&1
161    /sbin/chkconfig --del %{name}
162fi
163%endif
164
165%postun
166%if %{with systemd}
167%systemd_postun_with_restart %{name}.service
168%else
169if [ $1 -ge 1 ]; then
170    /sbin/service %{name} condrestart > /dev/null 2>&1 || :
171fi
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
220%dir %{_datadir}/rspamd/lualib/plugins
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/plugins/*.lua
229%{_datadir}/rspamd/lualib/rspamadm/*.lua
230%dir %{rspamd_rulesdir}
231%dir %{rspamd_rulesdir}/regexp
232%{rspamd_rulesdir}/regexp/*.lua
233%dir %{rspamd_rulesdir}/controller
234%{rspamd_rulesdir}/controller/*.lua
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
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
252* Thu Oct 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-2
253- updated Patch0.
254
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
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.
Note: See TracBrowser for help on using the repository browser.