Summary: A general purpose content screening and reputation solution
Name: csr-framework
-Version: 2.3.2
+Version: 2.3.7
Release: 0
Source: %{name}-%{version}.tar.gz
License: Apache-2.0 and BSL-1.0
BuildRequires: cmake
BuildRequires: gettext-tools
BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(libsystemd-daemon)
+BuildRequires: pkgconfig(libsystemd)
BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(sqlite3)
BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(pkgmgr-info)
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(storage)
+Requires: boost-test
Requires: %{name} = %{version}
%description test
Content Screening and Reputation framework (test program)
+%if 0%{?gcov:1}
+%package gcov
+Summary: CSR framework (gcov)
+Group: Security/Testing
+BuildRequires: lcov
+
+%description gcov
+Content Screening and Reputation framework (gcov)
+%endif
+
%prep
%setup -q
%define test_target target
%endif
+%if 0%{?gcov:1}
+export CFLAGS+=" -fprofile-arcs -ftest-coverage"
+export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
+export FFLAGS+=" -fprofile-arcs -ftest-coverage"
+export LDFLAGS+=" -lgcov"
+%endif
+
%cmake . \
-DCMAKE_BUILD_TYPE=%{?build_type:%build_type}%{!?build_type:RELEASE} \
-DCMAKE_VERBOSE_MAKEFILE=ON \
%endif
-DTZ_SYS_STORAGE=%TZ_SYS_STORAGE \
-DTZ_SYS_RW_APP=%TZ_SYS_RW_APP \
- -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP
+ -DTZ_SYS_RO_APP=%TZ_SYS_RO_APP \
+ -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
make %{?jobs:-j%jobs}
+%if 0%{?gcov:1}
+mkdir -p gcov-obj
+find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
+%endif
+
%install
%make_install
%install_service sockets.target.wants %{service_name}-cs.socket
%find_lang %{service_name}
-%post
-set_cap_script=%{ro_data_dir}/security-config/set_capability
-if [ -f $set_cap_script ]; then
- $set_cap_script
-fi
+%if 0%{?gcov:1}
+mkdir -p %{buildroot}%{_datadir}/gcov/obj
+install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj/%{name}
+%endif
+%post
rm -f %{rw_db_dir}/.%{service_name}.db*
systemctl daemon-reload
touch %{engine_rw_working_dir}/csret_wp_risky_urls
%endif
+%if 0%{?gcov:1}
+chmod 777 -R /tmp/home/abuild/rpmbuild/BUILD/csr-framework-*
+su - owner -c %{bin_dir}/%{service_name}-test
+%{bin_dir}/%{service_name}-internal-test
+%{bin_dir}/%{service_name}-threadpool-test
+%endif
+
%files -f %{service_name}.lang
%defattr(-,root,root,-)
%manifest %{service_name}.manifest
%{engine_dir}/lib%{service_name}-wp-engine.so
%attr(-, %{service_user}, %{service_group}) %{engine_rw_working_dir}/*
%endif
+
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/obj/*
+%endif