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.

86 lines
2.3 KiB

  1. #
  2. # Copyright (C) 2015 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-xml-parser
  9. PKG_VERSION:=2.44
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_URL:=http://www.cpan.org/authors/id/T/TO/TODDR/
  12. PKG_SOURCE:=XML-Parser-$(PKG_VERSION).tar.gz
  13. PKG_MD5SUM:=af4813fe3952362451201ced6fbce379
  14. PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
  15. PKG_MAINTAINER:=Marcel Denia <naoir@gmx.net>
  16. PKG_BUILD_DIR:=$(BUILD_DIR)/perl/XML-Parser-$(PKG_VERSION)
  17. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/perl/XML-Parser-$(PKG_VERSION)
  18. HOST_BUILD_DEPENDS:=perl/host expat/host
  19. EXPAT_LIBPATH:=$(STAGING_DIR)/usr/lib
  20. EXPAT_INCPATH=$(STAGING_DIR)/usr/include
  21. HOST_EXPAT_LIBPATH:=$(STAGING_DIR_HOSTPKG)/lib
  22. HOST_EXPAT_INCPATH=$(STAGING_DIR_HOSTPKG)/include
  23. include $(INCLUDE_DIR)/package.mk
  24. include $(INCLUDE_DIR)/host-build.mk
  25. include ../perl/perlmod.mk
  26. define Package/perl-xml-parser
  27. SUBMENU:=Perl
  28. SECTION:=lang
  29. CATEGORY:=Languages
  30. TITLE:=Perl XML Parser
  31. URL:=http://search.cpan.org/dist/XML-Parser/
  32. DEPENDS:=perl +libexpat +perlbase-dynaloader +perlbase-essential
  33. endef
  34. define FixupExpat
  35. # Manually reconfigure XML::Parser::Expat, as some overrides we provide will not have any effect otherwise
  36. # Force usage of OpenWRT's expat
  37. sed \
  38. -e 's!%%EXPAT_LIBPATH%%!$(2)!g' \
  39. -e 's!%%EXPAT_INCPATH%%!$(3)!g' \
  40. -i $(1)/Expat/Makefile.PL
  41. endef
  42. define Build/Configure
  43. $(call perlmod/Configure,EXPATLIBPATH=$(EXPAT_LIBPATH) EXPATINCPATH=$(EXPAT_INCPATH),,)
  44. $(call FixupExpat,$(PKG_BUILD_DIR),$(EXPAT_LIBPATH),$(EXPAT_INCPATH))
  45. $(call perlmod/Configure,,,$(PKG_BUILD_DIR)/Expat)
  46. endef
  47. define Build/Compile
  48. $(call perlmod/Compile,,)
  49. $(call perlmod/Compile,,,$(PKG_BUILD_DIR)/Expat)
  50. endef
  51. define Host/Configure
  52. $(call perlmod/host/Configure,EXPATLIBPATH=$(HOST_EXPAT_LIBPATH) EXPATINCPATH=$(HOST_EXPAT_INCPATH),,)
  53. $(call FixupExpat,$(HOST_BUILD_DIR),$(HOST_EXPAT_LIBPATH),$(HOST_EXPAT_INCPATH))
  54. $(call perlmod/host/Configure,,,$(HOST_BUILD_DIR)/Expat)
  55. endef
  56. define Host/Compile
  57. $(call perlmod/host/Compile,,)
  58. $(call perlmod/host/Compile,,,$(HOST_BUILD_DIR)/Expat)
  59. endef
  60. define Host/Install
  61. $(call perlmod/host/Install,$(1),)
  62. endef
  63. define Package/perl-xml-parser/install
  64. $(call perlmod/Install,$(1),auto/XML XML)
  65. endef
  66. $(eval $(call BuildPackage,perl-xml-parser))
  67. $(eval $(call HostBuild))