Name: smartcard-service
Summary: Smartcard Service FW
-Version: 0.1.19
+Version: 0.1.58
Release: 0
-Group: libs
+Group: Network & Connectivity
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
-#IFNDEF USE_AUTOSTART
-#Source1: smartcard-service-server.init
-#ENDIF
+BuildRequires: cmake
BuildRequires: pkgconfig(glib-2.0)
-BuildRequires: pkgconfig(security-server)
+BuildRequires: pkgconfig(gio-unix-2.0)
BuildRequires: pkgconfig(dlog)
-BuildRequires: pkgconfig(vconf)
BuildRequires: pkgconfig(aul)
BuildRequires: pkgconfig(libssl)
-BuildRequires: pkgconfig(dbus-glib-1)
+BuildRequires: pkgconfig(libcrypto)
BuildRequires: pkgconfig(pkgmgr)
BuildRequires: pkgconfig(pkgmgr-info)
-BuildRequires: cmake
-BuildRequires: gettext-tools
+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(post): /usr/bin/vconftool
-requires(postun): /sbin/ldconfig
+Requires(postun): /sbin/ldconfig
+Requires: %{name}-common = %{version}-%{release}
+
+%if 0%{?gtests:1}
+BuildRequires: pkgconfig(gmock)
+%endif
%description
Smartcard Service FW.
-%prep
-%setup -q
-
-%package devel
-Summary: smartcard service
-Group: Development/Libraries
-Requires: %{name} = %{version}-%{release}
-
-%description devel
-smartcard service.
-
-%package -n smartcard-service-common
+%package common
Summary: common smartcard service
Group: Development/Libraries
-Requires: %{name} = %{version}-%{release}
-%description -n smartcard-service-common
+
+%description common
common smartcard service.
-%package -n smartcard-service-common-devel
+%package common-devel
Summary: common smartcard service
Group: Development/Libraries
-Requires: %{name} = %{version}-%{release}
-Requires: smartcard-service-common = %{version}-%{release}
+Requires: %{name}-common = %{version}-%{release}
+
-%description -n smartcard-service-common-devel
+%description common-devel
common smartcard service.
-%package -n smartcard-service-server
-Summary: server smartcard service
-Group: Development/Libraries
-Requires: %{name} = %{version}-%{release}
+%prep
+%setup -q
-%description -n smartcard-service-server
-smartcard service.
%build
-mkdir obj-arm-limux-qnueabi
-cd obj-arm-limux-qnueabi
-#IFNDEF USE_AUTOSTART
-#cmake .. -DCMAKE_INSTALL_PREFIX=%{_prefix}
-#ELSE
-%cmake .. -DUSE_AUTOSTART=1 # daemon will be started when client makes instance by DBUS
-#ENDIF
-#make %{?jobs:-j%jobs}
+%if 0%{?gcov:1}
+export CFLAGS+=" -fprofile-arcs -ftest-coverage"
+export CXXFLAGS+=" -fprofile-arcs -ftest-coverage"
+export LDFLAGS+=" -lgcov "
+%endif
+
+%cmake . -DCMAKE_INSTALL_PREFIX=%{_prefix} -DBUILD_GTESTS=%{?gtests:1}%{!?gtests:0} \
+ -DBUILD_GCOV=%{?gcov:1}%{!?gcov:0}
%install
-cd obj-arm-limux-qnueabi
%make_install
-#IFNDEF USE_AUTOSTART
-#%__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
-mkdir -p %{buildroot}/usr/share/license
-cp -af %{_builddir}/%{name}-%{version}/packaging/smartcard-service %{buildroot}/usr/share/license/
-cp -af %{_builddir}/%{name}-%{version}/packaging/smartcard-service-common %{buildroot}/usr/share/license/
-cp -af %{_builddir}/%{name}-%{version}/packaging/smartcard-service-server %{buildroot}/usr/share/license/
-
-%post
-/sbin/ldconfig
-#IFNDEF USE_AUTOSTART
-#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
-#IFNDEF USE_AUTOSTART
-#rm -f /etc/rc.d/rc3.d/S79smartcard-service-server
-#rm -f /etc/rc.d/rc5.d/S79smartcard-service-server
-#ENDIF
-
-%files
-%manifest smartcard-service.manifest
-%defattr(-,root,root,-)
-%{_libdir}/libsmartcard-service.so.*
-/usr/share/license/smartcard-service
-%files devel
-%manifest smartcard-service-devel.manifest
-%defattr(-,root,root,-)
-%{_includedir}/smartcard-service/*
-%{_libdir}/libsmartcard-service.so
-%{_libdir}/pkgconfig/smartcard-service.pc
+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 -n smartcard-service-common
-%manifest smartcard-service-common.manifest
+%files
+%manifest %{name}.manifest
%defattr(-,root,root,-)
-%{_libdir}/libsmartcard-service-common.so.*
-/usr/share/license/smartcard-service-common
-
-%files -n smartcard-service-common-devel
-%manifest smartcard-service-common-devel.manifest
+%{_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 common
+%manifest %{name}-common.manifest
%defattr(-,root,root,-)
-%{_includedir}/smartcard-service-common/*
-%{_libdir}/libsmartcard-service-common.so
-%{_libdir}/pkgconfig/smartcard-service-common.pc
+%{_libdir}/lib%{name}-common.so.*
+%license LICENSE.APLv2
-%files -n smartcard-service-server
-%manifest smartcard-service-server.manifest
+%files common-devel
+%manifest %{name}-common-devel.manifest
%defattr(-,root,root,-)
-%{_bindir}/smartcard-daemon
-#/usr/bin/smartcard-test-client
-#IFNDEF USE_AUTOSTART
-#/etc/init.d/smartcard-service-server
-#ELSE
-/usr/share/dbus-1/services/org.tizen.smartcard_service.service
-#ENDIF
-/usr/share/license/smartcard-service-server
+%{_includedir}/%{name}-common/*
+%{_libdir}/lib%{name}-common.so
+%{_libdir}/pkgconfig/%{name}-common.pc