-# TODO
-# - default download dir (if not reconfigured by user) is /usr/share/emesene,
-# which is not writable, set to $HOME/Downloads by default
Summary: Instant messaging client for Windows Live Messenger (tm) network
Name: emesene
Version: 1.6.2
-Release: 1
+Release: 2
License: GPL v2+
Group: Applications/Networking
URL: http://www.emesene.org/
Patch1: setup-install.patch
Patch2: plugins-pyc.patch
Patch3: pythonpath.patch
+Patch4: receivedFilesDir-writablecheck.patch
BuildRequires: gettext
BuildRequires: python-devel
BuildRequires: python-modules
%patch1 -p1
%patch2 -p1
%patch3 -p1
+%patch4 -p1
cat <<'EOF' > emesene.sh
#!/bin/sh
--- /dev/null
+--- emesene-1.6.2/FileTransfer.py~ 2010-05-26 22:51:32.000000000 +0300
++++ emesene-1.6.2/FileTransfer.py 2010-06-09 19:24:32.826629398 +0300
+@@ -215,8 +215,8 @@
+ receivedFilesDir = os.path.expanduser(config.user['receivedFilesDir'])
+
+ # if directory is invalid, save to home directory
+- if not os.path.exists(receivedFilesDir):
+- print receivedFilesDir + ' does not exist. ' \
++ if not os.path.exists(receivedFilesDir) or not os.access(receivedFilesDir, os.W_OK):
++ print receivedFilesDir + ' does not exist or is not writable. ' \
+ 'Saving files to home directory.'
+ receivedFilesDir = os.path.expanduser('~/')
+