summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Huddleston <eradicator@gentoo.org>2004-03-22 07:37:06 +0000
committerJeremy Huddleston <eradicator@gentoo.org>2004-03-22 07:37:06 +0000
commit302235351d267c818fb933198df5c59916807a5a (patch)
tree631b9539c403105f6eee128e4fff2bd0dc12dce5 /app-accessibility/eflite
parentmore clean up (diff)
downloadgentoo-2-302235351d267c818fb933198df5c59916807a5a.tar.gz
gentoo-2-302235351d267c818fb933198df5c59916807a5a.tar.bz2
gentoo-2-302235351d267c818fb933198df5c59916807a5a.zip
Added init script and default conf. Created patch to enable daemon-only command line arg.
Diffstat (limited to 'app-accessibility/eflite')
-rw-r--r--app-accessibility/eflite/ChangeLog7
-rw-r--r--app-accessibility/eflite/eflite-0.3.8.ebuild11
-rw-r--r--app-accessibility/eflite/files/eflite-0.3.8-daemon.patch59
-rw-r--r--app-accessibility/eflite/files/eflite.rc28
-rw-r--r--app-accessibility/eflite/files/es.conf11
5 files changed, 113 insertions, 3 deletions
diff --git a/app-accessibility/eflite/ChangeLog b/app-accessibility/eflite/ChangeLog
index 7bb0b135a997..8fbb40effe89 100644
--- a/app-accessibility/eflite/ChangeLog
+++ b/app-accessibility/eflite/ChangeLog
@@ -1,6 +1,11 @@
# ChangeLog for app-accessibility/eflite
# Copyright 2000-2004 Gentoo Technologies, Inc.; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-accessibility/eflite/ChangeLog,v 1.2 2004/03/21 15:16:23 dholm Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-accessibility/eflite/ChangeLog,v 1.3 2004/03/22 07:37:06 eradicator Exp $
+
+ 21 Mar 2004; Jeremy Huddleston <eradicator@gentoo.org> eflite-0.3.8.ebuild,
+ files/eflite-0.3.8-daemon.patch, files/eflite.rc, files/es.conf:
+ Added init script and default conf. Created patch to enable daemon-only
+ command line arg.
21 Mar 2004; David Holm <dholm@gentoo.org> eflite-0.3.8.ebuild:
Added to ~ppc.
diff --git a/app-accessibility/eflite/eflite-0.3.8.ebuild b/app-accessibility/eflite/eflite-0.3.8.ebuild
index 65a03bc5a414..a107846fe008 100644
--- a/app-accessibility/eflite/eflite-0.3.8.ebuild
+++ b/app-accessibility/eflite/eflite-0.3.8.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/app-accessibility/eflite/eflite-0.3.8.ebuild,v 1.3 2004/03/22 05:32:15 eradicator Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-accessibility/eflite/eflite-0.3.8.ebuild,v 1.4 2004/03/22 07:37:06 eradicator Exp $
inherit eutils
@@ -23,15 +23,22 @@ src_unpack() {
unpack ${A}
cd ${S}
epatch ${FILESDIR}/${P}-shared_flite.patch
+ epatch ${FILESDIR}/${P}-daemon.patch
WANT_AUTOCONF=2.5 autoconf
}
src_install() {
dobin eflite || die
dodoc ChangeLog README INSTALL eflite_test.txt
+
+ insinto /etc
+ doins ${FILESDIR}/es.conf
+
+ exeinto /etc/init.d
+ newins ${FILESDIR}/eflite.rc eflite
}
pkg_postinst() {
einfo "To test eflite, you can run:"
- einfo "gzcat /usr/share/doc/${P}/eflite_test.txt | eflite"
+ einfo "gzcat /usr/share/doc/${P}/eflite_test.txt.gz | eflite"
}
diff --git a/app-accessibility/eflite/files/eflite-0.3.8-daemon.patch b/app-accessibility/eflite/files/eflite-0.3.8-daemon.patch
new file mode 100644
index 000000000000..ceb9dbf8565b
--- /dev/null
+++ b/app-accessibility/eflite/files/eflite-0.3.8-daemon.patch
@@ -0,0 +1,59 @@
+diff -Naur eflite-0.3.8.orig/es.c eflite-0.3.8/es.c
+--- eflite-0.3.8.orig/es.c 2004-02-20 15:58:35.000000000 -0800
++++ eflite-0.3.8/es.c 2004-03-21 23:32:25.000000000 -0800
+@@ -760,9 +760,13 @@
+ char *input = NULL;
+ int more_opts = 1;
+ int debug = 0;
++ int daemon_only = 0;
+
+- while (more_opts) switch(getopt_long(argc, argv, "df:v", (struct option *)&longopts, NULL))
++ while (more_opts) switch(getopt_long(argc, argv, "Ddf:v", (struct option *)&longopts, NULL))
+ {
++ case 'D':
++ daemon_only = 1;
++ break;
+ case 'd':
+ debug = 1;
+ break;
+@@ -783,19 +787,32 @@
+ sockname = lookup_string(NULL, "socketfile");
+ if (!sockname) sockname = "/tmp/es.socket";
+ local_fd = sockconnect(sockname);
+- if (local_fd != -1) passthrough(infile, local_fd);
+- if (!debug && (child = fork()))
++
++ if(daemon_only)
+ {
+- usleep(200000);
+- local_fd = sockconnect(sockname);
+- if (local_fd == -1)
++ if(local_fd != -1)
+ {
+- es_log(1 | LOG_STDERR, "Daemon not accepting connections -- exiting\n");
++ es_log(1 | LOG_STDERR, "Socket already exists. Exiting.\n");
+ exit(1);
+ }
+- passthrough(infile, local_fd);
+- exit(0);
+ }
++ else
++ {
++ if (local_fd != -1) passthrough(infile, local_fd);
++ if (!debug && (child = fork()))
++ {
++ usleep(200000);
++ local_fd = sockconnect(sockname);
++ if (local_fd == -1)
++ {
++ es_log(1 | LOG_STDERR, "Daemon not accepting connections -- exiting\n");
++ exit(1);
++ }
++ passthrough(infile, local_fd);
++ exit(0);
++ }
++ }
++
+ punct_some = lookup_string(NULL, "punct_some");
+ if (punct_some == NULL) punct_some = "@#$%^&_[]{}\\|";
+ punct_all = lookup_string(NULL, "punct_all");
diff --git a/app-accessibility/eflite/files/eflite.rc b/app-accessibility/eflite/files/eflite.rc
new file mode 100644
index 000000000000..f2f52c2f64cf
--- /dev/null
+++ b/app-accessibility/eflite/files/eflite.rc
@@ -0,0 +1,28 @@
+#!/sbin/runscript
+# Copyright 1999-2004 Gentoo Technologies, Inc.
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-accessibility/eflite/files/eflite.rc,v 1.1 2004/03/22 07:37:06 eradicator Exp $
+
+depend() {
+ need alsasound
+}
+
+start() {
+ ebegin "Starting eflite"
+ start-stop-daemon --start --exec /usr/bin/eflite --background \
+ --quiet --pidfile /var/run/eflite.pid --make-pidfile -- -D
+
+ SOCKET=`egrep '^sockname=' /etc/es.conf | sed 's/^sockname=//'`
+ [ ! -S ${SOCKET} ] && SOCKET=/tmp/es.socket
+
+ chown root.speech ${SOCKET}
+ chmod 666 ${SOCKET}
+
+ eend $?
+}
+
+stop() {
+ ebegin "Stopping eflite"
+ start-stop-daemon --stop --quiet --pidfile /var/run/eflite.pid
+ eend $?
+}
diff --git a/app-accessibility/eflite/files/es.conf b/app-accessibility/eflite/files/es.conf
new file mode 100644
index 000000000000..0eb6b26dcaeb
--- /dev/null
+++ b/app-accessibility/eflite/files/es.conf
@@ -0,0 +1,11 @@
+# What socket do we listen on
+sockname=/tmp/es.socket
+
+# What volume do we set?
+tone_volume: 8192
+
+# Do we use the PC Speaker? (0/1)
+speaker_tones: 0
+
+# Do we use the sound card (via flite)? (0/1)
+soundcard_tones: 1