diff --git a/build/rpm/pcp.spec.in b/build/rpm/pcp.spec.in index d9762c5..8648957 100644 --- a/build/rpm/pcp.spec.in +++ b/build/rpm/pcp.spec.in @@ -194,7 +194,8 @@ into standard PCP archive logs for replay with any PCP monitoring tool. %prep %setup -q autoconf -./configure --libdir=%{_libdir} --libexecdir=%{_libexecdir} && touch config.done +%configure +touch config.done %clean [ ! -z "$DIST_ROOT" ] && rm -rf $DIST_ROOT diff --git a/configure.in b/configure.in index 502c9e6..534df98 100644 --- a/configure.in +++ b/configure.in @@ -40,6 +40,10 @@ AC_ARG_WITH( # MAKE CC CPP LD LEX YACC INSTALL AWK SED ECHO # +dnl configure all paths to an alternate or private root +AC_ARG_VAR(PCP_ALT_ROOT_DIR, [alternate root. Prepend all paths with the argument, default empty string]) +test -n "$PCP_ALT_ROOT_DIR" && pcp_alt_root_dir="$PCP_ALT_ROOT_DIR" + dnl Guess target platfrom AC_CANONICAL_SYSTEM if test -z "$target" @@ -1541,7 +1545,7 @@ else exit 1 fi fi -test -n "$prefix" && pcp_etc_dir=`eval echo $prefix$pcp_etc_dir` +test -n "$pcp_alt_root_dir" && pcp_etc_dir=`eval echo $pcp_alt_root_dir$pcp_etc_dir` AC_SUBST(pcp_etc_dir) dnl shared PCP files (shareable for diskless) @@ -1562,7 +1566,7 @@ then pcp_share_dir=/usr/pcp fi fi -test -n "$prefix" -a -n "$pcp_share_dir" && pcp_share_dir="$prefix$pcp_share_dir" +test -n "$pcp_alt_root_dir" -a -n "$pcp_share_dir" && pcp_share_dir="$pcp_alt_root_dir$pcp_share_dir" AC_SUBST(pcp_share_dir) dnl private PCP executables @@ -1585,13 +1589,7 @@ then else pcp_binadm_dir=`eval echo $pcp_binadm_dir/pcp/bin` fi -dnl -dnl Note on $exec_prefix -dnl autoconf by default sets this to '${prefix}' to allow make(1) -dnl expansion ... we don't want this, hence the eval echo ... here -dnl and in similar places -dnl -test -n "`eval echo $exec_prefix`" && pcp_binadm_dir="`eval echo $exec_prefix$pcp_binadm_dir`" +test -n "`eval echo $pcp_alt_root_dir`" && pcp_binadm_dir="`eval echo $pcp_alt_root_dir$pcp_binadm_dir`" AC_SUBST(pcp_binadm_dir) dnl non-shared (i.e. system local) PCP files @@ -1615,21 +1613,21 @@ then pcp_var_dir=/usr fi fi -test -n "`eval echo $exec_prefix`" && pcp_var_dir="`eval echo $exec_prefix$pcp_var_dir`" +test -n "`eval echo $pcp_alt_root_dir`" && pcp_var_dir="`eval echo $pcp_alt_root_dir$pcp_var_dir`" AC_SUBST(pcp_var_dir) dnl pmcd control and options files if test $target_os = darwin -o $target_distro = debian then - myprefix='' - test -n "$prefix" && myprefix="$prefix" - pcp_pmcdconf_path=$myprefix/etc/pmcd/pmcd.conf - pcp_pmcdrclocal_path=$myprefix/etc/pmcd/rc.local - pcp_pmcdoptions_path=$myprefix/etc/pmcd/pmcd.options - pcp_pmproxyoptions_path=$myprefix/etc/pmproxy/pmproxy.options - pcp_pmiecontrol_path=$myprefix/etc/pmie/control - pcp_pmsnapcontrol_path=$myprefix/etc/pmsnap/control - pcp_pmloggercontrol_path=$myprefix/etc/pmlogger/control + myroot_dir='' + test -n "$pcp_alt_root_dir" && myroot_dir="$pcp_alt_root_dir" + pcp_pmcdconf_path=$myroot_dir/etc/pmcd/pmcd.conf + pcp_pmcdrclocal_path=$myroot_dir/etc/pmcd/rc.local + pcp_pmcdoptions_path=$myroot_dir/etc/pmcd/pmcd.options + pcp_pmproxyoptions_path=$myroot_dir/etc/pmproxy/pmproxy.options + pcp_pmiecontrol_path=$myroot_dir/etc/pmie/control + pcp_pmsnapcontrol_path=$myroot_dir/etc/pmsnap/control + pcp_pmloggercontrol_path=$myroot_dir/etc/pmlogger/control else pcp_pmcdconf_path=$pcp_var_dir/config/pmcd/pmcd.conf pcp_pmcdrclocal_path=$pcp_var_dir/config/pmcd/rc.local @@ -1689,10 +1687,10 @@ fi if test -z "$pcp_lib32_dir" ; then pcp_lib32_dir=$pcp_lib_dir fi -if test -n "`eval echo $exec_prefix`" +if test -n "`eval echo $pcp_alt_root_dir`" then - pcp_lib_dir="`eval echo $exec_prefix$pcp_lib_dir`" - pcp_lib32_dir="`eval echo $exec_prefix$pcp_lib32_dir`" + pcp_lib_dir="`eval echo $pcp_alt_root_dir$pcp_lib_dir`" + pcp_lib32_dir="`eval echo $pcp_alt_root_dir$pcp_lib32_dir`" fi AC_SUBST(pcp_lib_dir) AC_SUBST(pcp_lib32_dir) @@ -1841,7 +1839,7 @@ fi if test x"$man_header" = "x'\\\" t" -o x"$man_header" = "x'\\\" te" ; then need_old_tbl_header=true fi -test -n "$prefix" && pcp_man_dir="$prefix$pcp_man_dir" +test -n "$pcp_alt_root_dir" && pcp_man_dir="$pcp_alt_root_dir$pcp_man_dir" AC_SUBST(pcp_man_dir) AC_SUBST(have_gzipped_manpages) AC_SUBST(have_bzip2ed_manpages) @@ -1864,7 +1862,7 @@ then pcp_bin_dir=/bin fi fi -test -n "`eval echo $exec_prefix`" && pcp_bin_dir="`eval echo $exec_prefix$pcp_bin_dir`" +test -n "`eval echo $pcp_alt_root_dir`" && pcp_bin_dir="`eval echo $pcp_alt_root_dir$pcp_bin_dir`" AC_SUBST(pcp_bin_dir) dnl include files @@ -1879,7 +1877,7 @@ then pcp_inc_dir=/usr/include/pcp fi fi -test -n "$prefix" && pcp_inc_dir="$prefix$pcp_inc_dir" +test -n "$pcp_alt_root_dir" && pcp_inc_dir="$pcp_alt_root_dir$pcp_inc_dir" AC_SUBST(pcp_inc_dir) dnl rc/startup files @@ -1902,14 +1900,14 @@ else pcp_rc_dir=/etc fi fi -test -n "$prefix" && pcp_rc_dir=`eval echo $prefix$pcp_rc_dir` +test -n "$pcp_alt_root_dir" && pcp_rc_dir=`eval echo $pcp_alt_root_dir$pcp_rc_dir` AC_SUBST(pcp_rc_dir) dnl rc sysconfig dir if test -d /etc/sysconfig then pcp_sysconfig_dir=/etc/sysconfig - test -n "$prefix" && pcp_sysconfig_dir=`eval echo $prefix$pcp_sysconfig_dir` + test -n "$pcp_alt_root_dir" && pcp_sysconfig_dir=`eval echo $pcp_alt_root_dir$pcp_sysconfig_dir` else dnl we are _not_ going to use the sysconfig control mechanism to dnl enable/disable pmcd, pmlogger, pmie, ... during the "rc" start @@ -1928,7 +1926,7 @@ then else pcp_log_dir=$pcp_var_dir/pcplog fi -test -n "$prefix" && pcp_log_dir="$prefix$pcp_log_dir" +test -n "$pcp_alt_root_dir" && pcp_log_dir="$pcp_alt_root_dir$pcp_log_dir" AC_SUBST(pcp_log_dir) dnl pid files @@ -1941,7 +1939,7 @@ then else pcp_run_dir=$pcp_var_dir/pcprun fi -test -n "$prefix" && pcp_run_dir=`eval echo $prefix$pcp_run_dir` +test -n "$pcp_alt_root_dir" && pcp_run_dir=`eval echo $pcp_alt_root_dir$pcp_run_dir` AC_SUBST(pcp_run_dir) dnl temp files @@ -1951,7 +1949,7 @@ then else pcp_tmp_dir=/tmp fi -test -n "$prefix" && pcp_tmp_dir="$prefix$pcp_tmp_dir" +test -n "$pcp_alt_root_dir" && pcp_tmp_dir="$pcp_alt_root_dir$pcp_tmp_dir" AC_SUBST(pcp_tmp_dir) dnl doc directory @@ -1970,7 +1968,7 @@ then else pcp_doc_dir=/usr/share/pcp/doc fi -test -n "$prefix" && pcp_doc_dir=`eval echo $prefix$pcp_doc_dir` +test -n "$pcp_alt_root_dir" && pcp_doc_dir=`eval echo $pcp_alt_root_dir$pcp_doc_dir` AC_SUBST(pcp_doc_dir) dnl demos directory @@ -1983,7 +1981,7 @@ then else pcp_demos_dir=/usr/share/pcp/demos fi -test -n "`eval echo $exec_prefix`" && pcp_demos_dir="`eval echo $exec_prefix$pcp_demos_dir`" +test -n "`eval echo $pcp_alt_root_dir`" && pcp_demos_dir="`eval echo $pcp_alt_root_dir$pcp_demos_dir`" AC_SUBST(pcp_demos_dir) if test -z "$XCONFIRM" diff --git a/src/cpan/GNUmakefile b/src/cpan/GNUmakefile index f97ee88..4bc35e2 100644 --- a/src/cpan/GNUmakefile +++ b/src/cpan/GNUmakefile @@ -16,6 +16,7 @@ TOPDIR = ../.. include $(TOPDIR)/src/include/builddefs SUBDIRS = PMDA LogSummary MMV LogImport +LSRCFILES = GNUlocaldefs default: $(SUBDIRS) $(SUBDIRS_MAKERULE) diff --git a/src/cpan/LogImport/GNUmakefile b/src/cpan/LogImport/GNUmakefile index 7c39c38..6e0ec4f 100644 --- a/src/cpan/LogImport/GNUmakefile +++ b/src/cpan/LogImport/GNUmakefile @@ -55,17 +55,12 @@ test dist: LogImport.o $(PERLMAKE) -f Makefile $@ include $(BUILDRULES) +include $(TOPDIR)/src/cpan/GNUlocaldefs -ifeq "$(PREFIX)" "" -INSTALLER_OPTIONS = DESTDIR=$$DIST_ROOT PREFIX=/usr install: default ifneq "$(PACKAGE_DISTRIBUTION)" "debian" $(call PERL_GET_FILELIST,$(TOPDIR)/perl-pcp-logimport.list,LogImport) endif -else -INSTALLER_OPTIONS = DESTDIR=$(PREFIX) PREFIX=/usr -install: default install_perl -endif install_perl: $(PERLMAKE) -f Makefile install $(INSTALLER_OPTIONS) diff --git a/src/cpan/LogSummary/GNUmakefile b/src/cpan/LogSummary/GNUmakefile index 91c4498..4eb51af 100644 --- a/src/cpan/LogSummary/GNUmakefile +++ b/src/cpan/LogSummary/GNUmakefile @@ -46,17 +46,12 @@ test dist: Makefile $(PERLMAKE) -f Makefile $@ include $(BUILDRULES) +include $(TOPDIR)/src/cpan/GNUlocaldefs -ifeq "$(PREFIX)" "" -INSTALLER_OPTIONS = DESTDIR=$$DIST_ROOT PREFIX=/usr install: default ifneq "$(PACKAGE_DISTRIBUTION)" "debian" $(call PERL_GET_FILELIST,$(TOPDIR)/perl-pcp-logsummary.list,LogSummary) endif -else -INSTALLER_OPTIONS = DESTDIR=$(PREFIX) PREFIX=/usr -install: default install_perl -endif install_perl: $(PERLMAKE) -f Makefile install $(INSTALLER_OPTIONS) diff --git a/src/cpan/MMV/GNUmakefile b/src/cpan/MMV/GNUmakefile index 98879db..aef4540 100644 --- a/src/cpan/MMV/GNUmakefile +++ b/src/cpan/MMV/GNUmakefile @@ -50,18 +50,13 @@ test dist: MMV.o $(PERLMAKE) -f Makefile $@ include $(BUILDRULES) +include $(TOPDIR)/src/cpan/GNUlocaldefs -ifeq "$(PREFIX)" "" -INSTALLER_OPTIONS = DESTDIR=$$DIST_ROOT PREFIX=/usr install: default ifneq "$(PACKAGE_DISTRIBUTION)" "debian" $(call PERL_GET_FILELIST,$(TOPDIR)/perl-pcp-mmv.list,MMV) find $$DIST_ROOT -name server.pl -exec chmod 755 '{}' ';' endif -else -INSTALLER_OPTIONS = DESTDIR=$(PREFIX) PREFIX=/usr -install: default install_perl -endif install_perl: $(PERLMAKE) -f Makefile install $(INSTALLER_OPTIONS) diff --git a/src/cpan/PMDA/GNUmakefile b/src/cpan/PMDA/GNUmakefile index 3903a26..fb02d30 100644 --- a/src/cpan/PMDA/GNUmakefile +++ b/src/cpan/PMDA/GNUmakefile @@ -51,17 +51,12 @@ test dist: PMDA.o $(PERLMAKE) -f Makefile $@ include $(BUILDRULES) +include $(TOPDIR)/src/cpan/GNUlocaldefs -ifeq "$(PREFIX)" "" -INSTALLER_OPTIONS = DESTDIR=$$DIST_ROOT PREFIX=/usr install: default ifneq "$(PACKAGE_DISTRIBUTION)" "debian" $(call PERL_GET_FILELIST,$(TOPDIR)/perl-pcp-pmda.list,PMDA) endif -else -INSTALLER_OPTIONS = DESTDIR=$(PREFIX) PREFIX=/usr -install: default install_perl -endif install_perl: $(PERLMAKE) -f Makefile install $(INSTALLER_OPTIONS)