From 185d5fc35927dc4e72eedfe24b66b4ea70ef4eca Mon Sep 17 00:00:00 2001 From: Andrew Borodin Date: Thu, 16 Sep 2010 14:40:09 +0400 Subject: [PATCH] Install help files into /usr/share/mc/help instead of /usr/share/mc. Optimisation of language-specific help file creating. Signed-off-by: Andrew Borodin --- doc/hlp/Makefile.am | 5 +++-- doc/hlp/es/Makefile.am | 8 +------- doc/hlp/hlp-lang-include.am | 10 ++++++++++ doc/hlp/hu/Makefile.am | 8 +------- doc/hlp/it/Makefile.am | 8 +------- doc/hlp/pl/Makefile.am | 8 +------- doc/hlp/ru/Makefile.am | 8 +------- doc/hlp/sr/Makefile.am | 8 +------- lib/fileloc.h | 1 + src/help.c | 2 +- 10 files changed, 21 insertions(+), 45 deletions(-) create mode 100644 doc/hlp/hlp-lang-include.am diff --git a/doc/hlp/Makefile.am b/doc/hlp/Makefile.am index a84d35ab4..b3fdd8f91 100644 --- a/doc/hlp/Makefile.am +++ b/doc/hlp/Makefile.am @@ -1,10 +1,11 @@ DIST_SUBDIRS = es hu it pl ru sr SUBDIRS = $(DOC_LINGUAS) -pkgdata_DATA = mc.hlp +hlpdir = $(pkgdatadir)/help +hlp_DATA = mc.hlp EXTRA_DIST = xnc.hlp -CLEANFILES = $(pkgdata_DATA) +CLEANFILES = $(hlp_DATA) mc.hlp: $(top_builddir)/doc/man/mc.1 $(srcdir)/xnc.hlp $(top_builddir)/src/man2hlp/man2hlp - $(top_builddir)/src/man2hlp/man2hlp $(top_builddir)/doc/man/mc.1 $(srcdir)/xnc.hlp mc.hlp diff --git a/doc/hlp/es/Makefile.am b/doc/hlp/es/Makefile.am index b48a1dfb1..ede2aa8dc 100644 --- a/doc/hlp/es/Makefile.am +++ b/doc/hlp/es/Makefile.am @@ -1,9 +1,3 @@ HLP_LANG=es -MAN2HLP=$(top_builddir)/src/man2hlp/man2hlp -pkgdata_DATA = mc.hlp.$(HLP_LANG) -EXTRA_DIST = xnc.hlp -CLEANFILES = $(pkgdata_DATA) - -mc.hlp.$(HLP_LANG): $(top_builddir)/doc/man/$(HLP_LANG)/mc.1 $(srcdir)/xnc.hlp $(MAN2HLP) - - $(MAN2HLP) $(top_builddir)/doc/man/$(HLP_LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(HLP_LANG) +include ../hlp-lang-include.am diff --git a/doc/hlp/hlp-lang-include.am b/doc/hlp/hlp-lang-include.am new file mode 100644 index 000000000..a23996fb7 --- /dev/null +++ b/doc/hlp/hlp-lang-include.am @@ -0,0 +1,10 @@ +MAN2HLP=$(top_builddir)/src/man2hlp/man2hlp + +hlpdir = $(pkgdatadir)/help +hlp_DATA = mc.hlp.$(HLP_LANG) + +EXTRA_DIST = xnc.hlp +CLEANFILES = $(hlp_DATA) + +mc.hlp.$(HLP_LANG): $(top_builddir)/doc/man/$(HLP_LANG)/mc.1 $(srcdir)/xnc.hlp $(MAN2HLP) + - $(MAN2HLP) $(top_builddir)/doc/man/$(HLP_LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(HLP_LANG) diff --git a/doc/hlp/hu/Makefile.am b/doc/hlp/hu/Makefile.am index 7464bf68b..8626d4695 100644 --- a/doc/hlp/hu/Makefile.am +++ b/doc/hlp/hu/Makefile.am @@ -1,9 +1,3 @@ HLP_LANG=hu -MAN2HLP=$(top_builddir)/src/man2hlp/man2hlp -pkgdata_DATA = mc.hlp.$(HLP_LANG) -EXTRA_DIST = xnc.hlp -CLEANFILES = $(pkgdata_DATA) - -mc.hlp.$(HLP_LANG): $(top_builddir)/doc/man/$(HLP_LANG)/mc.1 $(srcdir)/xnc.hlp $(MAN2HLP) - - $(MAN2HLP) $(top_builddir)/doc/man/$(HLP_LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(HLP_LANG) +include ../hlp-lang-include.am diff --git a/doc/hlp/it/Makefile.am b/doc/hlp/it/Makefile.am index 4054b6b1a..dd0ed3b79 100644 --- a/doc/hlp/it/Makefile.am +++ b/doc/hlp/it/Makefile.am @@ -1,9 +1,3 @@ HLP_LANG=it -MAN2HLP=$(top_builddir)/src/man2hlp/man2hlp -pkgdata_DATA = mc.hlp.$(HLP_LANG) -EXTRA_DIST = xnc.hlp -CLEANFILES = $(pkgdata_DATA) - -mc.hlp.$(HLP_LANG): $(top_builddir)/doc/man/$(HLP_LANG)/mc.1 $(srcdir)/xnc.hlp $(MAN2HLP) - - $(MAN2HLP) $(top_builddir)/doc/man/$(HLP_LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(HLP_LANG) +include ../hlp-lang-include.am diff --git a/doc/hlp/pl/Makefile.am b/doc/hlp/pl/Makefile.am index e55b26c5b..882391309 100644 --- a/doc/hlp/pl/Makefile.am +++ b/doc/hlp/pl/Makefile.am @@ -1,9 +1,3 @@ HLP_LANG=pl -MAN2HLP=$(top_builddir)/src/man2hlp/man2hlp -pkgdata_DATA = mc.hlp.$(HLP_LANG) -EXTRA_DIST = xnc.hlp -CLEANFILES = $(pkgdata_DATA) - -mc.hlp.$(HLP_LANG): $(top_builddir)/doc/man/$(HLP_LANG)/mc.1 $(srcdir)/xnc.hlp $(MAN2HLP) - - $(MAN2HLP) $(top_builddir)/doc/man/$(HLP_LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(HLP_LANG) +include ../hlp-lang-include.am diff --git a/doc/hlp/ru/Makefile.am b/doc/hlp/ru/Makefile.am index 105c475cd..c7bd58eff 100644 --- a/doc/hlp/ru/Makefile.am +++ b/doc/hlp/ru/Makefile.am @@ -1,9 +1,3 @@ HLP_LANG=ru -MAN2HLP=$(top_builddir)/src/man2hlp/man2hlp -pkgdata_DATA = mc.hlp.$(HLP_LANG) -EXTRA_DIST = xnc.hlp -CLEANFILES = $(pkgdata_DATA) - -mc.hlp.$(HLP_LANG): $(top_builddir)/doc/man/$(HLP_LANG)/mc.1 $(srcdir)/xnc.hlp $(MAN2HLP) - - $(MAN2HLP) $(top_builddir)/doc/man/$(HLP_LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(HLP_LANG) +include ../hlp-lang-include.am diff --git a/doc/hlp/sr/Makefile.am b/doc/hlp/sr/Makefile.am index 4c80424ee..04e13d473 100644 --- a/doc/hlp/sr/Makefile.am +++ b/doc/hlp/sr/Makefile.am @@ -1,9 +1,3 @@ HLP_LANG=sr -MAN2HLP=$(top_builddir)/src/man2hlp/man2hlp -pkgdata_DATA = mc.hlp.$(HLP_LANG) -EXTRA_DIST = xnc.hlp -CLEANFILES = $(pkgdata_DATA) - -mc.hlp.$(HLP_LANG): $(top_builddir)/doc/man/$(HLP_LANG)/mc.1 $(srcdir)/xnc.hlp $(MAN2HLP) - - $(MAN2HLP) $(top_builddir)/doc/man/$(HLP_LANG)/mc.1 $(srcdir)/xnc.hlp mc.hlp.$(HLP_LANG) +include ../hlp-lang-include.am diff --git a/lib/fileloc.h b/lib/fileloc.h index b8f9236e0..73878fe06 100644 --- a/lib/fileloc.h +++ b/lib/fileloc.h @@ -25,6 +25,7 @@ #define MC_GLOBAL_MENU "mc.menu" #define MC_LOCAL_MENU ".mc.menu" #define MC_HINT "hints" PATH_SEP_STR "mc.hint" +#define MC_HELP "help" PATH_SEP_STR "mc.hlp" #define GLOBAL_KEYMAP_FILE "mc.keymap" #define CHARSETS_LIST "mc.charsets" #define MC_LIB_EXT "mc.ext" diff --git a/src/help.c b/src/help.c index 86d6bc7a3..f7946b533 100644 --- a/src/help.c +++ b/src/help.c @@ -966,7 +966,7 @@ interactive_display (const char *filename, const char *node) if (filename != NULL) filedata = load_file (filename); else - filedata = load_mc_home_file (mc_home_alt, "mc.hlp", &hlpfile); + filedata = load_mc_home_file (mc_home_alt, MC_HELP, &hlpfile); if (filedata == NULL) message (D_ERROR, MSG_ERROR, _("Cannot open file %s\n%s"),