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.

50 lines
1.2 KiB

  1. # This makefile simplifies perl module builds.
  2. #
  3. # Build environment
  4. HOST_PERL_PREFIX:=$(STAGING_DIR_HOST)/usr
  5. PERL_CMD:=$(STAGING_DIR_HOST)/usr/bin/perl5.20.0
  6. # Module install prefix
  7. PERL_SITELIB:=/usr/lib/perl5/5.20
  8. define perlmod/Configure
  9. (cd $(PKG_BUILD_DIR); \
  10. PERL_MM_USE_DEFAULT=1 \
  11. $(2) \
  12. $(PERL_CMD) Makefile.PL \
  13. $(1) \
  14. INSTALLSITELIB=$(PERL_SITELIB) \
  15. INSTALLSITEARCH=$(PERL_SITELIB) \
  16. DESTDIR=$(PKG_INSTALL_DIR) \
  17. );
  18. endef
  19. define perlmod/Compile
  20. PERL5LIB=$(PERL_LIB) \
  21. $(2) \
  22. $(MAKE) -C $(PKG_BUILD_DIR) \
  23. $(1) \
  24. install
  25. endef
  26. define perlmod/Install
  27. $(INSTALL_DIR) $(strip $(1))$(PERL_SITELIB)
  28. (cd $(PKG_INSTALL_DIR)$(PERL_SITELIB) && \
  29. rsync --relative -rlHp --itemize-changes \
  30. --exclude=\*.pod \
  31. --exclude=.packlist \
  32. $(addprefix --exclude=/,$(strip $(3))) \
  33. --prune-empty-dirs \
  34. $(strip $(2)) $(strip $(1))$(PERL_SITELIB))
  35. chmod -R u+w $(strip $(1))$(PERL_SITELIB)
  36. @echo "---> Stripping modules in: $(strip $(1))$(PERL_SITELIB)"
  37. find $(strip $(1))$(PERL_SITELIB) -name \*.pm -or -name \*.pl | \
  38. xargs -r sed -i \
  39. -e '/^=\(head\|pod\|item\|over\|back\)/,/^=cut/d' \
  40. -e '/^=\(head\|pod\|item\|over\|back\)/,$$$$d' \
  41. -e '/^#$$$$/d' \
  42. -e '/^#[^!"'"'"']/d'
  43. endef