summaryrefslogtreecommitdiffstats
path: root/package/cpanminus/cpanminus.mk
diff options
context:
space:
mode:
authorFrancois Perrad <fperrad@gmail.com>2012-10-19 03:13:53 +0000
committerPeter Korsgaard <jacmet@sunsite.dk>2012-11-03 17:07:24 +0100
commit51b5cf20bbd07f7ac5855108b17bd08e6a9edf69 (patch)
treee590d69ad77e2649be61c10b3b316a6acc5fd9b3 /package/cpanminus/cpanminus.mk
parent1b5ce0e9a2867851cdb81aaa68b4007d5517250f (diff)
downloadbuildroot-novena-51b5cf20bbd07f7ac5855108b17bd08e6a9edf69.tar.gz
buildroot-novena-51b5cf20bbd07f7ac5855108b17bd08e6a9edf69.zip
cpanminus: new package
Signed-off-by: Francois Perrad <francois.perrad@gadz.org> Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
Diffstat (limited to 'package/cpanminus/cpanminus.mk')
-rw-r--r--package/cpanminus/cpanminus.mk47
1 files changed, 47 insertions, 0 deletions
diff --git a/package/cpanminus/cpanminus.mk b/package/cpanminus/cpanminus.mk
new file mode 100644
index 000000000..d3a338b0b
--- /dev/null
+++ b/package/cpanminus/cpanminus.mk
@@ -0,0 +1,47 @@
+#############################################################
+#
+# cpanminus
+#
+#############################################################
+
+CPANMINUS_VERSION = 1.5018
+CPANMINUS_SOURCE = miyagawa-cpanminus-$(CPANMINUS_VERSION)-0-gee6cd30.tar.gz
+CPANMINUS_SITE = https://github.com/miyagawa/cpanminus/tarball/$(CPANMINUS_VERSION)
+CPANMINUS_DEPENDENCIES = perl $(call qstrip,$(BR2_PACKAGE_CPANMINUS_NATIVE_DEPENDENCIES))
+
+CPANMINUS_RUN_PERL = $(QEMU_USER) $(STAGING_DIR)/usr/bin/perl
+CPANMINUS_ARCHNAME = $(shell $(CPANMINUS_RUN_PERL) -MConfig -e "print Config->{archname}")
+CPANMINUS_PERL_LIB = $(STAGING_DIR)/usr/lib/perl5/$(PERL_VERSION)
+CPANMINUS_PERL_SITELIB = $(TARGET_DIR)/usr/lib/perl5/site_perl/$(PERL_VERSION)
+CPANMINUS_PERL_ARCHLIB = $(CPANMINUS_PERL_LIB)/$(CPANMINUS_ARCHNAME)
+CPANMINUS_PERL_SITEARCH = $(CPANMINUS_PERL_SITELIB)/$(CPANMINUS_ARCHNAME)
+CPANMINUS_PERL5LIB = $(CPANMINUS_PERL_SITEARCH):$(CPANMINUS_PERL_SITELIB):$(CPANMINUS_PERL_ARCHLIB):$(CPANMINUS_PERL_LIB)
+ifneq ($(BR2_PACKAGE_CPANMINUS_MIRROR),"")
+ CPANMINUS_MIRROR = --mirror $(call qstrip,$(BR2_PACKAGE_CPANMINUS_MIRROR)) --mirror-only
+endif
+CPANMINUS_MODULES = $(call qstrip,$(BR2_PACKAGE_CPANMINUS_MODULES))
+
+ifneq ($(CPANMINUS_MODULES),)
+define CPANMINUS_INSTALL_TARGET_CMDS
+ echo "#!/bin/sh" > $(@D)/run_perl
+ echo "PERL5LIB=$(CPANMINUS_PERL5LIB) $(CPANMINUS_RUN_PERL) \"\$$@\"" >>$(@D)/run_perl
+ chmod +x $(@D)/run_perl
+ PERL5LIB=$(CPANMINUS_PERL5LIB) \
+ PERL_MM_OPT="DESTDIR=$(TARGET_DIR) PERL=$(@D)/run_perl PERL_LIB=$(CPANMINUS_PERL_LIB) PERL_ARCHLIB=$(CPANMINUS_PERL_ARCHLIB)" \
+ PERL_MB_OPT="--destdir $(TARGET_DIR)" \
+ RUN_PERL="$(@D)/run_perl" \
+ $(CPANMINUS_RUN_PERL) $(@D)/cpanm \
+ --perl=$(@D)/run_perl \
+ --notest \
+ --no-man-pages \
+ $(CPANMINUS_MIRROR) \
+ $(call qstrip,$(BR2_PACKAGE_CPANMINUS_MODULES))
+ find $(CPANMINUS_PERL_SITEARCH) -type f -name *.bs -exec rm -f {} \;
+endef
+else
+define CPANMINUS_INSTALL_TARGET_CMDS
+ @echo "No modules to install"
+endef
+endif
+
+$(eval $(generic-package))