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.

383 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.41
  10. PKG_RELEASE:=6
  11. PKG_SOURCE_NAME:=httpd
  12. PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2
  13. PKG_SOURCE_URL:=@APACHE/httpd/
  14. PKG_HASH:=133d48298fe5315ae9366a0ec66282fa4040efa5d566174481077ade7d18ea40
  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/Prepare
  226. $(call Build/Prepare/Default)
  227. $(INSTALL_DATA) ./files/openwrt.layout $(PKG_BUILD_DIR)/config.layout
  228. endef
  229. define Build/InstallDev
  230. $(INSTALL_DIR) $(1)/usr/bin
  231. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/apxs $(1)/usr/bin
  232. $(INSTALL_DIR) $(1)/usr/include/apache2
  233. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/apache2/* \
  234. $(1)/usr/include/apache2
  235. $(INSTALL_DIR) $(1)/usr/lib/apache2
  236. $(INSTALL_DIR) $(1)/usr/share/apache2/build
  237. $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/build/* \
  238. $(1)/usr/share/apache2/build
  239. $(SED) 's%/usr/share/apache2/build%$(STAGING_DIR)/usr/share/apache2/build%' \
  240. $(1)/usr/bin/apxs
  241. $(SED) 's%^prefix =.*%prefix = $(STAGING_DIR)/usr%' \
  242. $(1)/usr/share/apache2/build/config_vars.mk
  243. endef
  244. define Package/apache/install
  245. $(INSTALL_DIR) $(1)/etc/apache2/extra
  246. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/apache2/extra/* \
  247. $(1)/etc/apache2/extra
  248. $(SED) '/^LoadModule session_crypto_module/s/^/#/' \
  249. $(PKG_INSTALL_DIR)/etc/apache2/apache2.conf
  250. $(INSTALL_DATA) \
  251. $(PKG_INSTALL_DIR)/etc/apache2/{apache2.conf,magic,mime.types} \
  252. $(1)/etc/apache2
  253. $(INSTALL_DIR) $(1)/etc/init.d
  254. $(INSTALL_BIN) ./files/apache2.init $(1)/etc/init.d/apache2
  255. $(INSTALL_DIR) $(1)/usr/lib/apache2
  256. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/apache2/*.so \
  257. $(1)/usr/lib/apache2
  258. rm -f $(1)/usr/lib/apache2/mod_{*ldap,dav*,deflate,http2,lbmethod_*,lua,md,proxy*,proxy_html,session_crypto,ssl,suexec,xml2enc}.so
  259. $(INSTALL_DIR) $(1)/usr/share/apache2/{cgi-bin,htdocs}
  260. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/apache2/cgi-bin/* \
  261. $(1)/usr/share/apache2/cgi-bin
  262. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/apache2/htdocs/* \
  263. $(1)/usr/share/apache2/htdocs
  264. $(INSTALL_DIR) $(1)/usr/{,s}bin
  265. $(INSTALL_BIN) \
  266. $(PKG_INSTALL_DIR)/usr/bin/{dbmmanage,htdbm,htdigest,htpasswd,httxt2dbm,logresolve} \
  267. $(1)/usr/bin
  268. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{apachectl,apache2} \
  269. $(1)/usr/sbin
  270. endef
  271. define Package/apache-ab/install
  272. $(INSTALL_DIR) $(1)/usr/bin
  273. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ab $(1)/usr/bin
  274. endef
  275. define Package/apache-error/install
  276. $(INSTALL_DIR) $(1)/usr/share/apache2/error
  277. $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/error/* \
  278. $(1)/usr/share/apache2/error
  279. endef
  280. define Package/apache-icons/install
  281. $(INSTALL_DIR) $(1)/usr/share/apache2
  282. $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/icons \
  283. $(1)/usr/share/apache2
  284. endef
  285. define Package/apache-suexec/install
  286. $(INSTALL_DIR) $(1)/usr/sbin
  287. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/suexec $(1)/usr/sbin
  288. endef
  289. define Package/apache-utils/install
  290. $(INSTALL_DIR) $(1)/usr/sbin
  291. $(INSTALL_BIN) \
  292. $(PKG_INSTALL_DIR)/usr/sbin/{checkgid,envvars*,htcacheclean,rotatelogs} \
  293. $(1)/usr/sbin
  294. endef
  295. define Package/apache/Module
  296. define Package/apache-mod-$(1)
  297. $(call Package/apache/Default)
  298. TITLE:=$(2) module
  299. DEPENDS:=apache $(patsubst +%,+PACKAGE_apache-mod-$(1):%,$(4))
  300. endef
  301. define Package/apache-mod-$(1)/description
  302. $(subst \n,$(newline),$(3))
  303. endef
  304. define Package/apache-mod-$(1)/install
  305. $(foreach m,$(5),$(call Package/apache/install/mod,$$(1),$(m));)
  306. endef
  307. $$(eval $$(call BuildPackage,apache-mod-$(1)))
  308. endef
  309. $(eval $(call BuildPackage,apache))
  310. $(eval $(call BuildPackage,apache-ab))
  311. $(eval $(call BuildPackage,apache-error))
  312. $(eval $(call BuildPackage,apache-icons))
  313. $(eval $(call BuildPackage,apache-suexec))
  314. $(eval $(call BuildPackage,apache-utils))
  315. $(eval $(call Package/apache/Module,deflate,Deflate,Deflate support for the Apache HTTP server.,+zlib,deflate))
  316. $(eval $(call Package/apache/Module,http2,HTTP2,HTTP/2 transport layer for the Apache HTTP Server.,+libnghttp2 +libopenssl,http2))
  317. $(eval $(call Package/apache/Module,ldap,LDAP,LDAP authentication/authorization module for the Apache HTTP Server.,+libaprutil-ldap,authnz_ldap ldap))
  318. $(eval $(call Package/apache/Module,lua,Lua,Lua support for the Apache HTTP server.,+liblua,lua))
  319. $(eval $(call Package/apache/Module,md,Managed Domain handling,Managed Domain handling.,+libcurl +jansson +libopenssl,md))
  320. $(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))
  321. $(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))
  322. $(eval $(call Package/apache/Module,session-crypto,Session crypto,Session encryption support for the Apache HTTP Server.,+libaprutil-crypto-openssl,session_crypto))
  323. $(eval $(call Package/apache/Module,ssl,SSL/TLS,SSL/TLS module for the Apache HTTP Server.,+libopenssl,ssl))
  324. $(eval $(call Package/apache/Module,suexec,suEXEC,suEXEC module for the Apache HTTP Server.,+apache-suexec,suexec))
  325. $(eval $(call Package/apache/Module,webdav,WebDAV,WebDAV support for the Apache HTTP Server.,,dav dav_fs dav_lock))