1
0
mirror of https://git.openwrt.org/feed/packages.git synced 2024-06-27 11:25:26 +02:00
openwrt-packages/lang/perl/Makefile
Philip Prindeville 4a94479f96 perl: update to 5.26.1
Required changes:

* Add qualifying '.' to scripts or to @INC, as appropriate since we're
  enabling default_inc_excludes_dot;

* Add new platform/library definitions like double-double format and
  locale library functions/headers;

* Delete patch 020 as it's been upstreamed;

Optional changes:

* Instead of using -@rm and having that fail, emit an error message,
  and be ignored, just use @rm -f instead which will always succeed.

Security
[CVE-2017-12837] Heap buffer overflow in regular expression compiler

Compiling certain regular expression patterns with the case-insensitive
modifier could cause a heap buffer overflow and crash perl. This has
now been fixed. [perl #131582]

[CVE-2017-12883] Buffer over-read in regular expression parser

For certain types of syntax error in a regular expression pattern, the
error message could either contain the contents of a random, possibly
large, chunk of memory, or could crash perl. This has now been fixed.
[perl #131598]

[CVE-2017-12814] $ENV{$key} stack buffer overflow on Windows

A possible stack buffer overflow in the %ENV code on Windows has been
fixed by removing the buffer completely since it was superfluous anyway.
[perl #131665]

Signed-off-by: Philip Prindeville <philipp@redfish-solutions.com>
2017-10-24 11:40:34 -06:00

185 lines
6.8 KiB
Makefile

#
# Copyright (C) 2006-2016 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=perl
PKG_VERSION:=5.26.1
PKG_RELEASE:=1
PKG_SOURCE_URL:=\
https://cpan.metacpan.org/src/5.0 \
https://cpan.uib.no/src/5.0 \
https://mirrors.rit.edu/CPAN/src/5.0 \
https://mirror.transip.net/CPAN/src/5.0 \
https://mirrors.sonic.net/cpan/src/5.0 \
https://www.cpan.org/src/5.0
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
PKG_HASH:=fe8208133e73e47afc3251c08d2c21c5a60160165a8ab8b669c43a420e4ec680
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_LICENSE_FILES:=Copying Artistic README
PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>, \
Philip Prindeville <philipp@redfish-solutions.com>
# Build settings
PKG_BUILD_DIR:=$(BUILD_DIR)/perl/$(PKG_NAME)-$(PKG_VERSION)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/perl/$(PKG_NAME)-$(PKG_VERSION)
PKG_INSTALL:=1
PKG_BUILD_DEPENDS:=perl/host
PKG_BUILD_PARALLEL:=1
HOST_BUILD_PARALLEL:=1
# Variables used during configuration/build
HOST_PERL_PREFIX:=$(STAGING_DIR_HOSTPKG)/usr
# Filter -g3, it will break Compress-Raw-Zlib
TARGET_CFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CFLAGS))
TARGET_CPPFLAGS_PERL:=$(patsubst -g3,-g,$(TARGET_CPPFLAGS))
# A list of disabled tests
# ExtUtils tests are disabled for now as we don't support building
# native extensions on the target machine at the moment
PERL_DISABLEDTESTS:=cpan/ExtUtils-Constant cpan/ExtUtils-MakeMaker
# We're on Linux, so don't even package them
PERL_DISABLEDTESTS+=cpan/Win32API-File cpan/Win32 ext/VMS-DCLsym ext/VMS-Filespec ext/VMS-Stdio ext/Win32CORE os2/
# NDBM and ODBM not supported
PERL_DISABLEDTESTS+=ext/NDBM_File ext/ODBM_File
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include perlmod.mk
define Package/perl
SUBMENU:=Perl
SECTION:=lang
CATEGORY:=Languages
TITLE:=The Perl intepreter
URL:=http://www.perl.com/
DEPENDS:=+USE_GLIBC:libbsd +PERL_THREADS:libpthread
endef
define Package/perl/description
Perl is a stable, cross platform programming language.
It is used for mission critical projects in the public and private sectors
and is widely used to program web applications of all needs.
endef
define Package/perl/config
source "$(SOURCE)/Config.in"
endef
# Static host perl
define Host/Configure
( cd $(HOST_BUILD_DIR); ./Configure -der -Uusedl -Duserelocatableinc -Dprefix=$(HOST_PERL_PREFIX) $(if $(CONFIG_PERL_THREADS),-Dusethreads,))
endef
define Host/Install
( cd $(HOST_BUILD_DIR); ./miniperl installperl )
$(INSTALL_DIR) $(HOST_PERL_PREFIX)/bin/
$(CP) $(HOST_BUILD_DIR)/generate_uudmap $(HOST_PERL_PREFIX)/bin/
# Link any possibly installed static extension in
$(MAKE) -C $(HOST_BUILD_DIR)/relink clean || true
( cd $(HOST_BUILD_DIR)/relink && $(HOST_PERL_PREFIX)/bin/perl Makefile.PL )
$(call perlmod/host/relink,$(HOST_BUILD_DIR)/relink)
endef
# Target perl
define Build/Configure
$(PERL_CMD) files/perlconfig.pl -Dowrt:target_cc='$(TARGET_CC)' \
-Dowrt:gccversion=$(CONFIG_GCC_VERSION) \
-Dowrt:target_cross='$(TARGET_CROSS)' \
-Dowrt:cflags='$(TARGET_CFLAGS_PERL) $(TARGET_CPPFLAGS_PERL)' \
-Dowrt:ldflags='$(TARGET_LDFLAGS)' \
-Dowrt:libc=$(subst uClibc,uclibc,$(CONFIG_LIBC)) \
-Dowrt:ipv6=$(if $($(CONFIG_IPV6)),define,undef) \
-Dowrt:threads=$(if $(CONFIG_PERL_THREADS),yes,no) \
-Dowrt:staging_dir='$(STAGING_DIR)' \
-Dowrt:host_perl_prefix='$(HOST_PERL_PREFIX)' \
files/version.config \
files/base.config \
files/$(patsubst i386,i486,$(ARCH)).config \
files/architecture.config \
files/signal.config \
files/threads.config \
files/libc.config \
files/misc.config \
> $(PKG_BUILD_DIR)/config.sh
(cd $(PKG_BUILD_DIR) && ./Configure -S)
install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h
endef
define Build/Compile
+$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
endef
define Build/InstallDev
$(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
$(INSTALL_DIR) $(1)/usr/bin
$(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/$(PERL_VERSION)/CORE
$(CP) $(PKG_INSTALL_DIR)/usr/lib/perl5/$(PERL_VERSION)/CORE/libperl.so $(1)/usr/lib/perl5/$(PERL_VERSION)/CORE/
endef
$(eval $(call RequireCommand,rsync, \
$(PKG_NAME) requires rsync installed on the host-system. \
))
$(eval $(call BuildPackage,perl))
$(eval $(call HostBuild))
-include perlbase.mk
# A helper package that includes all sort of supplementary files for tests
define Package/perl-tests-common
$(call Package/perlbase-template)
TITLE:=Common test support files
DEPENDS:=@PERL_TESTS
endef
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)/$(PERL_TESTSDIR)/lib
$(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)
$(CP) $(PKG_BUILD_DIR)/regen $(1)/$(PERL_TESTSDIR)
$(CP) $(PKG_BUILD_DIR)/MANIFEST $(1)/$(PERL_TESTSDIR)
$(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/$(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/vmsish.t $(1)/$(PERL_TESTSDIR)/lib
$(CP) $(PKG_BUILD_DIR)/lib/Internals.t $(1)/$(PERL_TESTSDIR)/lib
$(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)!' \
-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
$(eval $(call BuildPackage,perl-tests-common))