From 273d4bd6a79038d2b2fb89409db4d4faead62749 Mon Sep 17 00:00:00 2001 From: Marcel Denia Date: Tue, 9 Jun 2015 21:31:26 +0200 Subject: [PATCH] perl: Have perl's major version number in one central place This will simplify updating the package in the future. Signed-off-by: Marcel Denia --- lang/perl/Makefile | 29 ++++++++++++++++------------- lang/perl/files/perl-run_tests.sh | 2 +- lang/perl/perlmod.mk | 8 +++++--- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/lang/perl/Makefile b/lang/perl/Makefile index 5780a6240..99bc83d57 100644 --- a/lang/perl/Makefile +++ b/lang/perl/Makefile @@ -12,7 +12,7 @@ PKG_VERSION:=5.20.2 PKG_RELEASE:=3 PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \ - http://www.cpan.org/src/5.0/perl-5.20.0.tar.gz \ + http://www.cpan.org/src/5.0 \ ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \ http://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \ ftp://ftp.gmd.de/mirrors/CPAN/src/5.0 \ @@ -157,8 +157,8 @@ define Build/Compile endef define Build/InstallDev - $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20 - $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/5.20 $(1)/usr/lib/perl5/ + $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION) + $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/$(PERL_VERSION) $(1)/usr/lib/perl5/ endef define Package/perl/install @@ -166,8 +166,8 @@ define Package/perl/install $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/perl$(PKG_VERSION) $(1)/usr/bin ln -nsf perl$(PKG_VERSION) $(1)/usr/bin/perl - $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20/CORE - $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/5.20/CORE/libperl.so $(1)/usr/lib/perl5/5.20/CORE/ + $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/CORE + $(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/$(PERL_VERSION)/CORE/libperl.so $(1)/usr/lib/perl5/$(PERL_VERSION)/CORE/ endef @@ -191,9 +191,9 @@ define Package/perl-tests-common/install $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR) $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/Porting $(INSTALL_DIR) $(1)/$(PERL_TESTSDIR)/regen - $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20/XS - $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20/auto/XS - $(INSTALL_DIR) $(1)/usr/lib/perl5/5.20/unicore + $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/XS + $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/auto/XS + $(INSTALL_DIR) $(1)/usr/lib/perl5/$(PERL_VERSION)/unicore $(CP) $(PKG_BUILD_DIR)/t $(1)/$(PERL_TESTSDIR) $(CP) $(PKG_BUILD_DIR)/Porting $(1)/$(PERL_TESTSDIR) @@ -202,12 +202,15 @@ define Package/perl-tests-common/install $(CP) $(PKG_BUILD_DIR)/TestInit.pm $(1)/$(PERL_TESTSDIR) $(CP) $(PKG_BUILD_DIR)/vutil.c $(1)/$(PERL_TESTSDIR) $(CP) $(PKG_BUILD_DIR)/vxs.inc $(1)/$(PERL_TESTSDIR) - $(CP) $(PKG_BUILD_DIR)/lib/XS $(1)/usr/lib/perl5/5.20/ - $(CP) $(PKG_BUILD_DIR)/lib/auto/XS $(1)/usr/lib/perl5/5.20/auto - $(CP) $(PKG_BUILD_DIR)/lib/vmsish.pm $(1)/usr/lib/perl5/5.20/ - $(CP) $(PKG_BUILD_DIR)/lib/unicore/TestProp.pl $(1)/usr/lib/perl5/5.20/unicore + $(CP) $(PKG_BUILD_DIR)/lib/XS $(1)/usr/lib/perl5/$(PERL_VERSION)/ + $(CP) $(PKG_BUILD_DIR)/lib/auto/XS $(1)/usr/lib/perl5/$(PERL_VERSION)/auto + $(CP) $(PKG_BUILD_DIR)/lib/vmsish.pm $(1)/usr/lib/perl5/$(PERL_VERSION)/ + $(CP) $(PKG_BUILD_DIR)/lib/unicore/TestProp.pl $(1)/usr/lib/perl5/$(PERL_VERSION)/unicore $(CP) files/perl-run_tests.sh $(1)/$(PERL_TESTSDIR)/run_tests.sh - sed -e 's!%%PERL_DISABLEDTESTS%%!$(PERL_DISABLEDTESTS)!' -i $(1)/$(PERL_TESTSDIR)/run_tests.sh + sed \ + -e 's!%%PERL_DISABLEDTESTS%%!$(PERL_DISABLEDTESTS)!' \ + -e 's!%%PERL_VERSION%%!$(PERL_VERSION)!' \ + -i $(1)/$(PERL_TESTSDIR)/run_tests.sh $(CP) $(PKG_BUILD_DIR)/config_h.SH $(1)/$(PERL_TESTSDIR) $(CP) $(PKG_BUILD_DIR)/perl.h $(1)/$(PERL_TESTSDIR) endef diff --git a/lang/perl/files/perl-run_tests.sh b/lang/perl/files/perl-run_tests.sh index af6a39c94..288191b43 100755 --- a/lang/perl/files/perl-run_tests.sh +++ b/lang/perl/files/perl-run_tests.sh @@ -1,7 +1,7 @@ #!/bin/sh PERL_TESTSDIR="/usr/share/perl/perl-tests" -PERL_LIBDIR="/usr/lib/perl5/5.20/" +PERL_LIBDIR="/usr/lib/perl5/%%PERL_VERSION%%/" PERL_DISABLEDTESTS="%%PERL_DISABLEDTESTS%%" if [ ! -f "$PERL_TESTSDIR/__prepared" ]; then diff --git a/lang/perl/perlmod.mk b/lang/perl/perlmod.mk index 146a34858..16fc4798d 100644 --- a/lang/perl/perlmod.mk +++ b/lang/perl/perlmod.mk @@ -1,13 +1,15 @@ # This makefile simplifies perl module builds. # +PERL_VERSION:=5.20 + # Build environment HOST_PERL_PREFIX:=$(STAGING_DIR_HOST)/usr ifneq ($(CONFIG_USE_GLIBC),) EXTRA_LIBS:=bsd EXTRA_LIBDIRS:=$(STAGING_DIR)/lib endif -PERL_CMD:=$(STAGING_DIR_HOST)/usr/bin/perl5.20.0 +PERL_CMD:=$(STAGING_DIR_HOST)/usr/bin/perl$(PERL_VERSION).0 MOD_CFLAGS_PERL:=-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 $(TARGET_CFLAGS) $(TARGET_CPPFLAGS) ifdef CONFIG_PERL_THREADS @@ -15,7 +17,7 @@ ifdef CONFIG_PERL_THREADS endif # Module install prefix -PERL_SITELIB:=/usr/lib/perl5/5.20 +PERL_SITELIB:=/usr/lib/perl5/$(PERL_VERSION) PERL_TESTSDIR:=/usr/share/perl/perl-tests PERLBASE_TESTSDIR:=/usr/share/perl/perlbase-tests PERLMOD_TESTSDIR:=/usr/share/perl/perlmod-tests @@ -102,7 +104,7 @@ define perlmod/Configure LINKTYPE=dynamic \ DESTDIR=$(PKG_INSTALL_DIR) \ ); - sed 's!^PERL_INC = .*!PERL_INC = $(STAGING_DIR)/usr/lib/perl5/5.20/CORE/!' -i $(PKG_BUILD_DIR)/Makefile + sed 's!^PERL_INC = .*!PERL_INC = $(STAGING_DIR)/usr/lib/perl5/$(PERL_VERSION)/CORE/!' -i $(PKG_BUILD_DIR)/Makefile endef define perlmod/Compile