Remove Profile Build Dependencies 00/95700/4
authorMyungJoo Ham <myungjoo.ham@samsung.com>
Fri, 4 Nov 2016 08:50:23 +0000 (17:50 +0900)
committerMyungJoo Ham <myungjoo.ham@samsung.com>
Wed, 15 Feb 2017 05:29:38 +0000 (21:29 -0800)
1. This is for Tizen 4.0
  (The macro "profile" is going to be prohibited in Tizen 4.0)

2. The maintainer needs to create JIRA-TRE issue when
he/she sends SR of this commit

   Add org.tizen.dpm-toolkit-profile_common for common profile if it has this.
   Add org.tizen.dpm-toolkit-profile_mobile for mobile profile if it has this.
   Add org.tizen.dpm-toolkit-profile_wearable for wearable profile if it has this.
   Add org.tizen.dpm-toolkit-profile_tv for tv profile if it has this.
   Add org.tizen.dpm-toolkit-profile_ivi for ivi profile if it has this.

Change-Id: Id0f0ebba60e814437a752d0ff8ca5da791d12f83
Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>
packaging/dpm-toolkit.spec

index 66330a4..5e80588 100755 (executable)
@@ -17,10 +17,61 @@ BuildRequires: pkgconfig(libxml-2.0)
 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
 
@@ -28,17 +79,48 @@ Device Policy Manager test toolkit pakcage
 %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
@@ -50,8 +132,42 @@ ln -sf %{TZ_SYS_RO_APP}/org.tizen.dpm-toolkit/bin/org.tizen.dpm-toolkit /usr/bin
 %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