Skip to content

Commit

Permalink
Fix configuration file name and related directory name.
Browse files Browse the repository at this point in the history
	modified:   Makefile.am
	modified:   configure.ac
	modified:   main.c
	renamed:    sosreport-analyzerd.conf.example -> sosreport-analyzer.conf.example
  • Loading branch information
intrajp committed Jan 14, 2019
1 parent d8e6765 commit ee8e1e6
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 87 deletions.
98 changes: 49 additions & 49 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -11,75 +11,75 @@ bin_PROGRAMS = sosreport-analyzer
sosreport_analyzer_SOURCES = main.c
sosreport_analyzer_LDADD = -lsosreport-analyzer -lsar-analyzer

SOSREPORT_ANALYZERD_CONF_PATH = @SOSREPORT_ANALYZERD_CONF_PATH@
SOSREPORT_ANALYZERD_DATA_PATH = @SOSREPORT_ANALYZERD_DATA_PATH@
SOSREPORT_ANALYZERD_INCLUDE_PATH = @SOSREPORT_ANALYZERD_INCLUDE_PATH@
SOSREPORT_ANALYZERD_LIB_PATH = @SOSREPORT_ANALYZERD_LIB_PATH@
SAR_ANALYZERD_LIB_PATH = @SAR_ANALYZERD_LIB_PATH@
SOSREPORT_ANALYZER_CONF_PATH = @SOSREPORT_ANALYZER_CONF_PATH@
SOSREPORT_ANALYZER_DATA_PATH = @SOSREPORT_ANALYZER_DATA_PATH@
SOSREPORT_ANALYZER_INCLUDE_PATH = @SOSREPORT_ANALYZER_INCLUDE_PATH@
SOSREPORT_ANALYZER_LIB_PATH = @SOSREPORT_ANALYZER_LIB_PATH@
SAR_ANALYZER_LIB_PATH = @SAR_ANALYZER_LIB_PATH@

install-data-local: install-sosreport_analyzerd_conf install-sosreport_analyzerd_data install-sosreport_analyzerd_include install-sosreport_analyzerd_lib install-sar_analyzerd_lib
uninstall-local: uninstall-sosreport_analyzerd_conf uninstall-sosreport_analyzerd_data uninstall-sosreport_analyzerd_include uninstall-sosreport_analyzerd_lib uninstall-sar_analyzerd_lib
install-data-local: install-sosreport_analyzer_conf install-sosreport_analyzer_data install-sosreport_analyzer_include install-sosreport_analyzer_lib install-sar_analyzer_lib
uninstall-local: uninstall-sosreport_analyzer_conf uninstall-sosreport_analyzer_data uninstall-sosreport_analyzer_include uninstall-sosreport_analyzer_lib uninstall-sar_analyzer_lib

# install a default configuration file if it is not already there
install-sosreport_analyzerd_conf:
@if [ -f $(DESTDIR)$(SOSREPORT_ANALYZERD_CONF_PATH) ]; then \
echo "$(DESTDIR)$(SOSREPORT_ANALYZERD_CONF_PATH) already exists, install will not overwrite"; \
install-sosreport_analyzer_conf:
@if [ -f $(DESTDIR)$(SOSREPORT_ANALYZER_CONF_PATH) ]; then \
echo "$(DESTDIR)$(SOSREPORT_ANALYZER_CONF_PATH) already exists, install will not overwrite"; \
else \
$(mkinstalldirs) `dirname $(DESTDIR)$(SOSREPORT_ANALYZERD_CONF_PATH)`; \
$(INSTALL) -m 644 $(srcdir)/sosreport-analyzerd.conf.example $(DESTDIR)$(SOSREPORT_ANALYZERD_CONF_PATH); \
$(mkinstalldirs) `dirname $(DESTDIR)$(SOSREPORT_ANALYZER_CONF_PATH)`; \
$(INSTALL) -m 644 $(srcdir)/sosreport-analyzer.conf.example $(DESTDIR)$(SOSREPORT_ANALYZER_CONF_PATH); \
fi

uninstall-sosreport_analyzerd_conf:
-rm -f $(DESTDIR)$(SOSREPORT_ANALYZERD_CONF_PATH)
uninstall-sosreport_analyzer_conf:
-rm -f $(DESTDIR)$(SOSREPORT_ANALYZER_CONF_PATH)

# install sosreport-analyzerd.conf.example
install-sosreport_analyzerd_data:
@if [ -f $(DESTDIR)$(SOSREPORT_ANALYZERD_DATA_PATH) ]; then \
$(INSTALL) -m 644 $(srcdir)/sosreport-analyzerd.conf.example $(DESTDIR)$(SOSREPORT_ANALYZERD_DATA_PATH)/sosreport-analyzerd.conf.example; \
# install sosreport-analyzer.conf.example
install-sosreport_analyzer_data:
@if [ -f $(DESTDIR)$(SOSREPORT_ANALYZER_DATA_PATH) ]; then \
$(INSTALL) -m 644 $(srcdir)/sosreport-analyzer.conf.example $(DESTDIR)$(SOSREPORT_ANALYZER_DATA_PATH)/sosreport-analyzer.conf.example; \
else \
$(MKDIR_P) $(DESTDIR)$(SOSREPORT_ANALYZERD_DATA_PATH); \
$(INSTALL) -m 644 $(srcdir)/sosreport-analyzerd.conf.example $(DESTDIR)$(SOSREPORT_ANALYZERD_DATA_PATH)/sosreport-analyzerd.conf.example; \
$(MKDIR_P) $(DESTDIR)$(SOSREPORT_ANALYZER_DATA_PATH); \
$(INSTALL) -m 644 $(srcdir)/sosreport-analyzer.conf.example $(DESTDIR)$(SOSREPORT_ANALYZER_DATA_PATH)/sosreport-analyzer.conf.example; \
fi

uninstall-sosreport_analyzerd_data:
-rm -rf $(DESTDIR)$(SOSREPORT_ANALYZERD_DATA_PATH)
uninstall-sosreport_analyzer_data:
-rm -rf $(DESTDIR)$(SOSREPORT_ANALYZER_DATA_PATH)

# install cfg.h
install-sosreport_analyzerd_include:
@if [ -d $(DESTDIR)$(SOSREPORT_ANALYZERD_INCLUDE_PATH) ]; then \
$(INSTALL) -m 644 $(srcdir)/libsosreport-analyzer/cfg.h $(DESTDIR)$(SOSREPORT_ANALYZERD_INCLUDE_PATH)/cfg.h; \
$(INSTALL) -m 644 $(srcdir)/libsosreport-analyzer/common.h $(DESTDIR)$(SOSREPORT_ANALYZERD_INCLUDE_PATH)/common.h; \
$(INSTALL) -m 644 $(srcdir)/libsosreport-analyzer/line_data.h $(DESTDIR)$(SOSREPORT_ANALYZERD_INCLUDE_PATH)/line_data.h; \
install-sosreport_analyzer_include:
@if [ -d $(DESTDIR)$(SOSREPORT_ANALYZER_INCLUDE_PATH) ]; then \
$(INSTALL) -m 644 $(srcdir)/libsosreport-analyzer/cfg.h $(DESTDIR)$(SOSREPORT_ANALYZER_INCLUDE_PATH)/cfg.h; \
$(INSTALL) -m 644 $(srcdir)/libsosreport-analyzer/common.h $(DESTDIR)$(SOSREPORT_ANALYZER_INCLUDE_PATH)/common.h; \
$(INSTALL) -m 644 $(srcdir)/libsosreport-analyzer/line_data.h $(DESTDIR)$(SOSREPORT_ANALYZER_INCLUDE_PATH)/line_data.h; \
else \
$(MKDIR_P) $(DESTDIR)$(SOSREPORT_ANALYZERD_INCLUDE_PATH); \
$(INSTALL) -m 644 $(srcdir)/libsosreport-analyzer/cfg.h $(DESTDIR)$(SOSREPORT_ANALYZERD_INCLUDE_PATH)/cfg.h; \
$(INSTALL) -m 644 $(srcdir)/libsosreport-analyzer/common.h $(DESTDIR)$(SOSREPORT_ANALYZERD_INCLUDE_PATH)/common.h; \
$(INSTALL) -m 644 $(srcdir)/libsosreport-analyzer/line_data.h $(DESTDIR)$(SOSREPORT_ANALYZERD_INCLUDE_PATH)/line_data.h; \
$(MKDIR_P) $(DESTDIR)$(SOSREPORT_ANALYZER_INCLUDE_PATH); \
$(INSTALL) -m 644 $(srcdir)/libsosreport-analyzer/cfg.h $(DESTDIR)$(SOSREPORT_ANALYZER_INCLUDE_PATH)/cfg.h; \
$(INSTALL) -m 644 $(srcdir)/libsosreport-analyzer/common.h $(DESTDIR)$(SOSREPORT_ANALYZER_INCLUDE_PATH)/common.h; \
$(INSTALL) -m 644 $(srcdir)/libsosreport-analyzer/line_data.h $(DESTDIR)$(SOSREPORT_ANALYZER_INCLUDE_PATH)/line_data.h; \
fi

uninstall-sosreport_analyzerd_include:
-rm -rf $(DESTDIR)$(SOSREPORT_ANALYZERD_INCLUDE_PATH)
uninstall-sosreport_analyzer_include:
-rm -rf $(DESTDIR)$(SOSREPORT_ANALYZER_INCLUDE_PATH)

# install libsosreport-analyzerd.so
install-sosreport_analyzerd_lib:
@if [ -f $(DESTDIR)$(SOSREPORT_ANALYZERD_LIB_PATH) ]; then \
$(INSTALL) -m 775 $(srcdir)/libsosreport-analyzer/.libs/libsosreport-analyzer.so $(DESTDIR)$(SOSREPORT_ANALYZERD_LIB_PATH)/libsosreport-analyzerd.so; \
# install libsosreport-analyzer.so
install-sosreport_analyzer_lib:
@if [ -f $(DESTDIR)$(SOSREPORT_ANALYZER_LIB_PATH) ]; then \
$(INSTALL) -m 775 $(srcdir)/libsosreport-analyzer/.libs/libsosreport-analyzer.so $(DESTDIR)$(SOSREPORT_ANALYZER_LIB_PATH)/libsosreport-analyzer.so; \
else \
$(MKDIR_P) $(DESTDIR)$(SOSREPORT_ANALYZERD_LIB_PATH); \
$(INSTALL) -m 775 $(srcdir)/libsosreport-analyzer/.libs/libsosreport-analyzer.so $(DESTDIR)$(SOSREPORT_ANALYZERD_LIB_PATH)/libsosreport-analyzer.so; \
$(MKDIR_P) $(DESTDIR)$(SOSREPORT_ANALYZER_LIB_PATH); \
$(INSTALL) -m 775 $(srcdir)/libsosreport-analyzer/.libs/libsosreport-analyzer.so $(DESTDIR)$(SOSREPORT_ANALYZER_LIB_PATH)/libsosreport-analyzer.so; \
fi

uninstall-sosreport_analyzerd_lib:
-rm -f $(DESTDIR)$(SOSREPORT_ANALYZERD_LIB_PATH)/libsosreport-analyzer.so
uninstall-sosreport_analyzer_lib:
-rm -f $(DESTDIR)$(SOSREPORT_ANALYZER_LIB_PATH)/libsosreport-analyzer.so

# install libsar-analyzerd.so
install-sar_analyzerd_lib:
@if [ -f $(DESTDIR)$(SAR_ANALYZERD_LIB_PATH) ]; then \
$(INSTALL) -m 775 $(srcdir)/libsar-analyzer/.libs/libsar-analyzer.so $(DESTDIR)$(SAR_ANALYZERD_LIB_PATH)/libsar-analyzerd.so; \
# install libsar-analyzer.so
install-sar_analyzer_lib:
@if [ -f $(DESTDIR)$(SAR_ANALYZER_LIB_PATH) ]; then \
$(INSTALL) -m 775 $(srcdir)/libsar-analyzer/.libs/libsar-analyzer.so $(DESTDIR)$(SAR_ANALYZER_LIB_PATH)/libsar-analyzer.so; \
else \
$(MKDIR_P) $(DESTDIR)$(SAR_ANALYZERD_LIB_PATH); \
$(INSTALL) -m 775 $(srcdir)/libsar-analyzer/.libs/libsar-analyzer.so $(DESTDIR)$(SAR_ANALYZERD_LIB_PATH)/libsar-analyzer.so; \
$(MKDIR_P) $(DESTDIR)$(SAR_ANALYZER_LIB_PATH); \
$(INSTALL) -m 775 $(srcdir)/libsar-analyzer/.libs/libsar-analyzer.so $(DESTDIR)$(SAR_ANALYZER_LIB_PATH)/libsar-analyzer.so; \
fi

uninstall-sar_analyzerd_lib:
-rm -f $(DESTDIR)$(SAR_ANALYZERD_LIB_PATH)/libsar-analyzer.so
uninstall-sar_analyzer_lib:
-rm -f $(DESTDIR)$(SAR_ANALYZER_LIB_PATH)/libsar-analyzer.so
68 changes: 34 additions & 34 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ version 2.1 of the License, or (at your option) any later version. See the
configure.ac file for more details.])

# initialize and set version and bugreport address
AC_INIT([sosreport-analyzer], [1.0.12], [[email protected]])
AC_INIT([sosreport-analyzer], [1.0.14], [[email protected]])
RELEASE_MONTH="Jan 2019"
AC_SUBST(RELEASE_MONTH)
AC_CONFIG_MACRO_DIR([m4])
Expand Down Expand Up @@ -117,49 +117,49 @@ AC_CHECK_FUNCS([setusershell getusershell endusershell getgrouplist])
AC_CHECK_DECLS([setusershell, getusershell, endusershell])

# check the name of the configuration file
AC_ARG_WITH(sosreport-analyzerd-conf-file,
AS_HELP_STRING([--with-sosreport-analyzerd-conf-file=PATH],
[path to sosreport-analyzerd configuration file @<:@/etc/sosreport-analyzerd.conf@:>@]),
[ SOSREPORT_ANALYZERD_CONF_PATH="$with_sosreport_analyzerd_conf_file" ],
[ SOSREPORT_ANALYZERD_CONF_PATH="/etc/sosreport-analyzerd.conf" ])
AC_DEFINE_UNQUOTED(SOSREPORT_ANALYZERD_CONF_PATH, "$SOSREPORT_ANALYZERD_CONF_PATH", [Path to sosreport-analyzerd configuration file.])
AC_SUBST(SOSREPORT_ANALYZERD_CONF_PATH)
AC_ARG_WITH(sosreport-analyzer-conf-file,
AS_HELP_STRING([--with-sosreport-analyzer-conf-file=PATH],
[path to sosreport-analyzer configuration file @<:@/etc/sosreport-analyzer.conf@:>@]),
[ SOSREPORT_ANALYZER_CONF_PATH="$with_sosreport_analyzer_conf_file" ],
[ SOSREPORT_ANALYZER_CONF_PATH="/etc/sosreport-analyzer.conf" ])
AC_DEFINE_UNQUOTED(SOSREPORT_ANALYZER_CONF_PATH, "$SOSREPORT_ANALYZER_CONF_PATH", [Path to sosreport-analyzer configuration file.])
AC_SUBST(SOSREPORT_ANALYZER_CONF_PATH)

# check the name of the data file
AC_ARG_WITH(sosreport-analyzerd-data-file,
AS_HELP_STRING([--with-sosreport-analyzerd-data-file=PATH],
[path to sosreport-analyzerd data file @<:@/usr/share/sosreport-analyzerd/sosreport-analyzerd.conf.example@:>@]),
[ SOSREPORT_ANALYZERD_DATA_PATH="$with_sosreport_analyzerd_data_file" ],
[ SOSREPORT_ANALYZERD_DATA_PATH="/usr/share/sosreport-analyzerd" ])
AC_DEFINE_UNQUOTED(SOSREPORT_ANALYZERD_DATA_PATH, "$SOSREPORT_ANALYZERD_DATA_PATH", [Path to sosreport-analyzerd data file.])
AC_SUBST(SOSREPORT_ANALYZERD_DATA_PATH)
AC_ARG_WITH(sosreport-analyzer-data-file,
AS_HELP_STRING([--with-sosreport-analyzer-data-file=PATH],
[path to sosreport-analyzer data file @<:@/usr/share/sosreport-analyzer/sosreport-analyzer.conf.example@:>@]),
[ SOSREPORT_ANALYZER_DATA_PATH="$with_sosreport_analyzer_data_file" ],
[ SOSREPORT_ANALYZER_DATA_PATH="/usr/share/sosreport-analyzer" ])
AC_DEFINE_UNQUOTED(SOSREPORT_ANALYZER_DATA_PATH, "$SOSREPORT_ANALYZER_DATA_PATH", [Path to sosreport-analyzer data file.])
AC_SUBST(SOSREPORT_ANALYZER_DATA_PATH)

# check the name of the include/sosreport-analyzer file
AC_ARG_WITH(sosreport-analyzerd-include-file,
AS_HELP_STRING([--with-sosreport-analyzerd-include-file=PATH],
[path to sosreport-analyzerd include file @<:@/usr/local/include/sosreport-analyzerd/cfg.h@:>@]),
[ SOSREPORT_ANALYZERD_INCLUDE_PATH="$with_sosreport_analyzerd_include_file" ],
[ SOSREPORT_ANALYZERD_INCLUDE_PATH="/usr/local/include/sosreport-analyzerd" ])
AC_DEFINE_UNQUOTED(SOSREPORT_ANALYZERD_INCLUDE_PATH, "$SOSREPORT_ANALYZERD_INCLUDE_PATH", [Path to sosreport-analyzerd include file.])
AC_SUBST(SOSREPORT_ANALYZERD_INCLUDE_PATH)
AS_HELP_STRING([--with-sosreport-analyzer-include-file=PATH],
[path to sosreport-analyzer include file @<:@/usr/local/include/sosreport-analyzer/cfg.h@:>@]),
[ SOSREPORT_ANALYZER_INCLUDE_PATH="$with_sosreport_analyzer_include_file" ],
[ SOSREPORT_ANALYZER_INCLUDE_PATH="/usr/local/include/sosreport-analyzer" ])
AC_DEFINE_UNQUOTED(SOSREPORT_ANALYZER_INCLUDE_PATH, "$SOSREPORT_ANALYZER_INCLUDE_PATH", [Path to sosreport-analyzer include file.])
AC_SUBST(SOSREPORT_ANALYZER_INCLUDE_PATH)

# check the name of the libsosreport-analyzer file
AC_ARG_WITH(sosreport-analyzerd-lib-file,
AS_HELP_STRING([--with-sosreport-analyzerd-lib-file=PATH],
[path to sosreport-analyzerd lib file @<:@/usr/local/lib/libsosreport-analyzer.so@:>@]),
[ SOSREPORT_ANALYZERD_LIB_PATH="$with_sosreport_analyzerd_lib_file" ],
[ SOSREPORT_ANALYZERD_LIB_PATH="/usr/local/lib" ])
AC_DEFINE_UNQUOTED(SOSREPORT_ANALYZERD_LIB_PATH, "$SOSREPORT_ANALYZERD_LIB_PATH", [Path to sosreport-analyzerd lib file.])
AC_SUBST(SOSREPORT_ANALYZERD_LIB_PATH)
AC_ARG_WITH(sosreport-analyzer-lib-file,
AS_HELP_STRING([--with-sosreport-analyzer-lib-file=PATH],
[path to sosreport-analyzer lib file @<:@/usr/local/lib/libsosreport-analyzer.so@:>@]),
[ SOSREPORT_ANALYZER_LIB_PATH="$with_sosreport_analyzer_lib_file" ],
[ SOSREPORT_ANALYZER_LIB_PATH="/usr/local/lib" ])
AC_DEFINE_UNQUOTED(SOSREPORT_ANALYZER_LIB_PATH, "$SOSREPORT_ANALYZER_LIB_PATH", [Path to sosreport-analyzer lib file.])
AC_SUBST(SOSREPORT_ANALYZER_LIB_PATH)

# check the name of the libsar-analyzer file
AC_ARG_WITH(sar-analyzerd-lib-file,
AS_HELP_STRING([--with-sar-analyzerd-lib-file=PATH],
[path to sar-analyzerd lib file @<:@/usr/local/lib/libsar-analyzer.so@:>@]),
[ SAR_ANALYZERD_LIB_PATH="$with_sar_analyzerd_lib_file" ],
[ SAR_ANALYZERD_LIB_PATH="/usr/local/lib" ])
AC_DEFINE_UNQUOTED(SAR_ANALYZERD_LIB_PATH, "$SAR_ANALYZERD_LIB_PATH", [Path to sar-analyzerd lib file.])
AC_SUBST(SAR_ANALYZERD_LIB_PATH)
AS_HELP_STRING([--with-sar-analyzer-lib-file=PATH],
[path to sar-analyzer lib file @<:@/usr/local/lib/libsar-analyzer.so@:>@]),
[ SAR_ANALYZER_LIB_PATH="$with_sar_analyzer_lib_file" ],
[ SAR_ANALYZER_LIB_PATH="/usr/local/lib" ])
AC_DEFINE_UNQUOTED(SAR_ANALYZER_LIB_PATH, "$SAR_ANALYZER_LIB_PATH", [Path to sar-analyzer lib file.])
AC_SUBST(SAR_ANALYZER_LIB_PATH)

AC_PROG_CC
AC_CONFIG_FILES([
Expand Down
5 changes: 3 additions & 2 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
#include "libsar-analyzer/common.h"

/* configuration file of this program/library */
static const char *fname = "/etc/sosreport-analyzerd.conf";
static const char *fname = "/etc/sosreport-analyzer.conf";
static const char *fname_example = "/usr/share/sosreport-analyzer/sosreport-analyzer.conf.example";

const char *app_name = "sosreport-analyzer-ng";

Expand All @@ -41,7 +42,7 @@ static void print_help ( void )
{
printf("\n VERSION %d.%d.%d\n",PROGRAM_VERSION,PROGRAM_RELEASE,PROGRAM_SUB_RELEASE);
printf("\n Before use: Edit %s.\n", fname);
printf("\n If you are unsure, copy from /usr/share/sosreport-analyzerd/sosreport-analyzerd.conf.example to %s.\n", fname);
printf("\n If you are unsure, copy from %s to %s.\n", fname_example, fname);
printf("\n Usage: %s -D <path_to_sosreport_directory> \n\n", app_name);
printf(" Options:\n");
printf(" -D|--directory <path_to_sosreport_directory> analyze files in the directory\n\n");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# This is the configuration file for the sosreport-analyzer.
# If you installed this program before, new version will not override.
# Please check /usr/share/sosreport-analyzer/sosreport-nalayzerd.conf.example, and
# copy it to /etc/sosreport-analyzerd.conf.
# Please check /usr/share/sosreport-analyzer/sosreport-nalayzer.conf.example, and
# copy it to /etc/sosreport-analyzer.conf.
#
#
# 'all' echos every line in the file.
Expand Down

0 comments on commit ee8e1e6

Please sign in to comment.