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.

53 lines
1.3 KiB

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