# WARNING! do not use for production builds as it will break security
%define debug_build 0
-%if "%{profile}" == "wearable"
-%define disable_cap_admin 1
-%else
-%define disable_cap_admin 0
-%endif
-
%define GUMD_DBUS_SERVICE "src/daemon/dbus/services/org.O1.SecurityAccounts.gUserManagement.service"
Name: gumd
BuildRequires: pkgconfig(gmodule-2.0)
BuildRequires: pkgconfig(libtzplatform-config)
Requires: tizen-platform-config
+Provides: gumd-profile_common = %{version}-%{release}
+Provides: gumd-profile_mobile = %{version}-%{release}
+Provides: gumd-profile_tv = %{version}-%{release}
+Provides: gumd-profile_ivi = %{version}-%{release}
%description
%{summary} files
+%package profile_wearable
+Summary: GUMD extension for Tizen Wearable
+Requires: gumd = %{version}-%{release}
+
+%description profile_wearable
+GUMD extension for Tizen Wearable.
+This extension supports wearable specific gumd.service file.
%package -n libgum
Summary: User management client library
mv "%{GUMD_DBUS_SERVICE}".vd.in "%{GUMD_DBUS_SERVICE}".in
%else
mv "%{GUMD_DBUS_SERVICE}".common.in "%{GUMD_DBUS_SERVICE}".in
-%if %{disable_cap_admin} == 1
-echo "CapabilityBoundingSet=~CAP_MAC_ADMIN" >> data/gumd.service
-echo "SmackProcessLabel=System" >> data/gumd.service
-%else
+
+# wearable
+cp data/gumd.service data/gumd.service.wearable
+echo "CapabilityBoundingSet=~CAP_MAC_ADMIN" >> data/gumd.service.wearable
+echo "SmackProcessLabel=System" >> data/gumd.service.wearable
+# non-wearable
echo "SmackProcessLabel=System::Privileged" >> data/gumd.service
%endif
-%endif
%build
autoreconf -ivf
%if "%{TIZEN_PRODUCT_TV}" != "1"
install -m 755 -d %{buildroot}%{_unitdir}
install -m 644 data/gumd.service %{buildroot}%{_unitdir}
+install -m 644 data/gumd.service.wearable %{buildroot}%{_unitdir}
%endif
%post
%post -n libgum -p /sbin/ldconfig
%postun -n libgum -p /sbin/ldconfig
+%post profile_wearable
+# Uses different service file (overwrite non wearable)
+mv %{_unitdir}/gumd.service.wearable %{_unitdir}/gumd.service
+# This does not support complete unisntall because gumd.service
+# is not going to be recovered. Users should reinstall gumd
+# to get it recovered after uninstalling profile_wearable
+
%files -n libgum
%defattr(-,root,root,-)
%manifest libgum.manifest
%endif
%endif
+%files profile_wearable
+%{_unitdir}/gumd.service.wearable
+
%files doc
%defattr(-,root,root,-)
%manifest %{name}.manifest