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.

376 lines
11 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.43
  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:=a497652ab3fc81318cdc2a203090a999150d86461acff97c1065dc910fe10f43
  15. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
  16. PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>, \
  17. Sebastian Kemper <sebastian_ml@gmx.net>
  18. PKG_LICENSE:=Apache-2.0
  19. PKG_LICENSE_FILES:=LICENSE
  20. PKG_CPE_ID:=cpe:/a:apache:http_server
  21. PKG_BUILD_DEPENDS:=openssl
  22. PKG_BUILD_PARALLEL:=1
  23. PKG_CONFIG_DEPENDS:= \
  24. CONFIG_PACKAGE_apache-mod-deflate \
  25. CONFIG_PACKAGE_apache-mod-http2 \
  26. CONFIG_PACKAGE_apache-mod-ldap \
  27. CONFIG_PACKAGE_apache-mod-lua \
  28. CONFIG_PACKAGE_apache-mod-md \
  29. CONFIG_PACKAGE_apache-mod-proxy \
  30. CONFIG_PACKAGE_apache-mod-proxy-html \
  31. CONFIG_PACKAGE_apache-mod-session-crypto \
  32. CONFIG_PACKAGE_apache-mod-suexec \
  33. CONFIG_PACKAGE_apache-mod-webdav \
  34. CONFIG_PACKAGE_apache-suexec
  35. PKG_FIXUP:=autoreconf
  36. PKG_INSTALL:=1
  37. include $(INCLUDE_DIR)/package.mk
  38. # without nls.mk mod_xml2enc might not find the iconv headers
  39. include $(INCLUDE_DIR)/nls.mk
  40. define Package/apache/Default
  41. SECTION:=net
  42. CATEGORY:=Network
  43. SUBMENU:=Web Servers/Proxies
  44. TITLE:=The Apache Web Server
  45. URL:=https://httpd.apache.org/
  46. endef
  47. define Package/apache/Default/description
  48. The Apache HTTP Server Project is a collaborative software development
  49. effort aimed at creating a robust, commercial-grade, featureful, and
  50. freely-available source code implementation of an HTTP (Web) server.
  51. endef
  52. define Package/apache
  53. $(call Package/apache/Default)
  54. USERID:=apache=377:apache=377
  55. DEPENDS:=+libapr +libaprutil +libpcre
  56. endef
  57. define Package/apache/description
  58. $(call Package/apache/Default/description)
  59. This package contains the Apache web server and utility programs.
  60. endef
  61. define Package/apache/conffiles
  62. /etc/apache2/apache2.conf
  63. /etc/apache2/extra/httpd-autoindex.conf
  64. /etc/apache2/extra/httpd-dav.conf
  65. /etc/apache2/extra/httpd-default.conf
  66. /etc/apache2/extra/httpd-info.conf
  67. /etc/apache2/extra/httpd-languages.conf
  68. /etc/apache2/extra/httpd-manual.conf
  69. /etc/apache2/extra/httpd-mpm.conf
  70. /etc/apache2/extra/httpd-multilang-errordoc.conf
  71. /etc/apache2/extra/httpd-ssl.conf
  72. /etc/apache2/extra/httpd-userdir.conf
  73. /etc/apache2/extra/httpd-vhosts.conf
  74. /etc/apache2/extra/proxy-html.conf
  75. /etc/apache2/magic
  76. /etc/apache2/mime.types
  77. /etc/init.d/apache2
  78. endef
  79. define Package/apache-ab
  80. $(call Package/apache/Default)
  81. TITLE:=Apache benchmark utility
  82. DEPENDS:=apache +libopenssl
  83. endef
  84. define Package/apache-ab/description
  85. $(call Package/apache/Default/description)
  86. Apache server benchmarking utility.
  87. endef
  88. define Package/apache-error
  89. $(call Package/apache/Default)
  90. TITLE:=Error documents
  91. DEPENDS:=apache
  92. endef
  93. define Package/apache-error/description
  94. $(call Package/apache/Default/description)
  95. Apache multi language custom error documents.
  96. endef
  97. define Package/apache-icons
  98. $(call Package/apache/Default)
  99. TITLE:=Icons from Apache
  100. DEPENDS:=apache
  101. endef
  102. define Package/apache-icons/description
  103. $(call Package/apache/Default/description)
  104. This package contains the icons from Apache.
  105. endef
  106. define Package/apache-suexec
  107. $(call Package/apache/Default)
  108. TITLE:=Apache suEXEC
  109. DEPENDS:=apache
  110. endef
  111. define Package/apache-suexec/description
  112. $(call Package/apache/Default/description)
  113. This package contains the suEXEC utility from Apache.
  114. endef
  115. define Package/apache-utils
  116. $(call Package/apache/Default)
  117. TITLE:=Apache utilities
  118. DEPENDS:=apache
  119. endef
  120. define Package/apache-utils/description
  121. $(call Package/apache/Default/description)
  122. Apache utility programs for webservers.
  123. endef
  124. define Package/apache/install/mod
  125. $(INSTALL_DIR) $(1)/usr/lib/apache2
  126. $(INSTALL_BIN) \
  127. $(PKG_INSTALL_DIR)/usr/lib/apache2/mod_$(2).so \
  128. $(1)/usr/lib/apache2
  129. endef
  130. CONFIGURE_ARGS+= \
  131. --$(if $(CONFIG_PACKAGE_apache-mod-http2),en,dis)able-http2 \
  132. --$(if $(CONFIG_PACKAGE_apache-mod-lua),en,dis)able-lua \
  133. --$(if $(CONFIG_PACKAGE_apache-mod-md),en,dis)able-md \
  134. --$(if $(CONFIG_PACKAGE_apache-mod-proxy),en,dis)able-proxy \
  135. --$(if $(CONFIG_PACKAGE_apache-mod-session-crypto),en,dis)able-session-crypto \
  136. --$(if $(CONFIG_PACKAGE_apache-mod-ssl),en,dis)able-ssl \
  137. --datadir=/usr/share/apache2 \
  138. --disable-imagemap \
  139. --disable-luajit \
  140. --enable-authn-alias \
  141. --enable-authn-anon \
  142. --enable-cache \
  143. --enable-cgi \
  144. --enable-cgid \
  145. --enable-dbd \
  146. --enable-disk-cache \
  147. --enable-exception-hook \
  148. --enable-file-cache \
  149. --enable-layout=OpenWrt \
  150. --enable-mem-cache \
  151. --enable-mods-shared=all \
  152. --enable-mpms-shared=all \
  153. --enable-so \
  154. --libexecdir=/usr/lib/apache2 \
  155. --sysconfdir=/etc/apache2 \
  156. --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
  157. --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
  158. --with-mpm=prefork \
  159. --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
  160. --with-program-name=apache2 \
  161. --with-ssl
  162. ifneq ($(CONFIG_PACKAGE_apache-mod-deflate),)
  163. CONFIGURE_ARGS+= \
  164. --enable-deflate \
  165. --with-z="$(STAGING_DIR)/usr"
  166. else
  167. CONFIGURE_ARGS+= \
  168. --disable-deflate \
  169. --without-z
  170. endif
  171. ifneq ($(CONFIG_PACKAGE_apache-mod-ldap),)
  172. CONFIGURE_ARGS+= \
  173. --enable-authnz-ldap \
  174. --enable-ldap
  175. else
  176. CONFIGURE_ARGS+= \
  177. --disable-authnz-ldap \
  178. --disable-ldap
  179. endif
  180. ifneq ($(CONFIG_PACKAGE_apache-mod-proxy),)
  181. CONFIGURE_ARGS+= \
  182. --enable-proxy \
  183. --enable-proxy-connect \
  184. --enable-proxy-ftp \
  185. --enable-proxy-http
  186. else
  187. CONFIGURE_ARGS+= \
  188. --disable-proxy
  189. endif
  190. ifneq ($(CONFIG_PACKAGE_apache-mod-proxy-html),)
  191. CONFIGURE_ARGS+= \
  192. --enable-proxy-html \
  193. --enable-xml2enc \
  194. --with-libxml2="$(STAGING_DIR)/usr"
  195. else
  196. CONFIGURE_ARGS+= \
  197. --disable-proxy-html \
  198. --disable-xml2enc
  199. endif
  200. ifneq ($(CONFIG_PACKAGE_apache-mod-suexec)$(CONFIG_PACKAGE_apache-suexec),)
  201. CONFIGURE_ARGS+= \
  202. --enable-suexec \
  203. --with-suexec-bin=/usr/sbin/suexec \
  204. --with-suexec-caller=apache \
  205. --with-suexec-docroot=/var/www \
  206. --with-suexec-logfile=/var/log/apache2/suexec.log \
  207. --with-suexec-uidmin=99 \
  208. --with-suexec-gidmin=99
  209. else
  210. CONFIGURE_ARGS+= \
  211. --disable-suexec
  212. endif
  213. ifneq ($(CONFIG_PACKAGE_apache-mod-webdav),)
  214. CONFIGURE_ARGS+= \
  215. --enable-dav \
  216. --enable-dav-fs \
  217. --enable-dav-lock
  218. else
  219. CONFIGURE_ARGS+= \
  220. --disable-dav
  221. endif
  222. CONFIGURE_VARS += \
  223. ac_cv_gettid=yes \
  224. ap_cv_void_ptr_lt_long=no
  225. define Build/InstallDev
  226. $(INSTALL_DIR) $(1)/usr/bin
  227. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/apxs $(1)/usr/bin
  228. $(INSTALL_DIR) $(1)/usr/include/apache2
  229. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/apache2/* \
  230. $(1)/usr/include/apache2
  231. $(INSTALL_DIR) $(1)/usr/lib/apache2
  232. $(INSTALL_DIR) $(1)/usr/share/apache2/build
  233. $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/build/* \
  234. $(1)/usr/share/apache2/build
  235. $(SED) 's%^prefix =.*%prefix = $(STAGING_DIR)/usr%' \
  236. $(1)/usr/share/apache2/build/config_vars.mk
  237. endef
  238. define Package/apache/install
  239. $(INSTALL_DIR) $(1)/etc/apache2/extra
  240. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/apache2/extra/* \
  241. $(1)/etc/apache2/extra
  242. $(SED) '/^LoadModule session_crypto_module/s/^/#/' \
  243. $(PKG_INSTALL_DIR)/etc/apache2/apache2.conf
  244. $(INSTALL_DATA) \
  245. $(PKG_INSTALL_DIR)/etc/apache2/{apache2.conf,magic,mime.types} \
  246. $(1)/etc/apache2
  247. $(INSTALL_DIR) $(1)/etc/init.d
  248. $(INSTALL_BIN) ./files/apache2.init $(1)/etc/init.d/apache2
  249. $(INSTALL_DIR) $(1)/usr/lib/apache2
  250. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/apache2/*.so \
  251. $(1)/usr/lib/apache2
  252. rm -f $(1)/usr/lib/apache2/mod_{*ldap,dav*,deflate,http2,lbmethod_*,lua,md,proxy*,proxy_html,session_crypto,ssl,suexec,xml2enc}.so
  253. $(INSTALL_DIR) $(1)/usr/share/apache2/{cgi-bin,htdocs}
  254. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/apache2/cgi-bin/* \
  255. $(1)/usr/share/apache2/cgi-bin
  256. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/apache2/htdocs/* \
  257. $(1)/usr/share/apache2/htdocs
  258. $(INSTALL_DIR) $(1)/usr/{,s}bin
  259. $(INSTALL_BIN) \
  260. $(PKG_INSTALL_DIR)/usr/bin/{dbmmanage,htdbm,htdigest,htpasswd,httxt2dbm,logresolve} \
  261. $(1)/usr/bin
  262. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{apachectl,apache2} \
  263. $(1)/usr/sbin
  264. endef
  265. define Package/apache-ab/install
  266. $(INSTALL_DIR) $(1)/usr/bin
  267. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ab $(1)/usr/bin
  268. endef
  269. define Package/apache-error/install
  270. $(INSTALL_DIR) $(1)/usr/share/apache2/error
  271. $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/error/* \
  272. $(1)/usr/share/apache2/error
  273. endef
  274. define Package/apache-icons/install
  275. $(INSTALL_DIR) $(1)/usr/share/apache2
  276. $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/icons \
  277. $(1)/usr/share/apache2
  278. endef
  279. define Package/apache-suexec/install
  280. $(INSTALL_DIR) $(1)/usr/sbin
  281. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/suexec $(1)/usr/sbin
  282. endef
  283. define Package/apache-utils/install
  284. $(INSTALL_DIR) $(1)/usr/sbin
  285. $(INSTALL_BIN) \
  286. $(PKG_INSTALL_DIR)/usr/sbin/{checkgid,envvars*,htcacheclean,rotatelogs} \
  287. $(1)/usr/sbin
  288. endef
  289. define Package/apache/Module
  290. define Package/apache-mod-$(1)
  291. $(call Package/apache/Default)
  292. TITLE:=$(2) module
  293. DEPENDS:=apache $(patsubst +%,+PACKAGE_apache-mod-$(1):%,$(4))
  294. endef
  295. define Package/apache-mod-$(1)/description
  296. $(subst \n,$(newline),$(3))
  297. endef
  298. define Package/apache-mod-$(1)/install
  299. $(foreach m,$(5),$(call Package/apache/install/mod,$$(1),$(m));)
  300. endef
  301. $$(eval $$(call BuildPackage,apache-mod-$(1)))
  302. endef
  303. $(eval $(call BuildPackage,apache))
  304. $(eval $(call BuildPackage,apache-ab))
  305. $(eval $(call BuildPackage,apache-error))
  306. $(eval $(call BuildPackage,apache-icons))
  307. $(eval $(call BuildPackage,apache-suexec))
  308. $(eval $(call BuildPackage,apache-utils))
  309. $(eval $(call Package/apache/Module,deflate,Deflate,Deflate support for the Apache HTTP server.,+zlib,deflate))
  310. $(eval $(call Package/apache/Module,http2,HTTP2,HTTP/2 transport layer for the Apache HTTP Server.,+libnghttp2 +libopenssl,http2))
  311. $(eval $(call Package/apache/Module,ldap,LDAP,LDAP authentication/authorization module for the Apache HTTP Server.,+libaprutil-ldap,authnz_ldap ldap))
  312. $(eval $(call Package/apache/Module,lua,Lua,Lua support for the Apache HTTP server.,+liblua,lua))
  313. $(eval $(call Package/apache/Module,md,Managed Domain handling,Managed Domain handling.,+libcurl +jansson +libopenssl,md))
  314. $(eval $(call Package/apache/Module,proxy,Proxy,Proxy modules for the Apache HTTP Server.,,proxy proxy_ajp proxy_balancer proxy_connect proxy_express proxy_fcgi proxy_fdpass proxy_ftp proxy_hcheck proxy_http proxy_scgi proxy_uwsgi proxy_wstunnel lbmethod_byrequests lbmethod_heartbeat lbmethod_bytraffic lbmethod_bybusyness))
  315. $(eval $(call Package/apache/Module,proxy-html,Proxy HTML,HTML and XML content filters for the Apache HTTP Server.,+apache-mod-proxy +libxml2,proxy_html xml2enc))
  316. $(eval $(call Package/apache/Module,session-crypto,Session crypto,Session encryption support for the Apache HTTP Server.,+libaprutil-crypto-openssl,session_crypto))
  317. $(eval $(call Package/apache/Module,ssl,SSL/TLS,SSL/TLS module for the Apache HTTP Server.,+libopenssl,ssl))
  318. $(eval $(call Package/apache/Module,suexec,suEXEC,suEXEC module for the Apache HTTP Server.,+apache-suexec,suexec))
  319. $(eval $(call Package/apache/Module,webdav,WebDAV,WebDAV support for the Apache HTTP Server.,,dav dav_fs dav_lock))