1 Summary: A general purpose content screening and reputation solution
5 Source: %{name}-%{version}.tar.gz
6 License: Apache-2.0 and BSL-1.0
7 Group: Security/Service
10 BuildRequires: pkgconfig(dlog)
11 BuildRequires: pkgconfig(libsystemd-daemon)
12 BuildRequires: pkgconfig(vconf)
13 BuildRequires: pkgconfig(elementary)
14 BuildRequires: pkgconfig(sqlite3)
15 BuildRequires: pkgconfig(pkgmgr)
16 BuildRequires: pkgconfig(glib-2.0)
17 Requires: lib%{name}-common = %{version}-%{release}
21 General purpose content screening and reputation solution. Can scan
22 file contents and checking url to prevent malicious items.
24 %global service_name csr
25 %global bin_dir %{_bindir}
26 %global sbin_dir /sbin
27 %global ro_data_dir %{_datadir}
28 %global rw_data_dir /opt/share
29 %global ro_db_dir %{ro_data_dir}/%{service_name}/dbspace
30 %global rw_db_dir %{rw_data_dir}/%{service_name}/dbspace
31 %global sample_engine_ro_res_dir %{ro_data_dir}/%{service_name}/engine
32 %global sample_engine_rw_working_dir %{rw_data_dir}/%{service_name}/engine
33 %global sample_engine_dir %{_libdir}
34 %global test_dir %{rw_data_dir}/%{service_name}-test
36 %package -n lib%{name}-common
37 Summary: Common library package for %{name}
39 Group: Security/Libraries
40 Requires: %{sbin_dir}/ldconfig
41 Requires: %{sbin_dir}/ldconfig
43 %description -n lib%{name}-common
44 csr-framework common library package.
46 %package -n lib%{name}-client
47 Summary: Client library package for %{name}
49 Group: Security/Libraries
50 BuildRequires: pkgconfig(capi-base-common)
51 Requires: %{name} = %{version}-%{release}
52 Requires: %{sbin_dir}/ldconfig
53 Requires: %{sbin_dir}/ldconfig
55 %description -n lib%{name}-client
56 csr-framework client library package.
59 Summary: Development files for %{name}
61 Group: Security/Development
62 BuildRequires: pkgconfig(capi-base-common)
63 Requires: %{name} = %{version}-%{release}
66 csr-framework developemnt files including headers and pkgconfig file.
69 Summary: test program for %{name}
70 License: Apache-2.0 and BSL-1.0
71 Group: Security/Testing
72 BuildRequires: boost-devel
73 BuildRequires: pkgconfig(pkgmgr-info)
74 Requires: %{name} = %{version}
77 test program of csr-framework
84 -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \
85 -DCMAKE_VERBOSE_MAKEFILE=ON \
86 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
87 -DSERVICE_NAME=%{service_name} \
88 -DVERSION=%{version} \
89 -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \
90 -DBIN_DIR:PATH=%{bin_dir} \
91 -DSYSTEMD_UNIT_DIR=%{_unitdir} \
92 -DSYSTEMD_UNIT_USER_DIR=%{_unitdir_user} \
93 -DRO_DBSPACE:PATH=%{ro_db_dir} \
94 -DRW_DBSPACE:PATH=%{rw_db_dir} \
95 -DSAMPLE_ENGINE_RO_RES_DIR:PATH=%{sample_engine_ro_res_dir} \
96 -DSAMPLE_ENGINE_RW_WORKING_DIR:PATH=%{sample_engine_rw_working_dir} \
97 -DSAMPLE_ENGINE_DIR:PATH=%{sample_engine_dir} \
98 -DTEST_DIR:PATH=%{test_dir}
100 make %{?jobs:-j%jobs}
104 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
105 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
106 ln -s ../%{service_name}.service %{buildroot}%{_unitdir}/multi-user.target.wants/%{service_name}.service
107 ln -s ../%{service_name}.socket %{buildroot}%{_unitdir}/sockets.target.wants/%{service_name}.socket
109 mkdir -p %{buildroot}%{_unitdir}/default.target.wants
110 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
111 ln -s ../%{service_name}-popup.service %{buildroot}%{_unitdir}/default.target.wants/%{service_name}-popup.service
112 ln -s ../%{service_name}-popup.socket %{buildroot}%{_unitdir}/sockets.target.wants/%{service_name}-popup.socket
114 mkdir -p %{buildroot}%{ro_data_dir}/license
115 cp LICENSE %{buildroot}%{ro_data_dir}/license/%{name}
116 cp LICENSE.BSL-1.0 %{buildroot}%{ro_data_dir}/license/%{name}.BSL-1.0
117 cp LICENSE %{buildroot}%{ro_data_dir}/license/lib%{name}-client
118 cp LICENSE %{buildroot}%{ro_data_dir}/license/lib%{name}-common
119 cp LICENSE %{buildroot}%{ro_data_dir}/license/%{name}-test
120 cp LICENSE.BSL-1.0 %{buildroot}%{ro_data_dir}/license/%{name}-test.BSL-1.0
122 mkdir -p %{buildroot}%{ro_db_dir}
123 mkdir -p %{buildroot}%{rw_db_dir}
124 mkdir -p %{buildroot}%{sample_engine_ro_res_dir}
125 cp data/scripts/*.sql %{buildroot}%{ro_db_dir}
128 systemctl daemon-reload
130 systemctl start %{service_name}.socket
131 systemctl start %{service_name}.service
132 systemctl start %{service_name}-popup.socket
136 systemctl restart %{service_name}.socket
137 systemctl restart %{service_name}.service
138 systemctl restart %{service_name}-popup.socket
143 systemctl stop %{service_name}.service
144 systemctl stop %{service_name}.socket
145 systemctl stop %{service_name}-popup.socket
150 systemctl daemon-reload
153 %post -n lib%{name}-common -p %{sbin_dir}/ldconfig
154 %post -n lib%{name}-client -p %{sbin_dir}/ldconfig
155 %postun -n lib%{name}-common -p %{sbin_dir}/ldconfig
156 %postun -n lib%{name}-client -p %{sbin_dir}/ldconfig
159 %defattr(-,root,root,-)
160 %manifest %{service_name}.manifest
161 %{ro_data_dir}/license/%{name}
162 %{ro_data_dir}/license/%{name}.BSL-1.0
163 %{bin_dir}/%{service_name}-server
164 %{bin_dir}/%{service_name}-popup
165 %{_unitdir}/multi-user.target.wants/%{service_name}.service
166 %{_unitdir}/%{service_name}.service
167 %{_unitdir}/sockets.target.wants/%{service_name}.socket
168 %{_unitdir}/%{service_name}.socket
169 %{_unitdir}/default.target.wants/%{service_name}-popup.service
170 %{_unitdir}/%{service_name}-popup.service
171 %{_unitdir}/sockets.target.wants/%{service_name}-popup.socket
172 %{_unitdir}/%{service_name}-popup.socket
174 %dir %{ro_data_dir}/%{service_name}
175 %dir %{rw_data_dir}/%{service_name}
178 %attr(444, system, system) %{ro_db_dir}/*.sql
180 # sample engine related files
181 %dir %{sample_engine_dir}
182 %dir %{sample_engine_ro_res_dir}
183 %dir %attr(775, system, system) %{sample_engine_rw_working_dir}
184 %{sample_engine_dir}/lib%{service_name}-cs-engine.so
185 %{sample_engine_dir}/lib%{service_name}-wp-engine.so
186 %attr(-, system, system) %{sample_engine_rw_working_dir}/*
188 %files -n lib%{name}-common
189 %defattr(-,root,root,-)
190 %manifest %{service_name}-common.manifest
191 %{ro_data_dir}/license/lib%{name}-common
192 %{_libdir}/lib%{service_name}-common.so.*
194 %files -n lib%{name}-client
195 %defattr(-,root,root,-)
196 %manifest %{service_name}-client.manifest
197 %{ro_data_dir}/license/lib%{name}-client
198 %{_libdir}/lib%{service_name}-client.so.*
201 %defattr(-,root,root,-)
202 %{_includedir}/csr/content-screening.h
203 %{_includedir}/csr/content-screening-types.h
204 %{_includedir}/csr/web-protection.h
205 %{_includedir}/csr/web-protection-types.h
206 %{_includedir}/csr/error.h
207 %{_includedir}/csr/engine-manager.h
208 %{_libdir}/pkgconfig/%{service_name}.pc
209 %{_libdir}/lib%{service_name}-client.so
210 %{_libdir}/lib%{service_name}-common.so
213 %defattr(-,root,root,-)
214 %manifest %{service_name}-test.manifest
215 %{ro_data_dir}/license/%{name}-test
216 %{ro_data_dir}/license/%{name}-test.BSL-1.0
217 %{bin_dir}/%{service_name}-test
218 %{bin_dir}/%{service_name}-popup-test
219 %{bin_dir}/%{service_name}-threadpool-test