apache.mk 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. ################################################################################
  2. #
  3. # apache
  4. #
  5. ################################################################################
  6. APACHE_VERSION = 2.4.65
  7. APACHE_SOURCE = httpd-$(APACHE_VERSION).tar.bz2
  8. APACHE_SITE = https://archive.apache.org/dist/httpd
  9. APACHE_LICENSE = Apache-2.0
  10. APACHE_LICENSE_FILES = LICENSE
  11. APACHE_CPE_ID_VENDOR = apache
  12. APACHE_CPE_ID_PRODUCT = http_server
  13. APACHE_SELINUX_MODULES = apache
  14. # Needed for mod_php
  15. APACHE_INSTALL_STAGING = YES
  16. # We have a patch touching configure.in and Makefile.in,
  17. # so we need to autoreconf:
  18. APACHE_AUTORECONF = YES
  19. APACHE_DEPENDENCIES = host-pkgconf apr apr-util pcre2
  20. APACHE_CONF_ENV= \
  21. ap_cv_void_ptr_lt_long=no \
  22. PCRE_CONFIG=$(STAGING_DIR)/usr/bin/pcre2-config
  23. ifeq ($(BR2_PACKAGE_APACHE_MPM_EVENT),y)
  24. APACHE_MPM = event
  25. else ifeq ($(BR2_PACKAGE_APACHE_MPM_PREFORK),y)
  26. APACHE_MPM = prefork
  27. else ifeq ($(BR2_PACKAGE_APACHE_MPM_WORKER),y)
  28. APACHE_MPM = worker
  29. endif
  30. APACHE_CONF_OPTS = \
  31. --sysconfdir=/etc/apache2 \
  32. --with-apr=$(STAGING_DIR)/usr \
  33. --with-apr-util=$(STAGING_DIR)/usr \
  34. --with-pcre=$(STAGING_DIR)/usr/bin/pcre2-config \
  35. --enable-http \
  36. --enable-dbd \
  37. --enable-proxy \
  38. --enable-mime-magic \
  39. --without-suexec-bin \
  40. --enable-mods-shared=all \
  41. --with-mpm=$(APACHE_MPM) \
  42. --disable-luajit
  43. ifeq ($(BR2_PACKAGE_BROTLI),y)
  44. APACHE_CONF_OPTS += --enable-brotli
  45. APACHE_DEPENDENCIES += brotli
  46. else
  47. APACHE_CONF_OPTS += --disable-brotli
  48. endif
  49. ifeq ($(BR2_PACKAGE_LIBXML2),y)
  50. APACHE_DEPENDENCIES += libxml2
  51. # Apache wants the path to the header file, where it can find
  52. # <libxml/parser.h>.
  53. APACHE_CONF_OPTS += \
  54. --enable-xml2enc \
  55. --enable-proxy-html \
  56. --with-libxml2=$(STAGING_DIR)/usr/include/libxml2
  57. else
  58. APACHE_CONF_OPTS += \
  59. --disable-xml2enc \
  60. --disable-proxy-html
  61. endif
  62. ifeq ($(BR2_PACKAGE_LUA),y)
  63. APACHE_CONF_OPTS += --enable-lua
  64. APACHE_DEPENDENCIES += lua
  65. else
  66. APACHE_CONF_OPTS += --disable-lua
  67. endif
  68. ifeq ($(BR2_PACKAGE_NGHTTP2),y)
  69. APACHE_CONF_OPTS += \
  70. --enable-http2 \
  71. --with-nghttp2=$(STAGING_DIR)/usr
  72. APACHE_DEPENDENCIES += nghttp2
  73. else
  74. APACHE_CONF_OPTS += --disable-http2
  75. endif
  76. ifeq ($(BR2_PACKAGE_OPENSSL),y)
  77. APACHE_DEPENDENCIES += openssl
  78. APACHE_CONF_OPTS += \
  79. --enable-ssl \
  80. --with-ssl=$(STAGING_DIR)/usr
  81. else
  82. APACHE_CONF_OPTS += --disable-ssl
  83. endif
  84. ifeq ($(BR2_PACKAGE_ZLIB),y)
  85. APACHE_DEPENDENCIES += zlib
  86. APACHE_CONF_OPTS += \
  87. --enable-deflate \
  88. --with-z=$(STAGING_DIR)/usr
  89. else
  90. APACHE_CONF_OPTS += --disable-deflate
  91. endif
  92. define APACHE_FIX_STAGING_APACHE_CONFIG
  93. $(SED) 's%"/usr/bin"%"$(STAGING_DIR)/usr/bin"%' $(STAGING_DIR)/usr/bin/apxs
  94. $(SED) 's%/usr/build%$(STAGING_DIR)/usr/build%' $(STAGING_DIR)/usr/bin/apxs
  95. $(SED) 's%^prefix =.*%prefix = $(STAGING_DIR)/usr%' $(STAGING_DIR)/usr/build/config_vars.mk
  96. endef
  97. APACHE_POST_INSTALL_STAGING_HOOKS += APACHE_FIX_STAGING_APACHE_CONFIG
  98. define APACHE_CLEANUP_TARGET
  99. $(RM) -rf $(TARGET_DIR)/usr/manual $(TARGET_DIR)/usr/build
  100. endef
  101. APACHE_POST_INSTALL_TARGET_HOOKS += APACHE_CLEANUP_TARGET
  102. define APACHE_INSTALL_INIT_SYSV
  103. $(INSTALL) -D -m 0755 package/apache/S50apache \
  104. $(TARGET_DIR)/etc/init.d/S50apache
  105. endef
  106. define APACHE_INSTALL_INIT_SYSTEMD
  107. $(INSTALL) -D -m 644 package/apache/apache.service \
  108. $(TARGET_DIR)/usr/lib/systemd/system/apache.service
  109. endef
  110. $(eval $(autotools-package))