[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SpeechIO-86] Some suggestions regarding speechd directories



Hello,

> I have disagreed with suggestions of putting speechd in /usr/sbin in the
> past because it can just as easily be run as a non-root user, and
> /usr/sbin is generally not on most user's paths.  But everything in my
> /usr/sbin is world readable & executable.  And if the standard is that
> clear, I'll stop objecting :)
A regular user can run, lets say /usr/sbin/apache, if it's configured to
listen a port above 1024. And still apache binary may not be in his path
by default.
But hey, you're the boss and decide if these things should be happen or
not.

What if the init.d script, that I made for the deb, would be included
with
the upstream source? It's pretty general so I'm quite sure that it'll
work
with (almost) every distribution out there using SysV-stylish init.
The only thing that can cause problems is the location of the init.d
scripts.
Debian keeps'em in /etc/init.d while RedHat in /etc/rc.d/init.d,
if I remeber right. In this case speechd would be started by root on
system start-up after running "make install" I think that would be neat,
or?
Thought the script still needs some tweaking.

> I haven't been real comfortable w/ speechd.sub either.  I'd been thinking
> that it should have a counterpart in ~/, but because of the nature of
> speechd, it will probably not be used by remote users, and will probably
> only be used by users with root access.  I don't object to that location.
Wohoo.

> Do your modifications give the uninstall the ability to remove files from
> old locations ?  Does the install remove old files ?
No not yet. But it should, really. I fact, I didn't think about that
option while modifying Makefile for the 1st time.
But that can be easily added. Actually diff, which does also that,
is right here below.
--- speechd.old/Makefile	Tue Aug 10 00:19:30 1999
+++ speechd/Makefile	Wed Aug 11 19:39:49 1999
@@ -3,31 +3,50 @@
 #
 # Created:  Mon Aug  9 13:00:41 EDT 1999 mortis@voicenet.com
 #
+# Modified: Wed Aug 11 19:39:40 EEST 1999 Tuomas Jormola <tj@sgic.fi>
+#
 
 # generic, targets and other vars
+PREFIX=/usr/local
 SPEECHD=speechd
 CATSPEECH=catspeech
-MANDIR=man/man1
+MANDIR=man
 BINDIR=bin
-VERSION=$(shell awk -F\' '/VERSION = / {print $$2}' $(SPEECHD))
-PERL_BINARY=/usr/bin/perl
+SBINDIR=sbin
+VERSION=$(shell awk -F\' '/VERSION = / (print $$2)' $(SPEECHD))
+PERL_BINARY=$(shell which perl)
 INCVER=incver.pl
 
 # bin install vars
-INSTALL_BINDIR=/usr/local/bin
+INSTALL_BINDIR=$(PREFIX)/bin
 BIN_MODE=755
 BIN_OWNER=root
 BIN_GROUP=root
 INSTALL=install
 BIN_INSTALL_FLAGS= --mode=$(BIN_MODE) --owner=$(BIN_OWNER) --group=$(BIN_GROUP)
 
+# sbin install vars
+INSTALL_SBINDIR=$(PREFIX)/sbin
+SBIN_MODE=755
+SBIN_OWNER=root
+SBIN_GROUP=root
+INSTALL=install
+SBIN_INSTALL_FLAGS= --mode=$(SBIN_MODE) --owner=$(SBIN_OWNER) --group=$(SBIN_GROUP)
+
 # man install vars
-INSTALL_MANDIR=/usr/local/man/man1
+INSTALL_MANDIR=$(PREFIX)/man
 MAN_MODE=644
 MAN_OWNER=root
 MAN_GROUP=root
 MAN_INSTALL_FLAGS= --mode=$(MAN_MODE) --owner=$(MAN_OWNER) --group=$(MAN_GROUP)
 
+# share install vars
+INSTALL_SHAREDIR=$(PREFIX)/share/speechd
+SHARE_MODE=644
+SHARE_OWNER=root
+SHARE_GROUP=root
+SHARE_INSTALL_FLAGS= --mode=$(SHARE_MODE) --owner=$(SHARE_OWNER) --group=$(SHARE_GROUP)
+
 SPEECHD_FIFO=/dev/speech
 FIFO_MODE=0666
 
@@ -40,9 +59,9 @@
 
 
 # build targets (files/directories)
-DIRS=$(MANDIR) $(BINDIR)
-MANPAGES=$(MANDIR)/$(SPEECHD).1 $(MANDIR)/$(CATSPEECH).1
-SCRIPTS=$(BINDIR)/$(CATSPEECH) $(BINDIR)/$(SPEECHD)
+DIRS=$(MANDIR)/man1 $(MANDIR)/man8 $(BINDIR) $(SBINDIR) $(INSTALL_SHAREDIR)
+MANPAGES=$(MANDIR)/man8/$(SPEECHD).8 $(MANDIR)/man1/$(CATSPEECH).1
+SCRIPTS=$(BINDIR)/$(CATSPEECH) $(SBINDIR)/$(SPEECHD)
 
 ALL_DEPS= $(DIRS) $(MANPAGES) $(SCRIPTS)
 
@@ -55,23 +74,23 @@
 $(DIRS):
 	mkdir -p $@
 
-$(MANDIR)/$(SPEECHD).1: $(MANDIR) $(SPEECHD)
-	pod2man $(SPEECHD) > $(MANDIR)/$(SPEECHD).1
+$(MANDIR)/man8/$(SPEECHD).8: $(MANDIR) $(SPEECHD)
+	pod2man $(SPEECHD) > $(MANDIR)/man8/$(SPEECHD).8
 
-$(MANDIR)/$(CATSPEECH).1: $(MANDIR) $(CATSPEECH)
-	pod2man $(CATSPEECH) > $(MANDIR)/$(CATSPEECH).1
+$(MANDIR)/man1/$(CATSPEECH).1: $(MANDIR) $(CATSPEECH)
+	pod2man $(CATSPEECH) > $(MANDIR)/man1/$(CATSPEECH).1
 
-$(BINDIR)/speechd: $(BINDIR) $(SPEECHD)
-	echo '#!$(PERL_BINARY) -w' > $(BINDIR)/$(SPEECHD)
-	cat $(SPEECHD) >> $(BINDIR)/$(SPEECHD)
+$(SBINDIR)/$(SPEECHD): $(SBINDIR) $(SPEECHD)
+	echo '#!$(PERL_BINARY) -w' > $(SBINDIR)/$(SPEECHD)
+	cat $(SPEECHD) >> $(SBINDIR)/$(SPEECHD)
 
 $(BINDIR)/$(CATSPEECH): $(BINDIR) $(CATSPEECH)
 	echo '#!$(PERL_BINARY) -w' > $(BINDIR)/$(CATSPEECH)
 	cat $(CATSPEECH) >> $(BINDIR)/$(CATSPEECH)
 
-install: $(ALL_DEPS) install-bin install-man install-rc $(SPEECHD_FIFO)
+install: $(ALL_DEPS) uninstall-old install-bin install-sbin install-man install-share install-rc $(SPEECHD_FIFO)
 
-uninstall: uninstall-bin uninstall-man uninstall-rc uninstall-fifo
+uninstall: uninstall-old uninstall-bin uninstall-sbin uninstall-man uninstall-share uninstall-rc uninstall-fifo
 
 $(SPEECHD_FIFO):
 	mkfifo --mode=$(FIFO_MODE) $(SPEECHD_FIFO)
@@ -82,38 +101,55 @@
 install-bin: 
 	$(INSTALL) $(BIN_INSTALL_FLAGS) $(BINDIR)/$(CATSPEECH) \
 		$(INSTALL_BINDIR)/$(CATSPEECH)
-	$(INSTALL) $(BIN_INSTALL_FLAGS) $(BINDIR)/$(SPEECHD) \
-		$(INSTALL_BINDIR)/$(SPEECHD)
+uninstall-old:
+	@for rmme in /usr/bin/speechd /usr/local/bin/speechd \
+		/usr/man/man1/speechd.1 /usr/local/man/man1/speechd.1 \
+		/etc/speechd.sub; do \
+		if test -w $$rmme; then \
+		echo -n Removing obsolete $$rmme... ;rm -f $$rmme; echo Done.; fi; done
 
 uninstall-bin:
-	rm -f $(INSTALL_BINDIR)/$(CATSPEECH) $(INSTALL_BINDIR)/$(SPEECHD)
+	rm -f $(INSTALL_BINDIR)/$(CATSPEECH)
+
+install-sbin:
+	$(INSTALL) $(SBIN_INSTALL_FLAGS) $(SBINDIR)/$(SPEECHD) \
+		$(INSTALL_SBINDIR)/$(SPEECHD)
+
+uninstall-sbin:
+	rm -f $(INSTALL_SBINDIR)/$(SPEECHD)
 
 install-man:
-	$(INSTALL) $(MAN_INSTALL_FLAGS) $(MANDIR)/$(SPEECHD).1 \
-		$(INSTALL_MANDIR)/$(SPEECHD).1
-	$(INSTALL) $(MAN_INSTALL_FLAGS) $(MANDIR)/$(CATSPEECH).1 \
-		$(INSTALL_MANDIR)/$(CATSPEECH).1
+	$(INSTALL) $(MAN_INSTALL_FLAGS) $(MANDIR)/man8/$(SPEECHD).8 \
+		$(INSTALL_MANDIR)/man8/$(SPEECHD).8
+	$(INSTALL) $(MAN_INSTALL_FLAGS) $(MANDIR)/man1/$(CATSPEECH).1 \
+		$(INSTALL_MANDIR)/man1/$(CATSPEECH).1
 
 uninstall-man:
-	rm -f $(INSTALL_MANDIR)/$(CATSPEECH).1 $(INSTALL_MANDIR)/$(SPEECHD).1
+	rm -f $(INSTALL_MANDIR)/man1/$(CATSPEECH).1 $(INSTALL_MANDIR)/man8/$(SPEECHD).8
+
+install-share:
+	$(INSTALL) $(SHARE_INSTALL_FLAGS) $(SPEECHD).sub \
+		$(INSTALL_SHAREDIR)/$(SPEECHD).sub
+
+uninstall-share:
+	rm -f $(INSTALL_SHAREDIR)/$(SPEECHD).sub
+	@if test ! -e $(INSTALL_SHAREDIR)/*; then rmdir $(INSTALL_SHAREDIR); fi
 
 install-rc:
 	$(INSTALL) $(RC_INSTALL_FLAGS) speechdrc \
 		$(INSTALL_RCDIR)/speechdrc
-	$(INSTALL) $(RC_INSTALL_FLAGS) speechd.sub \
-		$(INSTALL_RCDIR)/speechd.sub
 	
 uninstall-rc:
-	rm -f $(INSTALL_RCDIR)/speechd.sub $(INSTALL_RCDIR)/speechdrc
+	rm -f $(INSTALL_RCDIR)/speechd.sub
 
 clean:
-	rm -rf man bin speechd-*.tar.gz
+	rm -rf man bin sbin speechd-*.tar.gz
 
 $(SPEECHD)-version:
-	perl $(INCVER) $(SPEECHD)
+	$(PERL_BINARY) $(INCVER) $(SPEECHD)
 
 $(CATSPEECH)-version:
-	perl $(INCVER) $(CATSPEECH)
+	$(PERL_BINARY) $(INCVER) $(CATSPEECH)
 
 dist:
 	tar czvf $(SPEECHD)-$(VERSION).tar.gz -C.. speechd/
--- speechd.old/speechd	Wed Aug 11 05:09:17 1999
+++ speechd/speechd	Wed Aug 11 17:36:17 1999
@@ -342,7 +342,7 @@
 
 sub read_speechd_sub
 {
-  if (do "/etc/speechd.sub") {print "Loaded speechd.sub.\n";}
+  if (do "/usr/local/share/speechd/speechd.sub") {print "Loaded speechd.sub.\n";}
                         else {print "Failed to load speechd.sub.\n"}
 }
 
@@ -452,7 +452,7 @@
 for the root user.
 
 =item
-/etc/speechd.sub
+/usr/local/share/speechd/speechd.sub
 
 This file (as installed) contains a hashtable of string substitions to
 perform on incomming text.  The substitution raises the overhead of