[omd-commits] OMD Git: omd: perl: make cpan work on wheezy and precise

git version control git at mathias-kettner.de
Thu Jul 5 14:46:48 CEST 2012


Module:   omd
Branch:   master
Commit:   d963d4120b4cacf1e4097e3f21bb93d7d82cf616
URL:      http://omdistro.org/projects/omd/repository/revisions/d963d4120b4cacf1e4097e3f21bb93d7d82cf616

Author:   Sven Nierlein <sven at consol.de>
Date:     Thu Jul  5 11:45:35 2012 +0200
Commiter: Sven Nierlein <sven at consol.de>
Date:     Thu Jul  5 13:58:36 2012 +0200

perl: make cpan work on wheezy and precise

---

 packages/omd/skel/.bashrc              |    1 +
 packages/perl-modules/Makefile         |    5 +++--
 packages/perl-modules/bin/cpan.wrapper |    8 ++++++++
 packages/perl-modules/skel.permissions |    1 +
 4 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/packages/omd/skel/.bashrc b/packages/omd/skel/.bashrc
index 0259189..ab0e03d 100644
--- a/packages/omd/skel/.bashrc
+++ b/packages/omd/skel/.bashrc
@@ -11,6 +11,7 @@ if [ -z $OMD_ROOT ]; then
     . ~/.profile
     cd ~
 fi
+alias cpan='cpan.wrapper'
 
 # pointless unless running interactively
 if [ "$PS1" ]; then
diff --git a/packages/perl-modules/Makefile b/packages/perl-modules/Makefile
index ae00de8..4fd13b9 100644
--- a/packages/perl-modules/Makefile
+++ b/packages/perl-modules/Makefile
@@ -349,13 +349,14 @@ build:
 	    ./build_module.pl -p $(P5TMPDIST)/dest $(MODULES)
 	cd $(P5TMPDIST)/dest/lib/perl5/ && rm -f utils.pm && ln -s ../../../nagios/plugins/utils.pm .
 	mkdir -p $(P5TMPDIST)/dest/lib/perl5/CPAN
-	cp MyConfig.pm $(P5TMPDIST)/dest/lib/perl5/CPAN/MyConfig.pm
+	cp MyConfig.pm $(P5TMPDIST)/dest/lib/perl5/CPAN/MyConfig.skel
 
 install:
 	if [ -z $(DESTDIR) ]; then echo "cannot install without DESTDIR set!"; exit 1; fi
-	mkdir -p $(DESTDIR)$(OMD_ROOT)/lib/perl5
+	mkdir -p $(DESTDIR)$(OMD_ROOT)/lib/perl5 $(DESTDIR)$(OMD_ROOT)/bin
 	rsync -a $(P5TMPDIST)/dest/lib $(DESTDIR)$(OMD_ROOT)/lib/perl5/
 	mkdir -p $(DESTDIR)$(OMD_ROOT)/local/lib/perl5
+	cp bin/cpan.wrapper $(DESTDIR)$(OMD_ROOT)/bin/cpan.wrapper
 
 skel:
 	echo "install  --install_base  ###ROOT###/local/lib/perl5" > $(SKEL)/.modulebuildrc
diff --git a/packages/perl-modules/bin/cpan.wrapper b/packages/perl-modules/bin/cpan.wrapper
new file mode 100644
index 0000000..c08d855
--- /dev/null
+++ b/packages/perl-modules/bin/cpan.wrapper
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+if [ ! -e $OMD_ROOT/.cpan/CPAN/MyConfig.pm ]; then
+  mkdir -p $OMD_ROOT/.cpan/CPAN
+  cp $OMD_ROOT/lib/perl5/lib/perl5/CPAN/MyConfig.skel $OMD_ROOT/.cpan/CPAN/MyConfig.pm
+fi
+
+exec cpan
diff --git a/packages/perl-modules/skel.permissions b/packages/perl-modules/skel.permissions
new file mode 100644
index 0000000..aabdc01
--- /dev/null
+++ b/packages/perl-modules/skel.permissions
@@ -0,0 +1 @@
+bin/cpan.wrapper 0770



More information about the omd-commits mailing list