BuildRequires: pkgconfig(capi-system-system-settings)
BuildRequires: pkgconfig(evas)
BuildRequires: pkgconfig(dpm)
+Requires: %{name}-binary = %{version}-%{release}
+Recommends: %{name}-profile_common = %{version}-%{release}
%description
Device Policy Manager test toolkit pakcage
+%package profile_common
+Summary: Tizen DPM test toolkit binary for common profile
+Provides: %{name}-binary = %{version}-%{release}
+Conflicts: %{name}-profile_mobile
+Conflicts: %{name}-profile_wearable
+Conflicts: %{name}-profile_tv
+Conflicts: %{name}-profile_ivi
+%description profile_common
+Device Policy Manager test toolkit binary for common profile.
+
+%package profile_mobile
+Summary: Tizen DPM test toolkit binary for mobile profile
+Provides: %{name}-binary = %{version}-%{release}
+Conflicts: %{name}-profile_common
+Conflicts: %{name}-profile_wearable
+Conflicts: %{name}-profile_tv
+Conflicts: %{name}-profile_ivi
+%description profile_mobile
+Device Policy Manager test toolkit binary for mobile profile.
+%package profile_wearable
+Summary: Tizen DPM test toolkit binary for wearable profile
+Provides: %{name}-binary = %{version}-%{release}
+Conflicts: %{name}-profile_mobile
+Conflicts: %{name}-profile_common
+Conflicts: %{name}-profile_tv
+Conflicts: %{name}-profile_ivi
+%description profile_wearable
+Device Policy Manager test toolkit binary for wearable profile.
+
+%package profile_tv
+Summary: Tizen DPM test toolkit binary for tv profile
+Provides: %{name}-binary = %{version}-%{release}
+Conflicts: %{name}-profile_mobile
+Conflicts: %{name}-profile_wearable
+Conflicts: %{name}-profile_common
+Conflicts: %{name}-profile_ivi
+%description profile_tv
+Device Policy Manager test toolkit binary for tv profile.
+
+%package profile_ivi
+Summary: Tizen DPM test toolkit binary for ivi profile
+Provides: %{name}-binary = %{version}-%{release}
+Conflicts: %{name}-profile_mobile
+Conflicts: %{name}-profile_wearable
+Conflicts: %{name}-profile_tv
+Conflicts: %{name}-profile_common
+%description profile_ivi
+Device Policy Manager test toolkit binary for ivi profile.
+
%prep
%setup -q
%if "%{asan}" == "1"
%restore_fcommon
%endif
-%{!?profile:%define profile "mobile"}
+
+mkdir -p bin
cmake . -DCMAKE_INSTALL_PREFIX="%{TZ_SYS_RO_APP}" \
-DCMAKE_DESKTOP_ICON_DIR="%{TZ_SYS_RW_ICONS}/default/small" \
-DCMAKE_APP_SHARE_PACKAGES_DIR="%{TZ_SYS_RO_PACKAGES}" \
- -DTIZEN_PROFILE_NAME=%{profile}
+ -DTIZEN_PROFILE_NAME=common
+make %{?jobs:-j%jobs}
+cp %{name} bin/%{name}.common
+cmake . -DCMAKE_INSTALL_PREFIX="%{TZ_SYS_RO_APP}" \
+ -DCMAKE_DESKTOP_ICON_DIR="%{TZ_SYS_RW_ICONS}/default/small" \
+ -DCMAKE_APP_SHARE_PACKAGES_DIR="%{TZ_SYS_RO_PACKAGES}" \
+ -DTIZEN_PROFILE_NAME=mobile
make %{?jobs:-j%jobs}
+cp %{name} bin/%{name}.mobile
+
+cmake . -DCMAKE_INSTALL_PREFIX="%{TZ_SYS_RO_APP}" \
+ -DCMAKE_DESKTOP_ICON_DIR="%{TZ_SYS_RW_ICONS}/default/small" \
+ -DCMAKE_APP_SHARE_PACKAGES_DIR="%{TZ_SYS_RO_PACKAGES}" \
+ -DTIZEN_PROFILE_NAME=wearable
+make %{?jobs:-j%jobs}
+cp %{name} bin/%{name}.wearable
+
+cmake . -DCMAKE_INSTALL_PREFIX="%{TZ_SYS_RO_APP}" \
+ -DCMAKE_DESKTOP_ICON_DIR="%{TZ_SYS_RW_ICONS}/default/small" \
+ -DCMAKE_APP_SHARE_PACKAGES_DIR="%{TZ_SYS_RO_PACKAGES}" \
+ -DTIZEN_PROFILE_NAME=tv
+make %{?jobs:-j%jobs}
+cp %{name} bin/%{name}.tv
+
+cmake . -DCMAKE_INSTALL_PREFIX="%{TZ_SYS_RO_APP}" \
+ -DCMAKE_DESKTOP_ICON_DIR="%{TZ_SYS_RW_ICONS}/default/small" \
+ -DCMAKE_APP_SHARE_PACKAGES_DIR="%{TZ_SYS_RO_PACKAGES}" \
+ -DTIZEN_PROFILE_NAME=ivi
+make %{?jobs:-j%jobs}
+cp %{name} bin/%{name}.ivi
%install
%make_install
+rm %{buildroot}%{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}
+install -m 0755 bin/%{name}.* %{buildroot}%{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/
%post
/sbin/ldconfig
%files
%manifest org.tizen.dpm-toolkit.manifest
%defattr(-,root,root,-)
-%{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/*
%{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/res/*
%{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/dpm-toolkit.xml
%{TZ_SYS_RO_PACKAGES}/org.tizen.dpm-toolkit.xml
%{TZ_SYS_RW_ICONS}/default/small/org.tizen.dpm-toolkit.png
+
+%post profile_common
+ln -sf %{name}.common %{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}
+%preun profile_common
+rm %{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}
+%files profile_common
+%{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}.common
+
+%post profile_mobile
+ln -sf %{name}.mobile %{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}
+%preun profile_mobile
+rm %{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}
+%files profile_mobile
+%{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}.mobile
+
+%post profile_wearable
+ln -sf %{name}.wearable %{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}
+%preun profile_wearable
+rm %{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}
+%files profile_wearable
+%{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}.wearable
+
+%post profile_tv
+ln -sf %{name}.tv %{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}
+%preun profile_tv
+rm %{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}
+%files profile_tv
+%{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}.tv
+
+%post profile_ivi
+ln -sf %{name}.ivi %{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}
+%preun profile_ivi
+rm %{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}
+%files profile_ivi
+%{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/%{name}.ivi