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.

374 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:=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:=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/httpd.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/apache
  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-deflate),en,dis)able-deflate \
  132. --$(if $(CONFIG_PACKAGE_apache-mod-http2),en,dis)able-http2 \
  133. --$(if $(CONFIG_PACKAGE_apache-mod-lua),en,dis)able-lua \
  134. --$(if $(CONFIG_PACKAGE_apache-mod-md),en,dis)able-md \
  135. --$(if $(CONFIG_PACKAGE_apache-mod-proxy),en,dis)able-proxy \
  136. --$(if $(CONFIG_PACKAGE_apache-mod-session-crypto),en,dis)able-session-crypto \
  137. --$(if $(CONFIG_PACKAGE_apache-mod-ssl),en,dis)able-ssl \
  138. --datadir=/usr/share/apache2 \
  139. --disable-imagemap \
  140. --disable-luajit \
  141. --enable-authn-alias \
  142. --enable-authn-anon \
  143. --enable-cache \
  144. --enable-cgi \
  145. --enable-cgid \
  146. --enable-dbd \
  147. --enable-disk-cache \
  148. --enable-exception-hook \
  149. --enable-file-cache \
  150. --enable-layout=OpenWrt \
  151. --enable-mem-cache \
  152. --enable-mods-shared=all \
  153. --enable-mpms-shared=all \
  154. --enable-so \
  155. --libexecdir=/usr/lib/apache2 \
  156. --sysconfdir=/etc/apache2 \
  157. --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
  158. --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
  159. --with-mpm=prefork \
  160. --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
  161. --with-ssl
  162. ifneq ($(CONFIG_PACKAGE_apache-mod-ldap),)
  163. CONFIGURE_ARGS+= \
  164. --enable-authnz-ldap \
  165. --enable-ldap
  166. else
  167. CONFIGURE_ARGS+= \
  168. --disable-authnz-ldap \
  169. --disable-ldap
  170. endif
  171. ifneq ($(CONFIG_PACKAGE_apache-mod-proxy),)
  172. CONFIGURE_ARGS+= \
  173. --enable-proxy \
  174. --enable-proxy-connect \
  175. --enable-proxy-ftp \
  176. --enable-proxy-http
  177. else
  178. CONFIGURE_ARGS+= \
  179. --disable-proxy
  180. endif
  181. ifneq ($(CONFIG_PACKAGE_apache-mod-proxy-html),)
  182. CONFIGURE_ARGS+= \
  183. --enable-proxy-html \
  184. --enable-xml2enc \
  185. --with-libxml2="$(STAGING_DIR)/usr"
  186. else
  187. CONFIGURE_ARGS+= \
  188. --disable-proxy-html \
  189. --disable-xml2enc
  190. endif
  191. ifneq ($(CONFIG_PACKAGE_apache-mod-suexec)$(CONFIG_PACKAGE_apache-suexec),)
  192. CONFIGURE_ARGS+= \
  193. --enable-suexec \
  194. --with-suexec-bin=/usr/sbin/suexec \
  195. --with-suexec-caller=apache \
  196. --with-suexec-docroot=/var/www \
  197. --with-suexec-logfile=/var/log/apache2/suexec.log \
  198. --with-suexec-uidmin=99 \
  199. --with-suexec-gidmin=99
  200. else
  201. CONFIGURE_ARGS+= \
  202. --disable-suexec
  203. endif
  204. ifneq ($(CONFIG_PACKAGE_apache-mod-webdav),)
  205. CONFIGURE_ARGS+= \
  206. --enable-dav \
  207. --enable-dav-fs \
  208. --enable-dav-lock
  209. else
  210. CONFIGURE_ARGS+= \
  211. --disable-dav
  212. endif
  213. CONFIGURE_VARS += \
  214. ap_cv_void_ptr_lt_long=no
  215. define Build/Prepare
  216. $(call Build/Prepare/Default)
  217. $(INSTALL_DATA) ./files/openwrt.layout $(PKG_BUILD_DIR)/config.layout
  218. endef
  219. define Build/InstallDev
  220. $(INSTALL_DIR) $(1)/usr/bin
  221. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/apxs $(1)/usr/bin
  222. $(INSTALL_DIR) $(1)/usr/include/apache2
  223. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/apache2/* \
  224. $(1)/usr/include/apache2
  225. $(INSTALL_DIR) $(1)/usr/lib/apache2
  226. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/apache2/httpd.exp \
  227. $(1)/usr/lib/apache2
  228. $(INSTALL_DIR) $(1)/usr/share/apache2/build
  229. $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/build/* \
  230. $(1)/usr/share/apache2/build
  231. $(SED) 's%/usr/share/apache2/build%$(STAGING_DIR)/usr/share/apache2/build%' \
  232. $(1)/usr/bin/apxs
  233. $(SED) 's%^prefix =.*%prefix = $(STAGING_DIR)/usr%' \
  234. $(1)/usr/share/apache2/build/config_vars.mk
  235. endef
  236. define Package/apache/install
  237. $(INSTALL_DIR) $(1)/etc/apache2/extra
  238. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/apache2/extra/* \
  239. $(1)/etc/apache2/extra
  240. $(INSTALL_DATA) \
  241. $(PKG_INSTALL_DIR)/etc/apache2/{httpd.conf,magic,mime.types} \
  242. $(1)/etc/apache2
  243. $(INSTALL_DIR) $(1)/etc/init.d
  244. $(INSTALL_BIN) ./files/apache.init $(1)/etc/init.d/apache
  245. $(INSTALL_DIR) $(1)/usr/lib/apache2
  246. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/apache2/*.so \
  247. $(1)/usr/lib/apache2
  248. rm -f $(1)/usr/lib/apache2/mod_{*ldap,dav*,deflate,http2,lbmethod_*,lua,md,proxy*,proxy_html,session_crypto,ssl,suexec,xml2enc}.so
  249. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/apache2/httpd.exp \
  250. $(1)/usr/lib/apache2
  251. $(INSTALL_DIR) $(1)/usr/share/apache2/{cgi-bin,htdocs}
  252. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/apache2/cgi-bin/* \
  253. $(1)/usr/share/apache2/cgi-bin
  254. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/apache2/htdocs/* \
  255. $(1)/usr/share/apache2/htdocs
  256. $(INSTALL_DIR) $(1)/usr/{,s}bin
  257. $(INSTALL_BIN) \
  258. $(PKG_INSTALL_DIR)/usr/bin/{dbmmanage,htdbm,htdigest,htpasswd,httxt2dbm,logresolve} \
  259. $(1)/usr/bin
  260. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{apachectl,httpd} \
  261. $(1)/usr/sbin
  262. endef
  263. define Package/apache-ab/install
  264. $(INSTALL_DIR) $(1)/usr/bin
  265. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ab $(1)/usr/bin
  266. endef
  267. define Package/apache-error/install
  268. $(INSTALL_DIR) $(1)/usr/share/apache2/error
  269. $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/error/* \
  270. $(1)/usr/share/apache2/error
  271. endef
  272. define Package/apache-icons/install
  273. $(INSTALL_DIR) $(1)/usr/share/apache2
  274. $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/icons \
  275. $(1)/usr/share/apache2
  276. endef
  277. define Package/apache-suexec/install
  278. $(INSTALL_DIR) $(1)/usr/sbin
  279. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/suexec $(1)/usr/sbin
  280. endef
  281. define Package/apache-utils/install
  282. $(INSTALL_DIR) $(1)/usr/sbin
  283. $(INSTALL_BIN) \
  284. $(PKG_INSTALL_DIR)/usr/sbin/{checkgid,envvars*,htcacheclean,rotatelogs} \
  285. $(1)/usr/sbin
  286. endef
  287. define Package/apache/Module
  288. define Package/apache-mod-$(1)
  289. $(call Package/apache/Default)
  290. TITLE:=$(2) module
  291. DEPENDS:=apache $(patsubst +%,+PACKAGE_apache-mod-$(1):%,$(4))
  292. endef
  293. define Package/apache-mod-$(1)/description
  294. $(subst \n,$(newline),$(3))
  295. endef
  296. define Package/apache-mod-$(1)/install
  297. $(foreach m,$(5),$(call Package/apache/install/mod,$$(1),$(m));)
  298. endef
  299. $$(eval $$(call BuildPackage,apache-mod-$(1)))
  300. endef
  301. $(eval $(call BuildPackage,apache))
  302. $(eval $(call BuildPackage,apache-ab))
  303. $(eval $(call BuildPackage,apache-error))
  304. $(eval $(call BuildPackage,apache-icons))
  305. $(eval $(call BuildPackage,apache-suexec))
  306. $(eval $(call BuildPackage,apache-utils))
  307. $(eval $(call Package/apache/Module,deflate,Deflate,Deflate support for the Apache HTTP server.,+zlib,deflate))
  308. $(eval $(call Package/apache/Module,http2,HTTP2,HTTP/2 transport layer for the Apache HTTP Server.,+libnghttp2 +libopenssl,http2))
  309. $(eval $(call Package/apache/Module,ldap,LDAP,LDAP authentication/authorization module for the Apache HTTP Server.,+libaprutil-ldap,authnz_ldap ldap))
  310. $(eval $(call Package/apache/Module,lua,Lua,Lua support for the Apache HTTP server.,+liblua,lua))
  311. $(eval $(call Package/apache/Module,md,Managed Domain handling,Managed Domain handling.,+libcurl +jansson +libopenssl,md))
  312. $(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))
  313. $(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))
  314. $(eval $(call Package/apache/Module,session-crypto,Session crypto,Session encryption support for the Apache HTTP Server.,+libaprutil-crypto-openssl,session_crypto))
  315. $(eval $(call Package/apache/Module,ssl,SSL/TLS,SSL/TLS module for the Apache HTTP Server.,+libopenssl,ssl))
  316. $(eval $(call Package/apache/Module,suexec,suEXEC,suEXEC module for the Apache HTTP Server.,+apache-suexec,suexec))
  317. $(eval $(call Package/apache/Module,webdav,WebDAV,WebDAV support for the Apache HTTP Server.,,dav dav_fs dav_lock))