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

[SpeechIO-86] Some suggestions regarding speechd directories



Hi speechIO folks,

Here's my suggestion regarding to speechd and directories it uses.

According to FHS (Filesystem Hierarchy Standard -
http://www.pathname.com/fhs/2.0),
the correct place for system programs is PREFIX/sbin
(http://www.pathname.com/fhs/2.0/fhs-4.7.html). However, currently
the default installation path to speechd is PREFIX/bin. This also means
that
the speechd man-page must be put in PREFIX/man/man8/speechd.8, since
man8 is
the place for system program man-pages. man1 is for user programs. I
think you can
easily count speechd as a system program, though a regular user can run
it aswell.
Before you start to complain, do "ps axu|grep -v root". In my system
there're
exactly 10 non-root, standard daemons that lives in /sbin or /usr/sbin
running.

Also the way that speechd distribution treats speechd.sub bugs me.
IMHO speechd.sub definitely is a data-file, not a config-file. The
correct place
for architecture-independent data-files is PREFIX/share/PROGRAM
(http://www.pathname.com/fhs/2.0/fhs-4.8.html). Users don't necessarily
have to
edit this file. However, if someone imporves it, he'll edit the file and
then send
the imporved version to the author so the improvements are added to
the next upstream release. You don't act like that with config-files.

I don't see any conflicts here why these changes would be rejected.

Here's a diff that applies my pacthes to the current (0.50) speechd
distribution.
Please tell me your honest opinions about my opinion.

However, if all this is a big no-no, I'm still going to use these paths
for
my speechd debs, since Debian strictly wants to follow these rules.

Regards,
Tuomas Jormola <tj@sgic.fi>
Turmio in IRCnet/#rihu and EFnet/#speechIO
diff -u speechd.old/Makefile speechd/Makefile
--- speechd.old/Makefile	Tue Aug 10 00:19:30 1999
+++ speechd/Makefile	Wed Aug 11 17:42:29 1999
@@ -3,31 +3,50 @@
 #
 # Created:  Mon Aug  9 13:00:41 EDT 1999 mortis@voicenet.com
 #
+# Modified: Wed Aug 11 17:42:22 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) $(SHARE_DIR)
+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) install-bin install-sbin install-man install-share install-rc $(SPEECHD_FIFO)
 
-uninstall: uninstall-bin uninstall-man uninstall-rc uninstall-fifo
+uninstall: uninstall-bin uninstall-sbin uninstall-man uninstall-share uninstall-rc uninstall-fifo
 
 $(SPEECHD_FIFO):
 	mkfifo --mode=$(FIFO_MODE) $(SPEECHD_FIFO)
@@ -82,38 +101,48 @@
 install-bin: 
 	$(INSTALL) $(BIN_INSTALL_FLAGS) $(BINDIR)/$(CATSPEECH) \
 		$(INSTALL_BINDIR)/$(CATSPEECH)
-	$(INSTALL) $(BIN_INSTALL_FLAGS) $(BINDIR)/$(SPEECHD) \
-		$(INSTALL_BINDIR)/$(SPEECHD)
 
 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
 
 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/
diff -u speechd.old/speechd speechd/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