Name: aul
Summary: App utility library
-Version: 0.24.3
+Version: 0.42.1
Release: 1
Group: Application Framework/Libraries
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
Source1001: %{name}.manifest
+Source1002: %{name}-server.manifest
+Source1003: %{name}-exec-checker-plugin.manifest
Requires(post): /sbin/ldconfig
Requires(post): /usr/bin/systemctl
BuildRequires: pkgconfig(libxml-2.0)
BuildRequires: pkgconfig(uuid)
BuildRequires: pkgconfig(libsmack)
+BuildRequires: pkgconfig(gmock)
+BuildRequires: pkgconfig(parcel)
+
+%if 0%{?gcov:1}
+BuildRequires: lcov
+BuildRequires: zip
+%endif
Recommends: amd
Recommends: amd-mod-component-manager
%description devel
Application utility library (devel)
+%package exec-checker-plugin
+Summary: App binary executable cheker
+Group: Development/Libraries
+Requires: %{name} = %{version}-%{release}
+
+%description exec-checker-plugin
+Application utility library (exec checker)
+
%package test
Summary: App utility test tools
Group: Development/Libraries
%description test
Application utility library (test tools)
+#################################################
+# aul-gcov
+#################################################
+%if 0%{?gcov:1}
+%package gcov
+Summary: AUL (gcov)
+Group: Application Framework/Testing
+
+%description gcov
+AUL gcov objects
+%endif
+
+#################################################
+# aul-server
+#################################################
+%package server
+Summary: Application Utility Library (Server)
+Group: Development/Libraries
+
+%description server
+Application Utility Library (Server)
+
+%package server-devel
+Summary: Application Utility Library (Server)
+Group: Development/Libraries
+Requires: %{name}-server = %{version}-%{release}
+
+%description server-devel
+Application Utility Library (devel)
+
%if "%{?_prelink_enable}" == "y"
%define tizen_feature_prelink 1
%else
%define tizen_feature_prelink 0
%endif
+%define _aulresdir /opt/usr/home/owner/share/aul/res
+
%prep
%setup -q
sed -i 's|TZ_SYS_DB|%{TZ_SYS_DB}|g' %{SOURCE1001}
cp %{SOURCE1001} .
+cp %{SOURCE1002} .
+cp %{SOURCE1003} .
%build
+%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
+
%if 0%{?simulator}
CFLAGS="%{optflags} -D__emul__"; export CFLAGS
%endif
%cmake -DFULLVER=%{version} \
-DMAJORVER=${MAJORVER} \
-D_TIZEN_FEATURE_PRELINK:BOOL=${_TIZEN_FEATURE_PRELINK} \
+ -DAUL_RES_DIR=%{_aulresdir} \
.
%__make %{?_smp_mflags}
sqlite3 .appsvc.db < ./data/appsvc_db.sql
sqlite3 .component.db < ./parser/component/data/component_db.sql
+%if 0%{?gcov:1}
+mkdir -p gcov-obj
+find . -name '*.gcno' -exec cp '{}' gcov-obj ';'
+%endif
+
+%check
+export LD_LIBRARY_PATH="../../"
+ctest -V
+%if 0%{?gcov:1}
+lcov -c --ignore-errors graph --no-external -q -d . -o %{name}.info
+genhtml %{name}.info -o %{name}.out
+zip -r %{name}.zip %{name}.out %{name}.info
+install -m 0644 %{name}.zip %{buildroot}%{_datadir}/gcov/
+%endif
+
%install
rm -rf %{buildroot}
%make_install
-mkdir -p %{buildroot}%{_tmpfilesdir}
mkdir -p %{buildroot}%{TZ_SYS_DB}
install -m 0644 .appsvc.db %{buildroot}%{TZ_SYS_DB}
install -m 0644 .appsvc.db-journal %{buildroot}%{TZ_SYS_DB}
mkdir -p %{buildroot}%{_sysconfdir}/gumd/useradd.d
cp -f scripts/12_appsvc-add.post %{buildroot}%{_sysconfdir}/gumd/useradd.d/12_appsvc-add.post
+%if 0%{?gcov:1}
+mkdir -p %{buildroot}%{_datadir}/gcov/obj
+install -m 0644 gcov-obj/* %{buildroot}%{_datadir}/gcov/obj
+%endif
+
%preun
%post
chsmack -a 'User::Home' %{TZ_SYS_DB}/.component.db
chsmack -a 'User::Home' %{TZ_SYS_DB}/.component.db-journal
-
%postun
/sbin/ldconfig
+%post test
+%if 0%{?gcov:1}
+%{_bindir}/aul-unit-tests
+%endif
+chmod +x %{_aulresdir}/tpk/install.sh
+%{_aulresdir}/tpk/install.sh
+
+%postun server
+/sbin/ldconfig
+
+%post server
+/sbin/ldconfig
+
%files
%license LICENSE
%manifest %{name}.manifest
%{_bindir}/compmgr_tool
%{_bindir}/appsvc-db-recovery
%{_bindir}/component-db-recovery
+%{_bindir}/aul_window
%{_datadir}/aul/miregex/*
%{_datadir}/aul/preexec_list.txt
%{_datadir}/appsvc/*
-%{_datadir}/parser-plugins/*
+%{_datadir}/parser-plugins/component.info
+%{_datadir}/parser-plugins/alias-appid.info
+%{_datadir}/parser-plugins/allowed-appid.info
%{TZ_SYS_DB}/.appsvc.db*
%{TZ_SYS_DB}/.component.db*
-%{_sysconfdir}/package-manager/parserlib/metadata/libaul-parser.so
+%{_sysconfdir}/package-manager/parserlib/metadata/*.so
%{_sysconfdir}/package-manager/parserlib/libcomponent-based-application.so
+
%attr(0755,root,root) %{_sysconfdir}/gumd/useradd.d/*
%attr(0755,root,root) %{_datadir}/upgrade/scripts/501.component_upgrade.sh
+%files exec-checker-plugin
+%manifest %{name}-exec-checker-plugin.manifest
+%{_datadir}/parser-plugins/exec-checker.info
+%{_sysconfdir}/package-manager/parserlib/libexec-checker.so*
+
%files test
+%{_bindir}/app-control-tests
+%{_bindir}/aul-unit-tests
%{_bindir}/open_app
+%{_aulresdir}/*
%files devel
%{_includedir}/aul/*.h
-%{_libdir}/*.so
-%{_libdir}/pkgconfig/*.pc
+%{_includedir}/aul/api/*.h
+%{_libdir}/libaul.so
+%{_libdir}/pkgconfig/aul.pc
+
+#################################################
+# aul-gcov
+#################################################
+%if 0%{?gcov:1}
+%files gcov
+%{_datadir}/gcov/*
+%endif
+
+%files server
+%manifest %{name}-server.manifest
+%attr(0644,root,root) %{_libdir}/libaul-server.so.*
+
+%files server-devel
+%{_includedir}/aul/server/*.h
+%{_libdir}/libaul-server.so
+%{_libdir}/pkgconfig/aul-server.pc