This replace the previously hackish creation of the
user handled by SDB for the SDK.
The current implementation creates the user on need at
installation time of SDB. If the user still exists, it
is not recreated to avoid erasing of previously existing
data.
The group developer is also created.
TODO: check that the group developer is needed.
Change-Id: Ie2a1fae481ad7f89f8349aafa1d19f858b8a1313
Signed-off-by: José Bollo <jose.bollo@open.eurogiciel.org>
install -m 755 script/sdk_launch %{buildroot}%{_prefix}/sbin/
-%post
-mkdir -p /home/developer/.applications
-chown -R developer:users /home/developer/
-chsmack -a "User" /home/developer/
-chsmack -a "User" /home/developer/.applications
+%post
+. %{_sysconfdir}/tizen-platform.conf
+if ! getent passwd "${TZ_SDK_USER_NAME}" > /dev/null; then
+ rm -rf "${TZ_SDK_HOME}"
+ useradd -u 5100 -s /bin/false -m -d "${TZ_SDK_HOME}" "${TZ_SDK_USER_NAME}"
+ getent group developer > /dev/null || groupadd -g 5100 developer
+ for x in app_logging crash developer; do
+ usermod -a -G app_logging "${TZ_SDK_USER_NAME}"
+ done
+fi
%files
%manifest sdbd.manifest