summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorStorm dragon2015-08-31 12:21:47 -0400
committerStorm dragon2015-08-31 12:21:47 -0400
commita23dcc6ce478ae2bfe6d1d3f1ccc3791b5bbbb96 (patch)
tree22b86a6cc47b058bdb77a24c7170c09556b78318
downloadaur-python2-speechd.tar.gz
Initial commit. Adopted this package from the AUR 3.
-rw-r--r--.SRCINFO19
-rw-r--r--0.8-api-changes.patch135
-rw-r--r--PKGBUILD37
3 files changed, 191 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 00000000000..1c52efab1b6
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,19 @@
+pkgbase = python2-speechd
+ pkgdesc = Python 2.x bindings for speechd
+ pkgver = 0.7.1
+ pkgrel = 2
+ url = http://www.freebsoft.org/speechd
+ arch = any
+ license = GPL2
+ license = FDL
+ makedepends = intltool
+ makedepends = espeak
+ depends = python2-xdg
+ depends = speech-dispatcher
+ source = http://www.freebsoft.org/pub/projects/speechd/speech-dispatcher-0.7.1.tar.gz
+ source = 0.8-api-changes.patch
+ md5sums = ccfc30ac006673d36b4223eb760ed696
+ md5sums = 5c1072c96ca46ff7f3dbdd354a4e8728
+
+pkgname = python2-speechd
+
diff --git a/0.8-api-changes.patch b/0.8-api-changes.patch
new file mode 100644
index 00000000000..3a6654ffd75
--- /dev/null
+++ b/0.8-api-changes.patch
@@ -0,0 +1,135 @@
+X-Git-Url: http://git.freebsoft.org/?p=speechd.git;a=blobdiff_plain;f=src%2Fapi%2Fpython%2Fspeechd%2Fclient.py;h=8d3436334e3d3ca9e5884ae595ec9ba1f21b2375;hp=3d28f4f44e21babce36b17063ddb4f3bb4256a5d;hb=f818b657ab8da32ef2f212eebb453bf054f7afdb;hpb=728f531c50144ed7f46179363c1215a7d0453e16
+
+diff --git a/src/python/speechd/client.py b/src/python/speechd/client.py
+index 3d28f4f..8d34363 100644
+--- a/src/python/speechd/client.py
++++ b/src/python/speechd/client.py
+@@ -494,7 +494,7 @@ class SSIPClient(object):
+ """Default host for server connections."""
+ DEFAULT_PORT = 6560
+ """Default port number for server connections."""
+- DEFAULT_SOCKET_PATH = "~/.speech-dispatcher/speechd.sock"
++ DEFAULT_SOCKET_PATH = "speech-dispatcher/speechd.sock"
+ """Default name of the communication unix socket"""
+
+ def __init__(self, name, component='default', user='unknown', address=None,
+@@ -510,7 +510,7 @@ class SSIPClient(object):
+ user -- user identification string (user name). When multi-user
+ acces is expected, this can be used to identify their connections.
+ address -- server address as specified in Speech Dispatcher
+- documentation (e.g. "unix:/home/joe/.speech-dispatcher/speechd.sock"
++ documentation (e.g. "unix:/run/user/joe/speech-dispatcher/speechd.sock"
+ or "inet:192.168.0.85:6561")
+ autospawn -- a flag to specify whether the library should
+ try to start the server if it determines its not already
+@@ -520,9 +520,9 @@ class SSIPClient(object):
+ method -- communication method to use, one of the constants defined in class
+ CommunicationMethod
+ socket_path -- for CommunicationMethod.UNIX_SOCKET, socket
+- path in filesystem. By default, this is ~/.speech-dispatcher/speechd.sock
+- where `~' is the users home directory as determined from the system
+- defaults and from the $HOMEDIR environment variable.
++ path in filesystem. By default, this is $XDG_RUNTIME_DIR/speech-dispatcher/speechd.sock
++ where $XDG_RUNTIME_DIR is determined using the XDG Base Directory
++ Specification.
+ host -- for CommunicationMethod.INET_SOCKET, server hostname
+ or IP address as a string. If None, the default value is
+ taken from SPEECHD_HOST environment variable (if it
+@@ -536,9 +536,12 @@ class SSIPClient(object):
+ Dispatcher documentation.
+ """
+
++ _home = os.path.expanduser("~")
++ _runtime_dir = os.environ.get('XDG_RUNTIME_DIR', os.environ.get('XDG_CACHE_HOME', os.path.join(_home, '.cache')))
++ _sock_path = os.path.join(_runtime_dir, self.DEFAULT_SOCKET_PATH)
+ # Resolve connection parameters:
+ connection_args = {'communication_method': CommunicationMethod.UNIX_SOCKET,
+- 'socket_path': os.path.expanduser(self.DEFAULT_SOCKET_PATH),
++ 'socket_path': _sock_path,
+ 'host': self.DEFAULT_HOST,
+ 'port': self.DEFAULT_PORT,
+ }
+X-Git-Url: http://git.freebsoft.org/?p=speechd.git;a=blobdiff_plain;f=src%2Fapi%2Fpython%2Fspeechd_config%2Fconfig.py;h=47a37105b94318f59bc7c4b1f7f913deb362d245;hp=7bd8a89100e47adf29bca253be39f2e0303c155b;hb=2223ab2455ea17d2e27cb2896496291f158a156b;hpb=ff994b57a340a8b6229f5576c1a202e339169105
+
+diff --git a/src/python/speechd_config/config.py b/src/python/speechd_config/config.py
+index 7bd8a89..47a3710 100644
+--- a/src/python/speechd_config/config.py
++++ b/src/python/speechd_config/config.py
+@@ -26,6 +26,7 @@ import time
+ import datetime
+
+ from optparse import OptionParser
++from xdg import BaseDirectory
+
+ # Configuration and sound data paths
+ from . import paths
+@@ -272,17 +273,9 @@ class Tests:
+ def __init__(self):
+ self.festival_socket = None
+
+- def user_speechd_dir(self):
+- """Return user Speech Dispatcher configuration and logging directory"""
+- return os.path.expanduser(os.path.join('~', '.speech-dispatcher'))
+-
+- def user_speechd_dir_exists(self):
+- """Determine whether user speechd directory exists"""
+- return os.path.exists(self.user_speechd_dir())
+-
+ def user_conf_dir(self):
+ """Return user configuration directory"""
+- return os.path.join(self.user_speechd_dir(), "conf")
++ return os.path.join(BaseDirectory.xdg_config_home, "speech-dispatcher")
+
+ def system_conf_dir(self):
+ """Determine system configuration directory"""
+@@ -684,32 +677,25 @@ class Configure:
+ """Create user configuration in the standard location"""
+
+ # Ask before touching things that we do not have to!
+- if test.user_speechd_dir_exists():
+- if test.user_conf_dir_exists():
+- if test.user_configuration_seems_complete():
+- reply = question(
+- """User configuration already exists.
+-Do you want to rewrite it with a new one?""", False)
+- if reply == False:
+- report("Keeping configuration intact and continuing with settings.")
+- return
+- else:
+- self.remove_user_configuration()
++ if test.user_conf_dir_exists():
++ if test.user_configuration_seems_complete():
++ reply = question(
++ "User configuration already exists."
++ "Do you want to rewrite it with a new one?", False)
++ if reply == False:
++ report("Keeping configuration intact and continuing with settings.")
++ return
+ else:
+- reply = question(
+- """User configuration already exists, but it seems to be incomplete.
+-Do you want to keep it?""", False)
+- if reply == False:
+- self.remove_user_configuration()
+- else:
+- report("Keeping configuration intact and aborting.")
+- return
+-
+- # TODO: Check for permissions on logfiles and pid
+- else:
+- report("Creating " + test.user_speechd_dir())
+- os.mkdir(test.user_speechd_dir())
+-
++ self.remove_user_configuration()
++ else:
++ reply = question(
++ "User configuration already exists, but it seems to be incomplete."
++ "Do you want to keep it?", False)
++ if reply == False:
++ self.remove_user_configuration()
++ else:
++ report("Keeping configuration intact and aborting.")
++ return
+ # Copy the original intact configuration files
+ # creating a conf/ subdirectory
+ shutil.copytree(paths.SPD_CONF_ORIG_PATH, test.user_conf_dir())
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 00000000000..12993d7b4a8
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,37 @@
+# Maintainer: Storm Dragon <stormdragon2976@gmail.com>
+# Contributor: Andrea Scarpino <andrea@archlinux.org>
+# Contributor: Steve Holmes <steve.holmes88@gmail.com>
+# Contributor: Alexander Jenisch <nt@divzero.at>
+# Contributor: Chris Brannon <cmbrannon@cox.net>
+# Contributor: Andreas Messer <andi@bupfen.de>
+
+pkgname=python2-speechd
+pkgver=0.7.1
+pkgrel=2
+arch=('any')
+pkgdesc="Python 2.x bindings for speechd"
+url="http://www.freebsoft.org/speechd"
+license=('GPL2' 'FDL')
+depends=('python2-xdg' 'speech-dispatcher')
+makedepends=('intltool' 'espeak')
+source=(http://www.freebsoft.org/pub/projects/speechd/speech-dispatcher-$pkgver.tar.gz
+ 0.8-api-changes.patch)
+md5sums=('ccfc30ac006673d36b4223eb760ed696' '5c1072c96ca46ff7f3dbdd354a4e8728')
+
+build() {
+ cd "${srcdir}/speech-dispatcher-${pkgver}"
+ patch -Np1 -i ../0.8-api-changes.patch
+
+ PYTHON=python2 ./configure --prefix=/usr \
+ --sysconfdir=/etc \
+ --without-flite
+ cd src/python
+ make
+}
+
+package() {
+ cd "${srcdir}/speech-dispatcher-${pkgver}/src/python"
+ make DESTDIR="${pkgdir}" install
+ rm -rf "${pkgdir}/usr/share"
+ rm -rf "${pkgdir}/usr/bin"
+}