-# FOR COMMENTING DEFINITION, MUST USE %% instead of %
-%global use_autostart "-DUSE_AUTOSTART=1"
-#%%global test_client "-DTEST_CLIENT=1"
-
Name: smartcard-service
-Summary: Smartcard Service
-Version: 0.1.30
+Summary: Smartcard Service FW
+Version: 0.1.58
Release: 0
-Group: Network & Connectivity/Service
+Group: Network & Connectivity
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
-%if 0%{!?use_autostart:1}
-Source1: smartcard-service-server.init
-%endif
BuildRequires: cmake
-Source1001: %{name}.manifest
-Source1002: %{name}-devel.manifest
-Source1003: smartcard-service-common.manifest
-Source1004: smartcard-service-common-devel.manifest
-Source1005: smartcard-service-server.manifest
BuildRequires: pkgconfig(glib-2.0)
BuildRequires: pkgconfig(gio-unix-2.0)
BuildRequires: pkgconfig(dlog)
BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(libssl)
+BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(pkgmgr-info)
+BuildRequires: pkgconfig(cynara-client)
+BuildRequires: pkgconfig(cynara-creds-gdbus)
+BuildRequires: pkgconfig(cynara-session)
+BuildRequires: pkgconfig(capi-system-info)
+
BuildRequires: python
BuildRequires: python-xml
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
-Requires: smartcard-service-common = %{version}-%{release}
+Requires: %{name}-common = %{version}-%{release}
+%if 0%{?gtests:1}
+BuildRequires: pkgconfig(gmock)
+%endif
%description
-A library for Smartcard applications.
-
-
-%prep
-%setup -q
-cp %{SOURCE1001} %{SOURCE1002} %{SOURCE1003} %{SOURCE1004} %{SOURCE1005} .
-
-
-%package devel
-Summary: Smartcard service
-Group: Network & Connectivity/Development
-Requires: %{name} = %{version}-%{release}
+Smartcard Service FW.
-%description devel
-For developing Smartcard applications.
+%package common
+Summary: common smartcard service
+Group: Development/Libraries
-%package -n smartcard-service-common
-Summary: Common smartcard service
-Group: Network & Connectivity/Service
+%description common
+common smartcard service.
-%description -n smartcard-service-common
-Common smartcard service for developing internally
+%package common-devel
+Summary: common smartcard service
+Group: Development/Libraries
+Requires: %{name}-common = %{version}-%{release}
-%package -n smartcard-service-common-devel
-Summary: Common smartcard service
-Group: Network & Connectivity/Development
-Requires: smartcard-service-common = %{version}-%{release}
+%description common-devel
+common smartcard service.
-%description -n smartcard-service-common-devel
-For developing smartcard services internally.
-
-
-%package -n smartcard-service-server
-Summary: Smartcard service server
-Group: Network & Connectivity/Service
-Requires: smartcard-service-common = %{version}-%{release}
-
-%description -n smartcard-service-server
-Server for smartcard service
+%prep
+%setup -q
%build
-MAJORVER=`echo %{version} | awk 'BEGIN {FS="."}{print $1}'`
-%cmake . %{?use_autostart} %{?test_client} -DFULLVER=%{version} -DMAJORVER=${MAJORVER}
-
-%install
-%make_install
-%if 0%{!?use_autostart:1}
- %__mkdir -p %{buildroot}/etc/init.d/
- %__mkdir -p %{buildroot}/etc/rc.d/rc3.d/
- %__mkdir -p %{buildroot}/etc/rc.d/rc5.d/
- %__cp -af %SOURCE1 %{buildroot}/etc/init.d/smartcard-service-server
- chmod 755 %{buildroot}/etc/init.d/smartcard-service-server
-%endif
-
-%post
-/sbin/ldconfig
-%if 0%{!?use_autostart:1}
- ln -sf /etc/init.d/smartcard-service-server /etc/rc.d/rc3.d/S79smartcard-service-server
- ln -sf /etc/init.d/smartcard-service-server /etc/rc.d/rc5.d/S79smartcard-service-server
-%endif
-
-%postun
-/sbin/ldconfig
-%if 0%{!?use_autostart:1}
- rm -f /etc/rc.d/rc3.d/S79smartcard-service-server
- rm -f /etc/rc.d/rc5.d/S79smartcard-service-server
+%if 0%{?gcov:1}
+export CFLAGS+=" -fprofile-arcs -ftest-coverage"
+export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
+export LDFLAGS+=" -lgcov "
%endif
-%post -n smartcard-service-common
-/sbin/ldconfig
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
+ -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
-%postun -n smartcard-service-common
-/sbin/ldconfig
+%install
+%make_install
+mkdir -p %{buildroot}/etc/dbus-1/system.d/
+cp -af %{_builddir}/%{name}-%{version}/packaging/org.tizen.SmartcardService.conf %{buildroot}/etc/dbus-1/system.d/
+install -D -m 0644 server/org.tizen.SmartcardService.service %{buildroot}/%{_unitdir}/org.tizen.SmartcardService.service
%files
%manifest %{name}.manifest
%defattr(-,root,root,-)
-%{_libdir}/libsmartcard-service.so.*
+%{_bindir}/smartcard-daemon
+%{_sysconfdir}/dbus-1/system.d/org.tizen.SmartcardService.conf
+%{_unitdir}/org.tizen.SmartcardService.service
+%if 0%{?gtests:1}
+%{_bindir}/gtest*
+%endif
%license LICENSE.APLv2
-
-%files devel
-%manifest smartcard-service-devel.manifest
+%files common
+%manifest %{name}-common.manifest
%defattr(-,root,root,-)
-%{_includedir}/%{name}/*
-%{_libdir}/libsmartcard-service.so
-%{_libdir}/pkgconfig/%{name}.pc
-
-
-%files -n smartcard-service-common
-%manifest smartcard-service-common.manifest
-%defattr(-,root,root,-)
-%{_libdir}/libsmartcard-service-common.so.*
+%{_libdir}/lib%{name}-common.so.*
%license LICENSE.APLv2
-
-%files -n smartcard-service-common-devel
-%manifest smartcard-service-common-devel.manifest
-%defattr(-,root,root,-)
-%{_includedir}/smartcard-service-common/*
-%{_libdir}/libsmartcard-service-common.so
-%{_libdir}/pkgconfig/smartcard-service-common.pc
-
-
-%files -n smartcard-service-server
-%manifest smartcard-service-server.manifest
+%files common-devel
+%manifest %{name}-common-devel.manifest
%defattr(-,root,root,-)
-%{_bindir}/smartcard-daemon
-%{_datadir}/packages/smartcard-service-server.xml
-%if 0%{?test_client:1}
- %{_bindir}/smartcard-test-client
-%endif
-%if 0%{?use_autostart:1}
- %{_datadir}/dbus-1/system-services/org.tizen.smartcard_service.service
-%else
- %{_sysconfdir}/init.d/smartcard-service-server
-%endif
-%license LICENSE.APLv2
+%{_includedir}/%{name}-common/*
+%{_libdir}/lib%{name}-common.so
+%{_libdir}/pkgconfig/%{name}-common.pc