From f05d11a794291157f39778907c698c9008cd7edf Mon Sep 17 00:00:00 2001 From: Tobi Oetiker Date: Wed, 28 Sep 2011 22:34:38 +0000 Subject: * silent build * add perl and library path to the scripts on install --- bin/Makefile.am | 5 +++++ bin/smokeinfo | 7 +++++-- bin/smokeping | 3 ++- bin/smokeping_cgi | 1 + bin/tSmoke | 3 ++- configure.ac | 27 ++++++++++----------------- doc/Makefile.am | 47 ++++++++++++++++++++++++++--------------------- 7 files changed, 51 insertions(+), 42 deletions(-) diff --git a/bin/Makefile.am b/bin/Makefile.am index 81a47df..01030c8 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -16,3 +16,8 @@ dist_bin_SCRIPTS = smokeinfo smokeping smokeping_cgi tSmoke + +install-exec-hook: + [ x$PERL5LIB != x ] && cd "$(bindir)" && $(PERL) -i -p -e 's{^#!.*}{#!$(PERL)}; s{.*# PERL5LIB}{use lib qw($(PERL5LIB)); # PERL5LIB}' smokeinfo smokeping smokeping_cgi tSmoke + +# EOF diff --git a/bin/smokeinfo b/bin/smokeinfo index 48439c8..caf77d2 100755 --- a/bin/smokeinfo +++ b/bin/smokeinfo @@ -1,9 +1,12 @@ -#!/usr/bin/perl -w +#!/usr/bin/env perl use strict; +use warnings; -use lib qw(/usr/pack/rrdtool-1.3.2-to/lib/perl); use FindBin; +# PERL5LIB +use lib "$FindBin::Bin/../thirdparty/lib/perl5"; use lib "$FindBin::Bin/../lib"; + use Smokeping::Info; use Getopt::Long 2.25 qw(:config no_ignore_case); use Pod::Usage 1.14; diff --git a/bin/smokeping b/bin/smokeping index 29be044..f6b95b8 100755 --- a/bin/smokeping +++ b/bin/smokeping @@ -5,10 +5,11 @@ use strict; use warnings; use FindBin; +# PERL5LIB use lib "$FindBin::Bin/../thirdparty/lib/perl5"; use lib "$FindBin::Bin/../lib"; -use Smokeping 2.005000; +use Smokeping; Smokeping::main("$FindBin::Bin/../etc/config"); diff --git a/bin/smokeping_cgi b/bin/smokeping_cgi index f7e2744..bedc6ff 100755 --- a/bin/smokeping_cgi +++ b/bin/smokeping_cgi @@ -5,6 +5,7 @@ use strict; use warnings; use FindBin; +# PERL5LIB use lib "$FindBin::Bin/../thirdparty/lib/perl5"; use lib "$FindBin::Bin/../lib"; diff --git a/bin/tSmoke b/bin/tSmoke index fc0d74f..d7d98bd 100755 --- a/bin/tSmoke +++ b/bin/tSmoke @@ -52,10 +52,11 @@ use warnings; # # Point the lib variables to your implementation use FindBin; +# PERL5LIB use lib "$FindBin::Bin/../thirdparty/lib/perl5"; use lib "$FindBin::Bin/../lib"; -use Smokeping 2.004002; +use Smokeping; use Net::SMTP; use Getopt::Long; use Pod::Usage; diff --git a/configure.ac b/configure.ac index 0807b97..ac11427 100644 --- a/configure.ac +++ b/configure.ac @@ -20,9 +20,11 @@ AC_INIT([smokeping],[2.5.2],[tobi@oetiker.ch]) AC_PREREQ([2.59]) AC_CONFIG_AUX_DIR(conftools) -AC_CANONICAL_HOST +AC_CANONICAL_TARGET +m4_version_prereq(2.60, [AC_USE_SYSTEM_EXTENSIONS], [#]) AM_INIT_AUTOMAKE(1.9) AM_MAINTAINER_MODE +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) AC_PREFIX_DEFAULT( /opt/smokeping-$PACKAGE_VERSION ) @@ -36,6 +38,7 @@ AC_PATH_PROG(RM, rm, no) AC_PATH_PROG(RMDIR, rmdir, no) AC_PATH_PROG(MKDIR, mkdir, no) AC_PATH_PROG(FIND, find, no) +AC_PATH_PROGS(NROFF, [gnroff nroff]) AC_ARG_ENABLE(pkgonly, @@ -46,32 +49,22 @@ AC_SUBST(enable_pkgonly) HTDOCSDIR=${prefix}/htdocs AC_ARG_WITH(htdocs-dir,[ --with-htdocs-dir=[DIR] Where to install htdocs [PREFIX/htdocs]], [HTDOCSDIR=$withval]) AC_SUBST(HTDOCSDIR) - -PERLLIBDIRS= - -PERLOPTS= -AC_ARG_WITH(perl-inc,[ --with-perl-inc=[DIRS] Additional space-separated Perl library paths], [PERLINC=$withval]) -AC_ARG_VAR(PERLINC, [[] Additional space-separated Perl library paths]) -if test ! -z "$PERLINC"; then - for d in $PERLINC; do - PERLOPTS="${PERLOPTS} -I${d}" - perllibdirs=${perllibdirs}"\,\'"${d}"\'" - done -fi -AC_SUBST(PERLOPTS) -AC_SUBST(PERLLIBDIRS, [${perllibdirs}]) +#AC_ARG_WITH(perl5lib, [ --with-perl5lib=[A:B:C] Colon separated list of perl library directories], [PERL5LIB=$withval]) + +AC_ARG_VAR(PERL5LIB, [[] Colon separated list of perl library directories]) +AC_SUBST(PERL5LIB) # Check the necessary Perl modules if test "$enable_pkgonly" != yes; then for module in RRDs FCGI CGI CGI::Fast Config::Grammar Digest::HMAC_MD5; do AC_MSG_CHECKING([presence of $module]) - if ${PERL} ${PERLOPTS} -e 'use '$module; then + if ${PERL} -e 'use '$module; then AC_MSG_RESULT([Ok]) else - AC_MSG_ERROR([Perl cannot find $module ($PERLOPTS)]); + AC_MSG_ERROR([Perl cannot find $module ($PERL5LIB)]); fi done fi diff --git a/doc/Makefile.am b/doc/Makefile.am index 38a9543..dd6b065 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -26,7 +26,7 @@ DOCSCONFIG = smokeping_config.pod smokeping_examples.pod #PM := ../lib/Smokeping.pm ../lib/Smokeping/Examples.pm ../lib/Smokeping/RRDtools.pm -EXTRA_DIST = $(DOCS) +EXTRA_DIST = $(DOCS) smokeping_install.txt PODPROBE := $(wildcard ../lib/Smokeping/probes/*.pm) PODMATCH := $(wildcard ../lib/Smokeping/matchers/*.pm) @@ -40,7 +40,7 @@ MODBASE = $(subst .pm,,$(subst ../lib/Smokeping/probes/,Smokeping_probes_,$(PODP PROGBASE = smokeping smokeping_cgi tSmoke -DOCSCONFIGBASE = smokeping_config +DOCSCONFIGBASE = smokeping_config smokeping_examples MAN3 = $(addsuffix .3,$(MODBASE)) MAN5 = $(addsuffix .5,$(DOCSCONFIGBASE)) @@ -50,53 +50,57 @@ MAN1 = $(addsuffix .1,$(PROGBASE)) POD2MAN = pod2man --release=$(VERSION) --center=SmokePing $< # we go to this trouble to ensure that MAKEPOD only uses modules in the installation directory -MAKEPOD= $(PERL) $(PERLOPTS) -I../lib -mSmokeping -e 'Smokeping::main()' -- --makepod -GENEX= $(PERL) $(PERLOPTS) -I../lib -mSmokeping -e 'Smokeping::main()' -- --gen-examples +MAKEPOD= PERL5LIB=$(PERL5LIB) $(PERL) -I../lib -mSmokeping -e 'Smokeping::main()' -- --makepod +GENEX= PERL5LIB=$(PERL5LIB) $(PERL) -I../lib -mSmokeping -e 'Smokeping::main()' -- --gen-examples %.7: %.pod - $(POD2MAN) --section 7 > $@ + $(AM_V_GEN)$(POD2MAN) --section 7 > $@ + %.5: %.pod - $(POD2MAN) --section 5 > $@ + $(AM_V_GEN)$(POD2MAN) --section 5 > $@ Smokeping.3: ../lib/Smokeping.pm - $(POD2MAN) --section 3 > $@ + $(AM_V_GEN)$(POD2MAN) --section 3 > $@ Smokeping_Examples.3: ../lib/Smokeping/Examples.pm - $(POD2MAN) --section 3 > $@ + $(AM_V_GEN)$(POD2MAN) --section 3 > $@ Smokeping_RRDtools.3: ../lib/Smokeping/RRDtools.pm - $(POD2MAN) --section 3 > $@ + $(AM_V_GEN)$(POD2MAN) --section 3 > $@ Smokeping_probes_%.pod: ../lib/Smokeping/probes/%.pm - $(MAKEPOD) Smokeping::probes::$* > $@ + $(AM_V_GEN)$(MAKEPOD) Smokeping::probes::$* > $@ Smokeping_probes_%.3: Smokeping_probes_%.pod - $(POD2MAN) --section 3 > $@ + $(AM_V_GEN)$(POD2MAN) --section 3 > $@ Smokeping_matchers_%.3: ../lib/Smokeping/matchers/%.pm - $(POD2MAN) --section 3 > $@ + $(AM_V_GEN)$(POD2MAN) --section 3 > $@ Smokeping_sorters_%.3: ../lib/Smokeping/sorters/%.pm - $(POD2MAN) --section 3 > $@ + $(AM_V_GEN)$(POD2MAN) --section 3 > $@ smokeping.1: ../bin/smokeping - $(POD2MAN) --section 1 > $@ + $(AM_V_GEN)$(POD2MAN) --section 1 > $@ smokeping_cgi.1: ../bin/smokeping_cgi - $(POD2MAN) --section 1 > $@ + $(AM_V_GEN)$(POD2MAN) --section 1 > $@ tSmoke.1: ../bin/tSmoke - $(POD2MAN) --section 1 > $@ + $(AM_V_GEN)$(POD2MAN) --section 1 > $@ smokeping_config.pod: ../lib/Smokeping.pm - $(MAKEPOD) > $@ + $(AM_V_GEN)$(MAKEPOD) > $@ smokeping_examples.pod: ../lib/Smokeping/Examples.pm ../etc/config.dist - $(MKDIR) -p examples - $(GENEX) + $(AM_V_GEN)$(MKDIR) -p examples + $(AM_V_GEN)$(GENEX) + +.1.txt .3.txt .5.txt .7.txt: + $(AM_V_GEN)GROFF_NO_SGR=1 @NROFF@ -man -Tlp $< > $@ -clean-local: - -$(RM) -r *.[1357] smokeping_examples.pod smokeping_config.pod examples + +CLEANFILES = *.[1357] smokeping_examples.pod smokeping_config.pod examples/* iman1dir = $(DESTDIR)$(mandir)/man1 iman1_DATA = $(MAN1) @@ -114,3 +118,4 @@ EXAMPLES := $(wildcard examples/config.*) etcdir = $(DESTDIR)$(sysconfdir)/examples etc_DATA = $(EXAMPLES) + -- cgit v1.2.3-24-g4f1b