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

Revision 12503, 7.3 KB checked in by tomop, 3 years ago (diff)

updated 5 packages

mariadb-10.5.6-1

nsd-4.3.3-1

pcre2-10.35-1

rspamd-2.6-2

unbound-1.12.0-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.6
15Release:        2%{?_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.6-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%{__install} -p -D -m 0644 80-rspamd.preset %{buildroot}%{_presetdir}/80-rspamd.preset
117
118%if %{with systemd}
119%{__install} -p -D -m 0644 %{name}.logrotate.systemd %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
120%{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir}
121%else
122%{__install} -p -D -m 0755 %{name}.init %{buildroot}%{_initrddir}/%{name}
123%{__install} -d -p -m 0755 %{buildroot}%{_localstatedir}/run/rspamd
124%{__install} -p -D -m 0644 %{name}.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
125%{__install} -d -p -m 0755 %{buildroot}%{rspamd_logdir}
126%endif
127
128%{__install} -d -p -m 0755 %{buildroot}%{rspamd_home}
129%{__install} -p -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/local.d/
130%{__install} -p -D -d -m 0755 %{buildroot}%{_sysconfdir}/%{name}/override.d/
131
132popd
133
134
135%clean
136rm -rf %{buildroot}
137
138
139%pre
140%{_sbindir}/groupadd -r %{rspamd_group} 2>/dev/null || :
141%{_sbindir}/useradd -g %{rspamd_group} -c "Rspamd user" -s /bin/false -r -d %{rspamd_home} %{rspamd_user} 2>/dev/null || :
142
143%post
144#to allow easy upgrade from 0.8.1
145%{__chown} -R %{rspamd_user}:%{rspamd_group} %{rspamd_home}
146
147%if %{with systemd}
148#Macro is not used as we want to do this on upgrade
149#%systemd_post %{name}.service
150systemctl --no-reload preset %{name}.service >/dev/null 2>&1 || :
151%{__chown} %{rspamd_user}:%{rspamd_group} %{rspamd_logdir}
152%else
153/sbin/chkconfig --add %{name}
154%endif
155
156%preun
157%if %{with systemd}
158%systemd_preun %{name}.service
159%else
160if [ $1 = 0 -o -x /bin/systemctl ]; then
161    /sbin/service %{name} stop >/dev/null 2>&1
162    /sbin/chkconfig --del %{name}
163fi
164%endif
165
166%postun
167%if %{with systemd}
168%systemd_postun_with_restart %{name}.service
169%else
170if [ $1 -ge 1 ]; then
171    /sbin/service %{name} condrestart > /dev/null 2>&1 || :
172fi
173%endif
174
175
176%files
177%defattr(-,root,root,-)
178%license LICENSE.md
179%doc AUTHORS.md ChangeLog README.md
180%if %{with systemd}
181%{_unitdir}/%{name}.service
182%{_presetdir}/80-rspamd.preset
183%else
184%{_initrddir}/%{name}
185%dir %{_localstatedir}/run/rspamd
186%endif
187%config(noreplace) %{_sysconfdir}/logrotate.d/%{name}
188%dir %{rspamd_logdir}
189%{_mandir}/man8/%{name}.*
190%{_mandir}/man1/rspamc.*
191%{_mandir}/man1/rspamadm.*
192%{_bindir}/rspamd
193%{_bindir}/rspamd-*
194%{_bindir}/rspamd_stats
195%{_bindir}/rspamc
196%{_bindir}/rspamc-*
197%{_bindir}/rspamadm
198%{_bindir}/rspamadm-*
199%attr(-, %{rspamd_user}, %{rspamd_group}) %dir %{rspamd_home}
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%dir %{rspamd_rulesdir}
230%dir %{rspamd_rulesdir}/regexp
231%{rspamd_rulesdir}/regexp/*.lua
232%dir %{rspamd_rulesdir}/controller
233%{rspamd_rulesdir}/controller/*.lua
234%{rspamd_rulesdir}/*.lua
235%{rspamd_wwwdir}/*
236%{_libdir}/rspamd/*
237%{_datadir}/rspamd/effective_tld_names.dat
238%dir %{_datadir}/rspamd/languages
239%{_datadir}/rspamd/languages/*
240%dir %{_datadir}/rspamd/elastic
241%{_datadir}/rspamd/elastic/*
242
243
244%changelog
245* Thu Oct 08 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-2
246- updated Patch0.
247
248* Fri Oct 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6-1
249- new upstream release.
250- added Patch0 to build with lua-5.4.
251
252* Tue Aug 18 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-3
253- rebuilt with current envirionment.
254
255* Fri Apr 24 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-2
256- rebuilt with icu-67.
257
258* Thu Apr 02 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.5-1
259- new upstream release.
260
261* Thu Mar 19 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4-2
262- rebuilt with libicu66.
263
264* Sat Mar 07 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.4-1
265- initial build for Vine Linux.
Note: See TracBrowser for help on using the repository browser.