You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

112 lines
3.3 KiB

  1. #
  2. # Copyright (C) 2006-2014 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=perl
  9. PKG_VERSION:=5.20.0
  10. PKG_RELEASE:=2
  11. PKG_MD5SUM:=406ec049ebe3afcc80d9c76ec78ca4f8
  12. PKG_SOURCE_URL:=ftp://ftp.cpan.org/pub/CPAN/src/5.0 \
  13. http://www.cpan.org/src/5.0/perl-5.20.0.tar.gz \
  14. ftp://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \
  15. http://ftp.mpi-sb.mpg.de/pub/perl/CPAN/src/5.0 \
  16. ftp://ftp.gmd.de/mirrors/CPAN/src/5.0 \
  17. http://ftp5.gwdg.de/pub/languages/perl/CPAN/src/ \
  18. ftp://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0 \
  19. http://ftp.funet.fi/pub/languages/perl/CPAN/src/5.0
  20. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  21. PKG_LICENSE:=GPLv1 ARTISTIC
  22. PKG_LICENSE_FILES:=Copying Artistic README
  23. PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
  24. # Build settings
  25. PKG_BUILD_DIR:=$(BUILD_DIR)/perl/$(PKG_NAME)-$(PKG_VERSION)
  26. PKG_INSTALL:=1
  27. PKG_BUILD_DEPENDS:=perl/host
  28. PKG_BUILD_PARALLEL:=1
  29. HOST_BUILD_PARALLEL:=1
  30. # Variables used during configuration/build
  31. HOST_PERL_PREFIX:=$(STAGING_DIR_HOST)/usr
  32. ifneq ($(CONFIG_USE_EGLIBC),)
  33. EXTRA_LIBS:=bsd
  34. EXTRA_LIBDIRS:=$(STAGING_DIR)/lib
  35. endif
  36. include $(INCLUDE_DIR)/package.mk
  37. include $(INCLUDE_DIR)/host-build.mk
  38. define Package/perl
  39. SUBMENU:=Perl
  40. SECTION:=lang
  41. CATEGORY:=Languages
  42. TITLE:=The Perl intepreter
  43. URL:=http://www.perl.com/
  44. DEPENDS:=+USE_EGLIBC:libbsd
  45. endef
  46. define Package/perl/description
  47. Perl is a stable, cross platform programming language.
  48. It is used for mission critical projects in the public and private sectors
  49. and is widely used to program web applications of all needs.
  50. endef
  51. # Static host perl
  52. define Host/Configure
  53. ( cd $(HOST_BUILD_DIR); ./Configure -der -Uusedl -Duserelocatableinc -Dprefix=$(HOST_PERL_PREFIX) )
  54. endef
  55. define Host/Install
  56. ( cd $(HOST_BUILD_DIR); ./miniperl installperl )
  57. $(CP) $(HOST_BUILD_DIR)/generate_uudmap $(HOST_PERL_PREFIX)/bin/
  58. endef
  59. # Target perl
  60. define Build/Configure
  61. sed \
  62. -e 's!%%CC%%!$(TARGET_CC)!g' \
  63. -e 's!%%CFLAGS%%!$(TARGET_CFLAGS) $(TARGET_CPPFLAGS)!g' \
  64. -e 's!%%CPP%%!$(TARGET_CROSS)gcc -E!g' \
  65. -e 's!%%AR%%!$(TARGET_CROSS)ar!g' \
  66. -e 's!%%LD%%!$(TARGET_CROSS)gcc!g' \
  67. -e 's!%%LDFLAGS%%!-rdynamic $(TARGET_LDFLAGS)!g' \
  68. -e 's!%%LIBDIRS%%!$(STAGING_DIR)/lib $(STAGING_DIR)/usr/lib!g' \
  69. -e 's!%%INCDIRS%%!$(STAGING_DIR)/include $(STAGING_DIR)/usr/include!g' \
  70. -e 's!%%EXTRA_PERLLIBS%%!$(EXTRA_LIBS:%=-l%)!g' \
  71. -e 's!%%EXTRA_PERLLIBDIRS%%!$(EXTRA_LIBDIRS:%=-L%)!g' \
  72. -e 's!%%IPV6%%!$(if $($(CONFIG_IPV6)),define,undef)!g' \
  73. -e 's!%%HOSTMINIPERL%%!$(HOST_PERL_PREFIX)/bin/perl!g' \
  74. -e 's!%%HOSTGENERATE%%!$(HOST_PERL_PREFIX)/bin/generate_uudmap!g' \
  75. files/config.sh-$(patsubst i386,i486,$(ARCH)).in \
  76. > $(PKG_BUILD_DIR)/config.sh
  77. (cd $(PKG_BUILD_DIR) && ./Configure -S)
  78. install -m 0644 $(PKG_BUILD_DIR)/config.h $(PKG_BUILD_DIR)/xconfig.h
  79. endef
  80. define Build/Compile
  81. +$(MAKE) $(PKG_JOBS) -C $(PKG_BUILD_DIR)
  82. endef
  83. define Package/perl/install
  84. $(INSTALL_DIR) $(1)/usr/bin
  85. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/perl$(PKG_VERSION) $(1)/usr/bin
  86. ln -nsf perl$(PKG_VERSION) $(1)/usr/bin/perl
  87. endef
  88. $(eval $(call RequireCommand,rsync, \
  89. $(PKG_NAME) requires rsync installed on the host-system. \
  90. ))
  91. $(eval $(call BuildPackage,perl))
  92. $(eval $(call HostBuild))
  93. include perlmod.mk
  94. -include perlbase.mk