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.

192 lines
5.7 KiB

  1. #
  2. # Copyright (C) 2007-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:=apache
  9. PKG_VERSION:=2.4.37
  10. PKG_RELEASE:=2
  11. PKG_SOURCE_NAME:=httpd
  12. PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:=@APACHE/httpd/
  14. PKG_HASH:=3498dc5c6772fac2eb7307dc7963122ffe243b5e806e0be4fb51974ff759d726
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
  16. PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
  17. PKG_LICENSE:=Apache License
  18. PKG_CPE_ID:=cpe:/a:apache:http_server
  19. PKG_INSTALL:=1
  20. PKG_CONFIG_DEPENDS:= \
  21. CONFIG_APACHE_HTTP2
  22. ADDITIONAL_MODULES:=
  23. ifeq ($(CONFIG_APACHE_HTTP2),y)
  24. ADDITIONAL_MODULES += --enable-http2
  25. endif
  26. ifneq ($(CONFIG_APACHE_HTTP2),y)
  27. ADDITIONAL_MODULES += --enable-http2=no
  28. endif
  29. include $(INCLUDE_DIR)/package.mk
  30. define Package/apache/Default
  31. SECTION:=net
  32. CATEGORY:=Network
  33. SUBMENU:=Web Servers/Proxies
  34. TITLE:=The Apache Web Server
  35. URL:=https://httpd.apache.org/
  36. endef
  37. define Package/apache/Default/description
  38. The Apache Web Server is a powerful and flexible HTTP/1.1 compliant
  39. web server. Originally designed as a replacement for the NCSA HTTP
  40. Server, it has grown to be the most popular web server on the Internet.
  41. endef
  42. define Package/apache/config
  43. source "$(SOURCE)/Config.in"
  44. endef
  45. define Package/apache
  46. $(call Package/apache/Default)
  47. DEPENDS:=+libapr +libaprutil +libpcre +libopenssl +unixodbc +zlib +APACHE_HTTP2:libnghttp2
  48. endef
  49. define Package/apache/description
  50. $(call Package/apache/Default/description)
  51. .
  52. This package contains the Apache web server and utility programs.
  53. .
  54. Take care that you don't include apache at the moment into your image
  55. please select it only as module because busybox will override
  56. /usr/sbin/httpd. It'll be solved soon. If you need to include this
  57. package in the image anyway, remove httpd from busybox
  58. (Base system --> Configuration --> Networking Utilities --> httpd).
  59. Also you should take care for the initscripts, apache's httpd isn't
  60. compatible with the one from busybox, so if you want to use apache
  61. for running your webif, you'll need to change the parameters in the
  62. scripts and configure the rest in /etc/httpd.conf.
  63. endef
  64. define Package/apache/conffiles
  65. /etc/apache/httpd.conf
  66. /etc/apache/extra/httpd-autoindex.conf
  67. /etc/apache/extra/httpd-dav.conf
  68. /etc/apache/extra/httpd-default.conf
  69. /etc/apache/extra/httpd-info.conf
  70. /etc/apache/extra/httpd-languages.conf
  71. /etc/apache/extra/httpd-manual.conf
  72. /etc/apache/extra/httpd-mpm.conf
  73. /etc/apache/extra/httpd-multilang-errordoc.conf
  74. /etc/apache/extra/httpd-ssl.conf
  75. /etc/apache/extra/httpd-userdir.conf
  76. /etc/apache/extra/httpd-vhosts.conf
  77. /etc/apache/magic
  78. /etc/apache/mime.types
  79. endef
  80. define Package/apache-icons
  81. $(call Package/apache/Default)
  82. TITLE:=Icons from Apache
  83. DEPENDS:=apache
  84. endef
  85. define Package/apache-icons/description
  86. $(call Package/apache/Default/description)
  87. .
  88. This package contains the icons from Apache.
  89. endef
  90. TARGET_CFLAGS += $(FPIC) -Wno-error
  91. TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
  92. TARGET_LDFLAGS += -lpthread
  93. define Build/Configure
  94. $(call Build/Configure/Default, \
  95. --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
  96. --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
  97. --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
  98. $(ADDITIONAL_MODULES) \
  99. --enable-http \
  100. --with-crypto \
  101. --with-sqlit3="$(STAGING_DIR)/usr" \
  102. --with-openssl="$(STAGING_DIR)/usr" \
  103. --enable-ssl \
  104. --enable-proxy \
  105. --disable-md \
  106. --disable-disk-cache \
  107. --enable-maintainer-mode \
  108. --with-mpm=prefork \
  109. --with-mpm=worker \
  110. --enable-mime-magic \
  111. --without-suexec-bin \
  112. --sysconfdir=/etc/apache \
  113. ap_cv_void_ptr_lt_long=no \
  114. logfiledir="/var/log" \
  115. runtimedir="/var/run" \
  116. EXTRA_LIBS="-ldl -lpthread -lcrypto -lrt -lssl" \
  117. )
  118. endef
  119. define Build/InstallDev
  120. rm -rf $(PKG_INSTALL_DIR)/usr/man/ \
  121. $(PKG_INSTALL_DIR)/usr/share/manual/
  122. # if you need docs take a look into the build-dir :)
  123. $(INSTALL_DIR) $(1)/etc
  124. $(CP) $(PKG_INSTALL_DIR)/etc/* \
  125. $(1)/etc
  126. $(INSTALL_DIR) $(1)/usr/include/apache
  127. $(CP) $(PKG_INSTALL_DIR)/usr/include/* \
  128. $(1)/usr/include/apache
  129. $(INSTALL_DIR) $(1)/usr/lib
  130. $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \
  131. $(1)/usr/lib
  132. $(INSTALL_DIR) $(1)/usr/sbin
  133. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \
  134. $(1)/usr/sbin
  135. $(INSTALL_DIR) $(1)/usr/share
  136. $(CP) $(PKG_INSTALL_DIR)/usr/share/* \
  137. $(1)/usr/share
  138. endef
  139. define Package/apache/preinst
  140. rm /usr/sbin/httpd
  141. echo -e "You should take a look in the initscripts, busybox's httpd \n\
  142. uses some parameters which are maybe unsupported by apache."
  143. endef
  144. define Package/apache/install
  145. $(INSTALL_DIR) $(1)/usr/sbin
  146. # we don't need apxs on the router, it's just for building apache modules.
  147. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{ab,dbmmanage,htdbm,htdigest,htpasswd,httxt2dbm,logresolve} $(1)/usr/sbin/
  148. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{apachectl,checkgid,envvars,envvars-std,htcacheclean,httpd,rotatelogs} $(1)/usr/sbin/
  149. $(INSTALL_DIR) $(1)/usr/lib
  150. $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/
  151. $(INSTALL_DIR) $(1)/usr/share
  152. $(CP) $(PKG_INSTALL_DIR)/usr/share/{error,htdocs,cgi-bin,build} $(1)/usr/share/
  153. $(INSTALL_DIR) $(1)/etc/apache
  154. $(CP) $(PKG_INSTALL_DIR)/etc/apache/{httpd.conf,magic,mime.types,extra} $(1)/etc/apache/
  155. endef
  156. define Package/apache/postrm
  157. rm -rf /usr/sbin/httpd
  158. ln -s /bin/busybox /usr/sbin/httpd
  159. echo -e "You may need to change your initscripts back for the use \n\
  160. with busybox's httpd."
  161. endef
  162. define Package/apache-icons/install
  163. $(INSTALL_DIR) $(1)/usr/share
  164. $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/
  165. endef
  166. $(eval $(call BuildPackage,apache))
  167. $(eval $(call BuildPackage,apache-icons))