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.

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