--- /dev/null
+#!/bin/sh
+#
+# gsignond-cleandb
+#
+# This script is executed by 'gumd-daemon' on post delete of a user
+# gsignond-cleandb <<username>> <<uid>> <<gid>> <<homeddir>>
+#
+# NOTE: currently we do not support cleaningup the database that was set via
+# build configuration, i.e, ./configure --enable-storagedir=<<path>>.
+# In this case we need to manually set the $DB_BASE_PATH.
+#
+LOG_FILE=/tmp/gsignond-cleandb.log
+CONF_FILE_PATH='/etc/gsignond.conf'
+DB_BASE_PATH='/var/db'
+DB_PATH=""
+
+LOG() {
+ echo $* >> $LOG_FILE;
+}
+
+touch $LOG_FILE
+LOG `date`
+
+if [ $# -le 1 ]; then
+ LOG "Error: invalid arguments passed";
+ exit 1;
+fi
+
+LOG "Cleaning database for user $1"
+
+# Consider configured storage path if any
+if [ -f $CONF_FILE_PATH ]; then
+ storage_path=`sed -e 's/^[ \t]*//' < $CONF_FILE_PATH | grep "^StoragePath"`
+ if [ `expr length "$storage_path"` -gt 0 ]; then
+ storage_path=`echo $storage_path | cut -f2 -d'=' | tr -d ' '`
+ fi
+
+ LOG "Storage path found from conf file: $storage_path"
+ if [ `expr length $storage_path"` -gt 0 ]; then
+ DB_BASE_PATH=$storage_path
+ fi
+fi
+
+DB_PATH="$DB_BASE_PATH/gsignond.$1"
+LOG "Cleaning : $DB_PATH ..."
+
+if [ -d "$DB_PATH" ]; then
+ rm -rf "$DB_PATH" 2>> $LOG_FILE
+ exit $?
+fi
+
+LOG "Done"
+LOG "======================"
+
+exit 0
+
Source: %{name}-%{version}.tar.gz
URL: https://01.org/gsso
Source1001: %{name}.manifest
+Source1002: gsignond-cleandb
Provides: gsignon
%if %{dbus_type} != "p2p"
-Requires: dbus-1
+BuildRequires: dbus-1
%endif
Requires(post): /sbin/ldconfig
Requires(postun): /sbin/ldconfig
%prep
%setup -q -n %{name}-%{version}
cp %{SOURCE1001} .
+cp %{SOURCE1002} .
%build
+autoreconf -ivf
%if %{debug_build} == 1
%configure --enable-dbus-type=%{dbus_type} --enable-debug
%else
install -m 644 data/gsignond.service %{buildroot}%{_unitdir_user}/
install -m 755 -d %{buildroot}%{_unitdir_user}/weston.target.wants
ln -sf ../gsignond.service %{buildroot}%{_unitdir_user}/weston.target.wants/gsignond.service
+install -m 755 -d %{buildroot}%{_sysconfdir}/gumd/userdel.d/
+install -m 755 gsignond-cleandb %{buildroot}%{_sysconfdir}/gumd/userdel.d/
%post
/sbin/ldconfig
%{_unitdir_user}/gsignond.service
%{_unitdir_user}/weston.target.wants/gsignond.service
%config(noreplace) %{_sysconfdir}/gsignond.conf
+%{_sysconfdir}/gumd/userdel.d/
%files devel
%defattr(-,root,root,-)