-#Available values for profile: mobile, wearable, tv, ivi, common
-%{!?profile:%define profile tv}
-
Name: wgt-backend
Summary: Application installer backend for WGT
-Version: 0.1
+Version: 0.7.12
Release: 1
Group: Application Framework/Package Management
License: Apache-2.0
Source0: %{name}-%{version}.tar.gz
+Source1000: wgt-backend.manifest
+Source1001: wgt-backend-tests.manifest
+
+BuildRequires: boost-devel
+BuildRequires: cmake
+BuildRequires: gtest-devel
+BuildRequires: pkgconfig(app-installers)
+BuildRequires: pkgconfig(manifest-parser)
+BuildRequires: pkgconfig(wgt-manifest-handlers)
+BuildRequires: pkgconfig(pkgmgr-installer)
+BuildRequires: pkgconfig(pkgmgr-types)
+BuildRequires: pkgconfig(libwebappenc)
+BuildRequires: pkgconfig(tpk-installer)
+BuildRequires: pkgconfig(vconf)
+BuildRequires: pkgconfig(libgum)
+
+%description
+This is a package that installs the WGT backend of pkgmgr.
+
+%package tests
+Summary: Unit tests for wgt-backend
+Requires: %{name} = %{version}
+
+%description tests
+Unit tests for wgt-backend
+
+%prep
+%setup -q
+
+cp %{SOURCE1000} .
+cp %{SOURCE1001} .
+
+%build
+%cmake . -DCMAKE_BUILD_TYPE=%{?build_type:%build_type}
+make %{?_smp_mflags}
+
+%install
+%make_install
+mkdir -p %{buildroot}/etc/package-manager/backend
+ln -s %{_bindir}/wgt-backend %{buildroot}%{_sysconfdir}/package-manager/backend/wgt
+
+%post tests
+/usr/sbin/setcap cap_chown,cap_dac_override,cap_fowner=eip %{_bindir}/wgt-backend-ut/smoke-test
+/usr/sbin/setcap cap_chown,cap_dac_override,cap_fowner=eip %{_bindir}/wgt-backend-ut/smoke-test-helper
+
+%files
+%manifest wgt-backend.manifest
+%license LICENSE
+%{_sysconfdir}/package-manager/backend/wgt
+%{_sysconfdir}/package-manager/backendlib/libwgt.so
+%{_bindir}/wgt-backend
+%{_datadir}/wgt-backend/default.png
+
+%files tests
+%manifest wgt-backend-tests.manifest
+%{_bindir}/wgt-backend-ut/*
+%{_datadir}/wgt-backend-ut/*
%changelog
* Thu Dec 18 2015 Pawel Sikorski <p.sikorski@samsung.com> 0.1-1
- initial files creation
-
-