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.

373 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. 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/httpd.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/apache
  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. endef
  110. define Package/apache-suexec/description
  111. $(call Package/apache/Default/description)
  112. This package contains the suEXEC utility from Apache.
  113. endef
  114. define Package/apache-utils
  115. $(call Package/apache/Default)
  116. TITLE:=Apache utilities
  117. DEPENDS:=apache
  118. endef
  119. define Package/apache-utils/description
  120. $(call Package/apache/Default/description)
  121. Apache utility programs for webservers.
  122. endef
  123. define Package/apache/install/mod
  124. $(INSTALL_DIR) $(1)/usr/lib/apache2
  125. $(INSTALL_BIN) \
  126. $(PKG_INSTALL_DIR)/usr/lib/apache2/mod_$(2).so \
  127. $(1)/usr/lib/apache2
  128. endef
  129. CONFIGURE_ARGS+= \
  130. --$(if $(CONFIG_PACKAGE_apache-mod-deflate),en,dis)able-deflate \
  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-ssl
  161. ifneq ($(CONFIG_PACKAGE_apache-mod-ldap),)
  162. CONFIGURE_ARGS+= \
  163. --enable-authnz-ldap \
  164. --enable-ldap
  165. else
  166. CONFIGURE_ARGS+= \
  167. --disable-authnz-ldap \
  168. --disable-ldap
  169. endif
  170. ifneq ($(CONFIG_PACKAGE_apache-mod-proxy),)
  171. CONFIGURE_ARGS+= \
  172. --enable-proxy \
  173. --enable-proxy-connect \
  174. --enable-proxy-ftp \
  175. --enable-proxy-http
  176. else
  177. CONFIGURE_ARGS+= \
  178. --disable-proxy
  179. endif
  180. ifneq ($(CONFIG_PACKAGE_apache-mod-proxy-html),)
  181. CONFIGURE_ARGS+= \
  182. --enable-proxy-html \
  183. --enable-xml2enc \
  184. --with-libxml2="$(STAGING_DIR)/usr"
  185. else
  186. CONFIGURE_ARGS+= \
  187. --disable-proxy-html \
  188. --disable-xml2enc
  189. endif
  190. ifneq ($(CONFIG_PACKAGE_apache-mod-suexec)$(CONFIG_PACKAGE_apache-suexec),)
  191. CONFIGURE_ARGS+= \
  192. --enable-suexec \
  193. --with-suexec-bin=/usr/sbin/suexec \
  194. --with-suexec-caller=apache \
  195. --with-suexec-docroot=/var/www \
  196. --with-suexec-logfile=/var/log/apache2/suexec.log \
  197. --with-suexec-uidmin=99 \
  198. --with-suexec-gidmin=99
  199. else
  200. CONFIGURE_ARGS+= \
  201. --disable-suexec
  202. endif
  203. ifneq ($(CONFIG_PACKAGE_apache-mod-webdav),)
  204. CONFIGURE_ARGS+= \
  205. --enable-dav \
  206. --enable-dav-fs \
  207. --enable-dav-lock
  208. else
  209. CONFIGURE_ARGS+= \
  210. --disable-dav
  211. endif
  212. CONFIGURE_VARS += \
  213. ap_cv_void_ptr_lt_long=no
  214. define Build/Prepare
  215. $(call Build/Prepare/Default)
  216. $(INSTALL_DATA) ./files/openwrt.layout $(PKG_BUILD_DIR)/config.layout
  217. endef
  218. define Build/InstallDev
  219. $(INSTALL_DIR) $(1)/usr/bin
  220. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/apxs $(1)/usr/bin
  221. $(INSTALL_DIR) $(1)/usr/include/apache2
  222. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/apache2/* \
  223. $(1)/usr/include/apache2
  224. $(INSTALL_DIR) $(1)/usr/lib/apache2
  225. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/apache2/httpd.exp \
  226. $(1)/usr/lib/apache2
  227. $(INSTALL_DIR) $(1)/usr/share/apache2/build
  228. $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/build/* \
  229. $(1)/usr/share/apache2/build
  230. $(SED) 's%/usr/share/apache2/build%$(STAGING_DIR)/usr/share/apache2/build%' \
  231. $(1)/usr/bin/apxs
  232. $(SED) 's%^prefix =.*%prefix = $(STAGING_DIR)/usr%' \
  233. $(1)/usr/share/apache2/build/config_vars.mk
  234. endef
  235. define Package/apache/install
  236. $(INSTALL_DIR) $(1)/etc/apache2/extra
  237. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/etc/apache2/extra/* \
  238. $(1)/etc/apache2/extra
  239. $(INSTALL_DATA) \
  240. $(PKG_INSTALL_DIR)/etc/apache2/{httpd.conf,magic,mime.types} \
  241. $(1)/etc/apache2
  242. $(INSTALL_DIR) $(1)/etc/init.d
  243. $(INSTALL_BIN) ./files/apache.init $(1)/etc/init.d/apache
  244. $(INSTALL_DIR) $(1)/usr/lib/apache2
  245. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/lib/apache2/*.so \
  246. $(1)/usr/lib/apache2
  247. rm -f $(1)/usr/lib/apache2/mod_{*ldap,dav*,deflate,http2,lbmethod_*,lua,md,proxy*,proxy_html,session_crypto,ssl,suexec,xml2enc}.so
  248. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/apache2/httpd.exp \
  249. $(1)/usr/lib/apache2
  250. $(INSTALL_DIR) $(1)/usr/share/apache2/{cgi-bin,htdocs}
  251. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/apache2/cgi-bin/* \
  252. $(1)/usr/share/apache2/cgi-bin
  253. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/share/apache2/htdocs/* \
  254. $(1)/usr/share/apache2/htdocs
  255. $(INSTALL_DIR) $(1)/usr/{,s}bin
  256. $(INSTALL_BIN) \
  257. $(PKG_INSTALL_DIR)/usr/bin/{dbmmanage,htdbm,htdigest,htpasswd,httxt2dbm,logresolve} \
  258. $(1)/usr/bin
  259. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{apachectl,httpd} \
  260. $(1)/usr/sbin
  261. endef
  262. define Package/apache-ab/install
  263. $(INSTALL_DIR) $(1)/usr/bin
  264. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/ab $(1)/usr/bin
  265. endef
  266. define Package/apache-error/install
  267. $(INSTALL_DIR) $(1)/usr/share/apache2/error
  268. $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/error/* \
  269. $(1)/usr/share/apache2/error
  270. endef
  271. define Package/apache-icons/install
  272. $(INSTALL_DIR) $(1)/usr/share/apache2
  273. $(CP) $(PKG_INSTALL_DIR)/usr/share/apache2/icons \
  274. $(1)/usr/share/apache2
  275. endef
  276. define Package/apache-suexec/install
  277. $(INSTALL_DIR) $(1)/usr/sbin
  278. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/suexec $(1)/usr/sbin
  279. endef
  280. define Package/apache-utils/install
  281. $(INSTALL_DIR) $(1)/usr/sbin
  282. $(INSTALL_BIN) \
  283. $(PKG_INSTALL_DIR)/usr/sbin/{checkgid,envvars*,htcacheclean,rotatelogs} \
  284. $(1)/usr/sbin
  285. endef
  286. define Package/apache/Module
  287. define Package/apache-mod-$(1)
  288. $(call Package/apache/Default)
  289. TITLE:=$(2) module
  290. DEPENDS:=apache $(patsubst +%,+PACKAGE_apache-mod-$(1):%,$(4))
  291. endef
  292. define Package/apache-mod-$(1)/description
  293. $(subst \n,$(newline),$(3))
  294. endef
  295. define Package/apache-mod-$(1)/install
  296. $(foreach m,$(5),$(call Package/apache/install/mod,$$(1),$(m));)
  297. endef
  298. $$(eval $$(call BuildPackage,apache-mod-$(1)))
  299. endef
  300. $(eval $(call BuildPackage,apache))
  301. $(eval $(call BuildPackage,apache-ab))
  302. $(eval $(call BuildPackage,apache-error))
  303. $(eval $(call BuildPackage,apache-icons))
  304. $(eval $(call BuildPackage,apache-suexec))
  305. $(eval $(call BuildPackage,apache-utils))
  306. $(eval $(call Package/apache/Module,deflate,Deflate,Deflate support for the Apache HTTP server.,+zlib,deflate))
  307. $(eval $(call Package/apache/Module,http2,HTTP2,HTTP/2 transport layer for the Apache HTTP Server.,+libnghttp2 +libopenssl,http2))
  308. $(eval $(call Package/apache/Module,ldap,LDAP,LDAP authentication/authorization module for the Apache HTTP Server.,+libaprutil-ldap,authnz_ldap ldap))
  309. $(eval $(call Package/apache/Module,lua,Lua,Lua support for the Apache HTTP server.,+liblua,lua))
  310. $(eval $(call Package/apache/Module,md,Managed Domain handling,Managed Domain handling.,+libcurl +jansson +libopenssl,md))
  311. $(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))
  312. $(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))
  313. $(eval $(call Package/apache/Module,session-crypto,Session crypto,Session encryption support for the Apache HTTP Server.,+libaprutil-crypto-openssl,session_crypto))
  314. $(eval $(call Package/apache/Module,ssl,SSL/TLS,SSL/TLS module for the Apache HTTP Server.,+libopenssl,ssl))
  315. $(eval $(call Package/apache/Module,suexec,suEXEC,suEXEC module for the Apache HTTP Server.,+apache-suexec,suexec))
  316. $(eval $(call Package/apache/Module,webdav,WebDAV,WebDAV support for the Apache HTTP Server.,,dav dav_fs dav_lock))