[Canna-dev 115] Re: manのディレクトリについて

Zurück zum Archiv-Index

AIDA Shinra aida-****@jcom*****
2002年 12月 22日 (日) 19:34:05 JST


相田です。

こんな感じでしょうか?

Index: Canna.conf.dist
===================================================================
RCS file: /cvsroot/canna/canna/Canna.conf.dist,v
retrieving revision 1.6
diff -u -r1.6 Canna.conf.dist
--- Canna.conf.dist	7 Nov 2002 14:33:43 -0000	1.6
+++ Canna.conf.dist	22 Dec 2002 10:33:00 -0000
@@ -132,21 +132,43 @@
 
 /* rootにならずにインストールする時はこれを定義して下さい */
 /* #define InstallAsUser */
-cannaPrefix = /usr/local/canna
+/* 従来と互換のディレクトリ構造にする場合はこれを定義してください */
+/* #define ObsoleteInstallDir */
+#ifdef InstallAsUser
+# define DefCannaPrefix $(HOME)/canna
+# define DefErrDir $(cannaPrefix)/log
+# define DefLibCannaDir $(cannaExecPrefix)/lib
+#else 
+# define DefCannaPrefix /usr/local/canna
+# ifdef ObsoleteInstallDir
+#  define DefErrDir /usr/spool/canna
+#  define DefLibCannaDir /usr/lib
+# else
+#  define DefErrDir /var/log
+#  define DefLibCannaDir $(cannaExecPrefix)/lib
+# endif
+#endif
+#ifdef ObsoleteInstallDir
+# define DefCannaSrvDir $(cannaExecPrefix)/bin
+# define DefCannaLibDir $(cannaPrefix)/lib
+#else
+# define DefCannaSrvDir $(cannaExecPrefix)/sbin
+# define DefCannaLibDir $(cannaPrefix)/share/canna
+#endif
+
+cannaPrefix = DefCannaPrefix
 cannaExecPrefix = $(cannaPrefix)
 cannaBinDir = $(cannaExecPrefix)/bin
-cannaSrvDir = $(cannaExecPrefix)/bin
-cannaLibDir = $(cannaPrefix)/lib
+cannaSrvDir = DefCannaSrvDir
+XCOMM cannaLibDir = /var/lib/canna
+XCOMM cannaLibDir = /var/db/canna
+cannaLibDir = DefCannaLibDir
+XCOMM cannaManDir = $(cannaPrefix)/share/man
 cannaManDir = $(cannaPrefix)/man
 cannaIncDir = $(cannaPrefix)/include/canna
 
-#ifdef InstallAsUser
-libCannaDir = $(cannaExecPrefix)/lib
-ErrDir  = $(cannaExecPrefix)/log
-#else
-libCannaDir = /usr/lib
-ErrDir  = /usr/spool/canna
-#endif
+libCannaDir = DefLibCannaDir
+ErrDir  = DefErrDir
 
 /* 次の3行は変更しないでください */
 wcharDefinition = -DCANNA_WCHAR
@@ -369,15 +391,32 @@
 #ifdef InstallManPageLong
 #undef InstallManPageLong
 #endif
+
+#ifdef ObsoleteInstallDir
+#define ManInstDir man$(MANSUFF(X)
+#define ManBase(dest) dest.$(MANSUFFIX)
+#define LibManInstDir man$(LIBMANSUFFIX)
+#define LibManBase(dest) dest.$(LIBMANSUFFIX)
+#else /* !ObsoleteInstallDir */
+#define ManInstDir man1
+#define ManBase(dest) dest.1
+#define LibManInstDir man3
+#define LibManBase(dest) dest.3
+#endif /* !ObsoleteInstallDir */
+#define ManDest(dest) ManInstDir/ManBase(dest)
+#define LibManDest(dest) LibManInstDir/LibManBase(dest)
+#define ManTop(destdir) $(DESTDIR)destdir
+#define JManTop(destdir) $(DESTDIR)destdir/$(JMNLOCALE)
+
 #ifdef JAPANESEMAN
 #define	InstallManPageLong(file,destdir,dest)				@@\
 ConvertPathName(file.tmp,file.man)					@@\
 ConvertPathName(file.jtmp,file.jmn)					@@\
 install.man:: file.tmp file.jtmp					@@\
-	MakeDir($(DESTDIR)destdir/man$(MANSUFFIX))			@@\
-	MakeDir($(DESTDIR)destdir/$(JMNLOCALE)/man$(MANSUFFIX))		@@\
-	$(INSTALL) -c $(INSTMANFLAGS) file.tmp $(DESTDIR)destdir/man$(MANSUFFIX)/dest.$(MANSUFFIX)	@@\
-	$(INSTALL) -c $(INSTMANFLAGS) file.jtmp $(DESTDIR)destdir/$(JMNLOCALE)/man$(MANSUFFIX)/dest.$(MANSUFFIX)	@@\
+	MakeDir($(DESTDIR)destdir/ManInstDir)				@@\
+	MakeDir($(DESTDIR)destdir/$(JMNLOCALE)/ManInstDir)		@@\
+	$(INSTALL) -c $(INSTMANFLAGS) file.tmp ManTop(destdir)/ManDest(dest)	@@\
+	$(INSTALL) -c $(INSTMANFLAGS) file.jtmp JManTop(destdir)/ManDest(dest)	@@\
 	$(RM) file.tmp file.jtmp					@@\
 clean::									@@\
 	$(RM) file.tmp file.jtmp
@@ -385,8 +424,8 @@
 #define	InstallManPageLong(file,destdir,dest)				@@\
 ConvertPathName(file.tmp,file.man)					@@\
 install.man:: file.tmp							@@\
-	MakeDir($(DESTDIR)destdir/man$(MANSUFFIX))			@@\
-	$(INSTALL) -c $(INSTMANFLAGS) file.tmp $(DESTDIR)destdir/man$(MANSUFFIX)/dest.$(MANSUFFIX)	@@\
+	MakeDir($(DESTDIR)destdir/ManInstDir)				@@\
+	$(INSTALL) -c $(INSTMANFLAGS) file.tmp ManTop(destdir)/ManDest(dest)	@@\
 	$(RM) file.tmp							@@\
 clean::									@@\
 	$(RM) file.tmp
@@ -406,10 +445,10 @@
 ConvertPathName(file.tmp,file.man)					@@\
 ConvertPathName(file.jtmp,file.jmn)					@@\
 install.man:: file.tmp file.jtmp					@@\
-	MakeDir($(DESTDIR)destdir/man$(LIBMANSUFFIX))			@@\
-	MakeDir($(DESTDIR)destdir/$(JMNLOCALE)/man$(LIBMANSUFFIX))	@@\
-	$(INSTALL) -c $(INSTMANFLAGS) file.tmp $(DESTDIR)destdir/man$(LIBMANSUFFIX)/dest.$(LIBMANSUFFIX)	@@\
-	$(INSTALL) -c $(INSTMANFLAGS) file.jtmp $(DESTDIR)destdir/$(JMNLOCALE)/man$(LIBMANSUFFIX)/dest.$(LIBMANSUFFIX)	@@\
+	MakeDir($(DESTDIR)destdir/LibManInstDir)			@@\
+	MakeDir($(DESTDIR)destdir/$(JMNLOCALE)/LibManInstDir)		@@\
+	$(INSTALL) -c $(INSTMANFLAGS) file.tmp ManTop(destdir)/LibManDest(dest)	@@\
+	$(INSTALL) -c $(INSTMANFLAGS) file.jtmp JManTop(destdir)/LibManDest(dest)	@@\
 	$(RM) file.tmp file.jtmp					@@\
 clean::									@@\
 	$(RM) file.tmp file.jtmp
@@ -417,8 +456,8 @@
 #define	InstallLibManPageLong(file,destdir,dest)			@@\
 ConvertPathName(file.tmp,file.man)					@@\
 install.man:: file.tmp							@@\
-	MakeDir($(DESTDIR)destdir/man$(LIBMANSUFFIX))			@@\
-	$(INSTALL) -c $(INSTMANFLAGS) file.tmp $(DESTDIR)destdir/man$(LIBMANSUFFIX)/dest.$(LIBMANSUFFIX)	@@\
+	MakeDir($(DESTDIR)destdir/LibManInstDir)			@@\
+	$(INSTALL) -c $(INSTMANFLAGS) file.tmp ManTop(destdir)/LibManDest(dest)	@@\
 	$(RM) file.tmp							@@\
 clean::									@@\
 	$(RM) file.tmp
@@ -437,17 +476,17 @@
 #define InstallLibManPageAliases(file,destdir,aliases)			@@\
 install.man::								@@\
 	@for i in aliases; do (set -x; \				@@\
-	$(RM) $(DESTDIR)destdir/man$(LIBMANSUFFIX)/$$i.$(LIBMANSUFFIX); \	@@\
-	$(LN) file.$(LIBMANSUFFIX) $(DESTDIR)destdir/man$(LIBMANSUFFIX)/$$i.$(LIBMANSUFFIX); \	@@\
-	$(RM) $(DESTDIR)destdir/$(JMNLOCALE)/man$(LIBMANSUFFIX)/$$i.$(LIBMANSUFFIX); \	@@\
-	$(LN) file.$(LIBMANSUFFIX) $(DESTDIR)destdir/$(JMNLOCALE)/man$(LIBMANSUFFIX)/$$i.$(LIBMANSUFFIX); \	@@\
+	$(RM) $(DESTDIR)destdir/LibManDest($$i); \			@@\
+	$(LN) LibManBase(file) ManTop(destdir)/LibManDest($$i); \	@@\
+	$(RM) $(DESTDIR)destdir/$(JMNLOCALE)/LibManDest($$i); \		@@\
+	$(LN) LibManBase(file) JManTop(destdir)/LibManDest($$i) \	@@\
 	); done
 #else
 #define InstallLibManPageAliases(file,destdir,aliases)			@@\
 install.man::								@@\
 	@for i in aliases; do (set -x; \				@@\
-	$(RM) $(DESTDIR)destdir/man$(LIBMANSUFFIX)/$$i.$(LIBMANSUFFIX); \	@@\
-	$(LN) file.$(LIBMANSUFFIX) $(DESTDIR)destdir/man$(LIBMANSUFFIX)/$$i.$(LIBMANSUFFIX) \	@@\
+	$(RM) $(DESTDIR)destdir/LibManDest($$i); \			@@\
+	$(LN) LibManBase(file) JManTop(destdir)/LibManDest($$i) \	@@\
 	); done
 #endif
 #ifndef MakeDirectoriesLong
@@ -557,5 +596,11 @@
 	 echo "#define DONT_HAVE_RENAME $(dontHaveRename)"; \		@@\
 	 echo "#ifdef nec"; \						@@\
 	 echo "#undef nec"; \						@@\
-	 echo "#endif") > $@
+	 echo "#endif") > junk; \					@@\
+	 if test -r $@ && cmp -s junk $@; then \			@@\
+	   echo "$@ unchanged"; \					@@\
+	   rm junk; \							@@\
+	 else \								@@\
+	   mv junk $@; \						@@\
+	fi
 #endif
Index: cmd/catdic/Imakefile
===================================================================
RCS file: /cvsroot/canna/canna/cmd/catdic/Imakefile,v
retrieving revision 1.4
diff -u -r1.4 Imakefile
--- cmd/catdic/Imakefile	9 Nov 2002 07:16:45 -0000	1.4
+++ cmd/catdic/Imakefile	22 Dec 2002 10:33:00 -0000
@@ -51,6 +51,14 @@
 DependTarget()
 LintTarget()
 
+#ifdef ObsoleteInstallDir
+# define cannakillDir $(cannaBinDir)
+# define cannakillLink(base) base
+#else
+# define cannakillDir $(cannaSrvDir)
+# define cannakillLink(base) $(cannaBinDir)/base
+#endif
+
 #if defined(__EMX__) || defined(__CYGWIN32__)
 install::
 	$(RM) $(DESTDIR)$(cannaBinDir)/cpdic.exe
@@ -62,7 +70,7 @@
 	$(RM) $(DESTDIR)$(cannaBinDir)/chmoddic.exe
 	$(RM) $(DESTDIR)$(cannaBinDir)/addwords.exe
 	$(RM) $(DESTDIR)$(cannaBinDir)/delwords.exe
-	$(RM) $(DESTDIR)$(cannaBinDir)/cannakill.exe
+	$(RM) $(DESTDIR)cannakillDir/cannakill.exe
 	$(LN) catdic.exe $(DESTDIR)$(cannaBinDir)/cpdic.exe
 	$(LN) catdic.exe $(DESTDIR)$(cannaBinDir)/lsdic.exe
 	$(LN) catdic.exe $(DESTDIR)$(cannaBinDir)/mkdic.exe
@@ -72,7 +80,7 @@
 	$(LN) catdic.exe $(DESTDIR)$(cannaBinDir)/chmoddic.exe
 	$(LN) catdic.exe $(DESTDIR)$(cannaBinDir)/addwords.exe
 	$(LN) catdic.exe $(DESTDIR)$(cannaBinDir)/delwords.exe
-	$(LN) catdic.exe $(DESTDIR)$(cannaBinDir)/cannakill.exe
+	$(LN) cannakillLink(catdic.exe) $(DESTDIR)cannakillDir/cannakill.exe
 #else
 install::
 	$(RM) $(DESTDIR)$(cannaBinDir)/cpdic
@@ -84,7 +92,7 @@
 	$(RM) $(DESTDIR)$(cannaBinDir)/chmoddic
 	$(RM) $(DESTDIR)$(cannaBinDir)/addwords
 	$(RM) $(DESTDIR)$(cannaBinDir)/delwords
-	$(RM) $(DESTDIR)$(cannaBinDir)/cannakill
+	$(RM) $(DESTDIR)cannakillDir/cannakill
 	$(LN) catdic $(DESTDIR)$(cannaBinDir)/cpdic
 	$(LN) catdic $(DESTDIR)$(cannaBinDir)/lsdic
 	$(LN) catdic $(DESTDIR)$(cannaBinDir)/mkdic
@@ -94,5 +102,5 @@
 	$(LN) catdic $(DESTDIR)$(cannaBinDir)/chmoddic
 	$(LN) catdic $(DESTDIR)$(cannaBinDir)/addwords
 	$(LN) catdic $(DESTDIR)$(cannaBinDir)/delwords
-	$(LN) catdic $(DESTDIR)$(cannaBinDir)/cannakill
+	$(LN) cannakillLink(catdic) $(DESTDIR)cannakillDir/cannakill
 #endif



Canna-dev メーリングリストの案内
Zurück zum Archiv-Index