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 Requires: lib%{name}-common = %{version}-%{release}
16 General purpose content screening and reputation solution. Can scan
17 file contents and checking url to prevent malicious items.
19 %global service_name csr
20 %global bin_dir %{_bindir}
21 %global sbin_dir /sbin
22 %global ro_data_dir %{_datadir}
23 %global sample_engine_working_dir /opt/share/%{service_name}/engine
24 %global sample_engine_dir %{_libdir}
25 %global test_dir /opt/share/%{service_name}-test
27 %package -n lib%{name}-common
28 Summary: Common library package for %{name}
30 Group: Security/Libraries
31 Requires: %{sbin_dir}/ldconfig
32 Requires: %{sbin_dir}/ldconfig
34 %description -n lib%{name}-common
35 csr-framework common library package.
37 %package -n lib%{name}-client
38 Summary: Client library package for %{name}
40 Group: Security/Libraries
41 BuildRequires: pkgconfig(capi-base-common)
42 Requires: %{name} = %{version}-%{release}
43 Requires: %{sbin_dir}/ldconfig
44 Requires: %{sbin_dir}/ldconfig
46 %description -n lib%{name}-client
47 csr-framework client library package.
50 Summary: Development files for %{name}
52 Group: Security/Development
53 BuildRequires: pkgconfig(capi-base-common)
54 Requires: %{name} = %{version}-%{release}
57 csr-framework developemnt files including headers and pkgconfig file.
60 Summary: test program for %{name}
61 License: Apache-2.0 and BSL-1.0
62 Group: Security/Testing
63 BuildRequires: boost-devel
64 Requires: %{name} = %{version}
67 test program of csr-framework
74 -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \
75 -DCMAKE_VERBOSE_MAKEFILE=ON \
76 -DCMAKE_INSTALL_PREFIX=%{_prefix} \
77 -DSERVICE_NAME=%{service_name} \
78 -DVERSION=%{version} \
79 -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \
80 -DBIN_DIR:PATH=%{bin_dir} \
81 -DSYSTEMD_UNIT_DIR=%{_unitdir} \
82 -DSAMPLE_ENGINE_WORKING_DIR:PATH=%{sample_engine_working_dir} \
83 -DSAMPLE_ENGINE_DIR:PATH=%{sample_engine_dir} \
84 -DTEST_DIR:PATH=%{test_dir}
90 mkdir -p %{buildroot}%{_unitdir}/multi-user.target.wants
91 mkdir -p %{buildroot}%{_unitdir}/sockets.target.wants
92 ln -s ../%{service_name}.service %{buildroot}%{_unitdir}/multi-user.target.wants/%{service_name}.service
93 ln -s ../%{service_name}.socket %{buildroot}%{_unitdir}/sockets.target.wants/%{service_name}.socket
95 mkdir -p %{buildroot}%{ro_data_dir}/license
96 cp LICENSE %{buildroot}%{ro_data_dir}/license/%{name}
97 cp LICENSE.BSL-1.0 %{buildroot}%{ro_data_dir}/license/%{name}.BSL-1.0
98 cp LICENSE %{buildroot}%{ro_data_dir}/license/lib%{name}-client
99 cp LICENSE %{buildroot}%{ro_data_dir}/license/lib%{name}-common
100 cp LICENSE %{buildroot}%{ro_data_dir}/license/%{name}-test
101 cp LICENSE.BSL-1.0 %{buildroot}%{ro_data_dir}/license/%{name}-test.BSL-1.0
104 systemctl daemon-reload
106 systemctl start %{service_name}.socket
107 systemctl start %{service_name}.service
111 systemctl restart %{service_name}.socket
112 systemctl restart %{service_name}.service
117 systemctl stop %{service_name}.service
118 systemctl stop %{service_name}.socket
123 systemctl daemon-reload
126 %post -n lib%{name}-common -p %{sbin_dir}/ldconfig
127 %post -n lib%{name}-client -p %{sbin_dir}/ldconfig
128 %postun -n lib%{name}-common -p %{sbin_dir}/ldconfig
129 %postun -n lib%{name}-client -p %{sbin_dir}/ldconfig
132 %defattr(-,root,root,-)
133 %manifest %{service_name}.manifest
134 %{ro_data_dir}/license/%{name}
135 %{ro_data_dir}/license/%{name}.BSL-1.0
136 %{bin_dir}/%{service_name}-server
137 %{_unitdir}/multi-user.target.wants/%{service_name}.service
138 %{_unitdir}/%{service_name}.service
139 %{_unitdir}/sockets.target.wants/%{service_name}.socket
140 %{_unitdir}/%{service_name}.socket
142 # sample engine related files
143 %{sample_engine_dir}/lib%{service_name}-cs-engine.so
144 %{sample_engine_dir}/lib%{service_name}-wp-engine.so
145 %{sample_engine_working_dir}
147 %files -n lib%{name}-common
148 %defattr(-,root,root,-)
149 %manifest %{service_name}-common.manifest
150 %{ro_data_dir}/license/lib%{name}-common
151 %{_libdir}/lib%{service_name}-common.so.*
153 %files -n lib%{name}-client
154 %defattr(-,root,root,-)
155 %manifest %{service_name}-client.manifest
156 %{ro_data_dir}/license/lib%{name}-client
157 %{_libdir}/lib%{service_name}-client.so.*
160 %defattr(-,root,root,-)
161 %{_includedir}/csr/csr/content-screening.h
162 %{_includedir}/csr/csr/content-screening-types.h
163 %{_includedir}/csr/csr/web-protection.h
164 %{_includedir}/csr/csr/web-protection-types.h
165 %{_includedir}/csr/csr/error.h
166 %{_includedir}/csr/csr/engine-manager.h
167 %{_libdir}/pkgconfig/%{service_name}.pc
168 %{_libdir}/lib%{service_name}-client.so
169 %{_libdir}/lib%{service_name}-common.so
172 %defattr(-,root,root,-)
173 %manifest %{service_name}-test.manifest
174 %{ro_data_dir}/license/%{name}-test
175 %{ro_data_dir}/license/%{name}-test.BSL-1.0
176 %{bin_dir}/%{service_name}-test