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 Requires: lib%{name}-common = %{version}-%{release}
19 General purpose content screening and reputation solution. Can scan
20 file contents and checking url to prevent malicious items.
22 %global service_name csr
23 %global bin_dir %{_bindir}
24 %global sbin_dir /sbin
25 %global ro_data_dir %{_datadir}
26 %global ro_db_dir %{_datadir}/%{service_name}/dbspace
27 %global rw_db_dir /opt/share//%{service_name}/dbspace
28 %global sample_engine_working_dir /opt/share/%{service_name}/engine
29 %global sample_engine_dir %{_libdir}
30 %global test_dir /opt/share/%{service_name}-test
32 %package -n lib%{name}-common
33 Summary: Common library package for %{name}
35 Group: Security/Libraries
36 Requires: %{sbin_dir}/ldconfig
37 Requires: %{sbin_dir}/ldconfig
39 %description -n lib%{name}-common
40 csr-framework common library package.
42 %package -n lib%{name}-client
43 Summary: Client library package for %{name}
45 Group: Security/Libraries
46 BuildRequires: pkgconfig(capi-base-common)
47 Requires: %{name} = %{version}-%{release}
48 Requires: %{sbin_dir}/ldconfig
49 Requires: %{sbin_dir}/ldconfig
51 %description -n lib%{name}-client
52 csr-framework client library package.
55 Summary: Development files for %{name}
57 Group: Security/Development
58 BuildRequires: pkgconfig(capi-base-common)
59 Requires: %{name} = %{version}-%{release}
62 csr-framework developemnt files including headers and pkgconfig file.
65 Summary: test program for %{name}
66 License: Apache-2.0 and BSL-1.0
67 Group: Security/Testing
68 BuildRequires: boost-devel
69 Requires: %{name} = %{version}
72 test program of csr-framework
79 -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \
80 -DCMAKE_VERBOSE_MAKEFILE=ON \
81 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
82 -DSERVICE_NAME=%{service_name} \
83 -DVERSION=%{version} \
84 -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \
85 -DBIN_DIR:PATH=%{bin_dir} \
86 -DSYSTEMD_UNIT_DIR=%{_unitdir} \
87 -DSYSTEMD_UNIT_USER_DIR=%{_unitdir_user} \
88 -DRO_DBSPACE:PATH=%{ro_db_dir} \
89 -DRW_DBSPACE:PATH=%{rw_db_dir} \
90 -DSAMPLE_ENGINE_WORKING_DIR:PATH=%{sample_engine_working_dir} \
91 -DSAMPLE_ENGINE_DIR:PATH=%{sample_engine_dir} \
92 -DTEST_DIR:PATH=%{test_dir}
98 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
99 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
100 ln -s ../%{service_name}.service %{buildroot}%{_unitdir}/multi-user.target.wants/%{service_name}.service
101 ln -s ../%{service_name}.socket %{buildroot}%{_unitdir}/sockets.target.wants/%{service_name}.socket
103 mkdir -p %{buildroot}%{_unitdir}/default.target.wants
104 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
105 ln -s ../%{service_name}-popup.service %{buildroot}%{_unitdir}/default.target.wants/%{service_name}-popup.service
106 ln -s ../%{service_name}-popup.socket %{buildroot}%{_unitdir}/sockets.target.wants/%{service_name}-popup.socket
108 mkdir -p %{buildroot}%{ro_data_dir}/license
109 cp LICENSE %{buildroot}%{ro_data_dir}/license/%{name}
110 cp LICENSE.BSL-1.0 %{buildroot}%{ro_data_dir}/license/%{name}.BSL-1.0
111 cp LICENSE %{buildroot}%{ro_data_dir}/license/lib%{name}-client
112 cp LICENSE %{buildroot}%{ro_data_dir}/license/lib%{name}-common
113 cp LICENSE %{buildroot}%{ro_data_dir}/license/%{name}-test
114 cp LICENSE.BSL-1.0 %{buildroot}%{ro_data_dir}/license/%{name}-test.BSL-1.0
116 mkdir -p %{buildroot}%{ro_db_dir}
117 mkdir -p %{buildroot}%{rw_db_dir}
118 cp data/scripts/*.sql %{buildroot}%{ro_db_dir}
121 systemctl daemon-reload
123 systemctl start %{service_name}.socket
124 systemctl start %{service_name}.service
125 systemctl start %{service_name}-popup.socket
129 systemctl restart %{service_name}.socket
130 systemctl restart %{service_name}.service
131 systemctl restart %{service_name}-popup.socket
136 systemctl stop %{service_name}.service
137 systemctl stop %{service_name}.socket
138 systemctl stop %{service_name}-popup.socket
143 systemctl daemon-reload
146 %post -n lib%{name}-common -p %{sbin_dir}/ldconfig
147 %post -n lib%{name}-client -p %{sbin_dir}/ldconfig
148 %postun -n lib%{name}-common -p %{sbin_dir}/ldconfig
149 %postun -n lib%{name}-client -p %{sbin_dir}/ldconfig
152 %defattr(-,root,root,-)
153 %manifest %{service_name}.manifest
154 %{ro_data_dir}/license/%{name}
155 %{ro_data_dir}/license/%{name}.BSL-1.0
156 %{bin_dir}/%{service_name}-server
157 %{bin_dir}/%{service_name}-popup
158 %{_unitdir}/multi-user.target.wants/%{service_name}.service
159 %{_unitdir}/%{service_name}.service
160 %{_unitdir}/sockets.target.wants/%{service_name}.socket
161 %{_unitdir}/%{service_name}.socket
162 %{_unitdir}/default.target.wants/%{service_name}-popup.service
163 %{_unitdir}/%{service_name}-popup.service
164 %{_unitdir}/sockets.target.wants/%{service_name}-popup.socket
165 %{_unitdir}/%{service_name}-popup.socket
167 %attr(444, system, system) %{ro_db_dir}/*.sql
169 # sample engine related files
170 %{sample_engine_dir}/lib%{service_name}-cs-engine.so
171 %{sample_engine_dir}/lib%{service_name}-wp-engine.so
172 %{sample_engine_working_dir}
174 %files -n lib%{name}-common
175 %defattr(-,root,root,-)
176 %manifest %{service_name}-common.manifest
177 %{ro_data_dir}/license/lib%{name}-common
178 %{_libdir}/lib%{service_name}-common.so.*
180 %files -n lib%{name}-client
181 %defattr(-,root,root,-)
182 %manifest %{service_name}-client.manifest
183 %{ro_data_dir}/license/lib%{name}-client
184 %{_libdir}/lib%{service_name}-client.so.*
187 %defattr(-,root,root,-)
188 %{_includedir}/csr/csr/content-screening.h
189 %{_includedir}/csr/csr/content-screening-types.h
190 %{_includedir}/csr/csr/web-protection.h
191 %{_includedir}/csr/csr/web-protection-types.h
192 %{_includedir}/csr/csr/error.h
193 %{_includedir}/csr/csr/engine-manager.h
194 %{_libdir}/pkgconfig/%{service_name}.pc
195 %{_libdir}/lib%{service_name}-client.so
196 %{_libdir}/lib%{service_name}-common.so
199 %defattr(-,root,root,-)
200 %manifest %{service_name}-test.manifest
201 %{ro_data_dir}/license/%{name}-test
202 %{ro_data_dir}/license/%{name}-test.BSL-1.0
203 %{bin_dir}/%{service_name}-test
204 %{bin_dir}/%{service_name}-popup-test
205 %{bin_dir}/%{service_name}-threadpool-test