php.port.mk 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. # $OpenBSD: php.port.mk,v 1.16 2017/04/25 11:26:43 sthen Exp $
  2. CATEGORIES+= lang/php
  3. MODPHP_VERSION?= 5.6
  4. .if ${MODPHP_VERSION} == 5.5
  5. MODPHP_VSPEC = >=${MODPHP_VERSION},<5.6
  6. .elif ${MODPHP_VERSION} == 5.6
  7. MODPHP_VSPEC = >=${MODPHP_VERSION},<5.7
  8. .elif ${MODPHP_VERSION} == 7.0
  9. MODPHP_VSPEC = >=${MODPHP_VERSION},<7.1
  10. .endif
  11. MODPHPSPEC = php-${MODPHP_VSPEC}
  12. MODPHP_RUN_DEPENDS= ${MODPHPSPEC}:lang/php/${MODPHP_VERSION}
  13. MODPHP_LIB_DEPENDS= ${MODPHPSPEC}:lang/php/${MODPHP_VERSION}
  14. MODPHP_WANTLIB = php${MODPHP_VERSION}
  15. _MODPHP_BUILD_DEPENDS= ${MODPHPSPEC}:lang/php/${MODPHP_VERSION}
  16. MODPHP_BUILDDEP?= Yes
  17. MODPHP_RUNDEP?= Yes
  18. .if ${NO_BUILD:L} == "no" && ${MODPHP_BUILDDEP:L} == "yes"
  19. BUILD_DEPENDS+= ${_MODPHP_BUILD_DEPENDS}
  20. .endif
  21. .if ${MODPHP_RUNDEP:L} == "yes"
  22. RUN_DEPENDS+= ${MODPHP_RUN_DEPENDS}
  23. .endif
  24. MODPHP_BIN= ${LOCALBASE}/bin/php-${MODPHP_VERSION}
  25. MODPHP_PHPIZE= ${LOCALBASE}/bin/phpize-${MODPHP_VERSION}
  26. MODPHP_PHP_CONFIG= ${LOCALBASE}/bin/php-config-${MODPHP_VERSION}
  27. MODPHP_INCDIR= ${LOCALBASE}/include/php-${MODPHP_VERSION}
  28. MODPHP_LIBDIR= ${LOCALBASE}/lib/php-${MODPHP_VERSION}
  29. MODPHP_CONFIGURE_ARGS= --with-php-config=${LOCALBASE}/bin/php-config-${MODPHP_VERSION}
  30. SUBST_VARS+= MODPHP_VERSION
  31. MODPHP_DO_PHPIZE?=
  32. .if !empty(MODPHP_DO_PHPIZE)
  33. AUTOCONF_VERSION= 2.62
  34. AUTOMAKE_VERSION= 1.9
  35. BUILD_DEPENDS+= ${MODGNU_AUTOCONF_DEPENDS} \
  36. ${MODGNU_AUTOMAKE_DEPENDS}
  37. .if empty(CONFIGURE_STYLE)
  38. CONFIGURE_STYLE= gnu
  39. .endif
  40. CONFIGURE_ENV+= AUTOMAKE_VERSION=${AUTOMAKE_VERSION} \
  41. AUTOCONF_VERSION=${AUTOCONF_VERSION}
  42. CONFIGURE_ARGS+= ${MODPHP_CONFIGURE_ARGS}
  43. pre-configure:
  44. cd ${WRKSRC} && ${SETENV} ${CONFIGURE_ENV} ${MODPHP_PHPIZE}
  45. .endif
  46. MODPHP_DO_SAMPLE?=
  47. .if !empty(MODPHP_DO_SAMPLE)
  48. PV= ${MODPHP_VERSION}
  49. MODULE_NAME= ${MODPHP_DO_SAMPLE}
  50. SUBST_VARS+= PV MODULE_NAME
  51. post-install:
  52. ${INSTALL_DATA_DIR} ${PREFIX}/share/examples/php-${MODPHP_VERSION}
  53. @echo "extension=${MODPHP_DO_SAMPLE}.so" > \
  54. ${PREFIX}/share/examples/php-${MODPHP_VERSION}/${MODPHP_DO_SAMPLE}.ini
  55. .endif