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.

191 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:=1
  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-disk-cache \
  106. --enable-maintainer-mode \
  107. --with-mpm=prefork \
  108. --with-mpm=worker \
  109. --enable-mime-magic \
  110. --without-suexec-bin \
  111. --sysconfdir=/etc/apache \
  112. ap_cv_void_ptr_lt_long=no \
  113. logfiledir="/var/log" \
  114. runtimedir="/var/run" \
  115. EXTRA_LIBS="-ldl -lpthread -lcrypto -lrt -lssl" \
  116. )
  117. endef
  118. define Build/InstallDev
  119. rm -rf $(PKG_INSTALL_DIR)/usr/man/ \
  120. $(PKG_INSTALL_DIR)/usr/share/manual/
  121. # if you need docs take a look into the build-dir :)
  122. $(INSTALL_DIR) $(1)/etc
  123. $(CP) $(PKG_INSTALL_DIR)/etc/* \
  124. $(1)/etc
  125. $(INSTALL_DIR) $(1)/usr/include/apache
  126. $(CP) $(PKG_INSTALL_DIR)/usr/include/* \
  127. $(1)/usr/include/apache
  128. $(INSTALL_DIR) $(1)/usr/lib
  129. $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \
  130. $(1)/usr/lib
  131. $(INSTALL_DIR) $(1)/usr/sbin
  132. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \
  133. $(1)/usr/sbin
  134. $(INSTALL_DIR) $(1)/usr/share
  135. $(CP) $(PKG_INSTALL_DIR)/usr/share/* \
  136. $(1)/usr/share
  137. endef
  138. define Package/apache/preinst
  139. rm /usr/sbin/httpd
  140. echo -e "You should take a look in the initscripts, busybox's httpd \n\
  141. uses some parameters which are maybe unsupported by apache."
  142. endef
  143. define Package/apache/install
  144. $(INSTALL_DIR) $(1)/usr/sbin
  145. # we don't need apxs on the router, it's just for building apache modules.
  146. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{ab,dbmmanage,htdbm,htdigest,htpasswd,httxt2dbm,logresolve} $(1)/usr/sbin/
  147. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{apachectl,checkgid,envvars,envvars-std,htcacheclean,httpd,rotatelogs} $(1)/usr/sbin/
  148. $(INSTALL_DIR) $(1)/usr/lib
  149. $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/
  150. $(INSTALL_DIR) $(1)/usr/share
  151. $(CP) $(PKG_INSTALL_DIR)/usr/share/{error,htdocs,cgi-bin,build} $(1)/usr/share/
  152. $(INSTALL_DIR) $(1)/etc/apache
  153. $(CP) $(PKG_INSTALL_DIR)/etc/apache/{httpd.conf,magic,mime.types,extra} $(1)/etc/apache/
  154. endef
  155. define Package/apache/postrm
  156. rm -rf /usr/sbin/httpd
  157. ln -s /bin/busybox /usr/sbin/httpd
  158. echo -e "You may need to change your initscripts back for the use \n\
  159. with busybox's httpd."
  160. endef
  161. define Package/apache-icons/install
  162. $(INSTALL_DIR) $(1)/usr/share
  163. $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/
  164. endef
  165. $(eval $(call BuildPackage,apache))
  166. $(eval $(call BuildPackage,apache-icons))