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.

189 lines
5.6 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.28
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_NAME:=httpd
  12. PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
  13. PKG_LICENSE:=Apache License
  14. PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2
  15. PKG_SOURCE_URL:=@APACHE/httpd/
  16. PKG_HASH:=c1197a3a62a4ab5c584ab89b249af38cf28b4adee9c0106b62999fd29f920666
  17. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
  18. PKG_INSTALL:=1
  19. PKG_CONFIG_DEPENDS := \
  20. CONFIG_APACHE_HTTP2
  21. ADDITIONAL_MODULES:=
  22. ifeq ($(CONFIG_APACHE_HTTP2),y)
  23. ADDITIONAL_MODULES += --enable-http2
  24. endif
  25. ifneq ($(CONFIG_APACHE_HTTP2),y)
  26. ADDITIONAL_MODULES += --enable-http2=no
  27. endif
  28. include $(INCLUDE_DIR)/package.mk
  29. define Package/apache/Default
  30. SECTION:=net
  31. CATEGORY:=Network
  32. SUBMENU:=Web Servers/Proxies
  33. TITLE:=The Apache Web Server
  34. URL:=http://httpd.apache.org/
  35. endef
  36. define Package/apache/Default/description
  37. The Apache Web Server is a powerful and flexible HTTP/1.1 compliant
  38. web server. Originally designed as a replacement for the NCSA HTTP
  39. Server, it has grown to be the most popular web server on the Internet.
  40. endef
  41. define Package/apache/config
  42. source "$(SOURCE)/Config.in"
  43. endef
  44. define Package/apache
  45. $(call Package/apache/Default)
  46. DEPENDS:=+libapr +libaprutil +libpcre +libopenssl +unixodbc +zlib +APACHE_HTTP2:libnghttp2
  47. endef
  48. define Package/apache/description
  49. $(call Package/apache/Default/description)
  50. .
  51. This package contains the Apache web server and utility programs.
  52. .
  53. Take care that you don't include apache at the moment into your image
  54. please select it only as module because busybox will override
  55. /usr/sbin/httpd. It'll be solved soon. If you need to include this
  56. package in the image anyway, remove httpd from busybox
  57. (Base system --> Configuration --> Networking Utilities --> httpd).
  58. Also you should take care for the initscripts, apache's httpd isn't
  59. compatible with the one from busybox, so if you want to use apache
  60. for running your webif, you'll need to change the parameters in the
  61. scripts and configure the rest in /etc/httpd.conf.
  62. endef
  63. define Package/apache/conffiles
  64. /etc/apache/httpd.conf
  65. /etc/apache/extra/httpd-autoindex.conf
  66. /etc/apache/extra/httpd-dav.conf
  67. /etc/apache/extra/httpd-default.conf
  68. /etc/apache/extra/httpd-info.conf
  69. /etc/apache/extra/httpd-languages.conf
  70. /etc/apache/extra/httpd-manual.conf
  71. /etc/apache/extra/httpd-mpm.conf
  72. /etc/apache/extra/httpd-multilang-errordoc.conf
  73. /etc/apache/extra/httpd-ssl.conf
  74. /etc/apache/extra/httpd-userdir.conf
  75. /etc/apache/extra/httpd-vhosts.conf
  76. /etc/apache/magic
  77. /etc/apache/mime.types
  78. endef
  79. define Package/apache-icons
  80. $(call Package/apache/Default)
  81. TITLE:=Icons from Apache
  82. DEPENDS:=apache
  83. endef
  84. define Package/apache-icons/description
  85. $(call Package/apache/Default/description)
  86. .
  87. This package contains the icons from Apache.
  88. endef
  89. TARGET_CFLAGS += $(FPIC)
  90. TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
  91. TARGET_LDFLAGS += -lpthread
  92. define Build/Configure
  93. $(call Build/Configure/Default, \
  94. --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
  95. --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
  96. --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
  97. $(ADDITIONAL_MODULES) \
  98. --enable-http \
  99. --with-crypto \
  100. --with-sqlit3="$(STAGING_DIR)/usr" \
  101. --with-openssl="$(STAGING_DIR)/usr" \
  102. --enable-ssl \
  103. --enable-proxy \
  104. --disable-disk-cache \
  105. --enable-maintainer-mode \
  106. --with-mpm=prefork \
  107. --with-mpm=worker \
  108. --enable-mime-magic \
  109. --without-suexec-bin \
  110. --sysconfdir=/etc/apache \
  111. ap_cv_void_ptr_lt_long=no \
  112. logfiledir="/var/log" \
  113. runtimedir="/var/run" \
  114. EXTRA_LIBS="-ldl -lpthread -lcrypto -lrt -lssl" \
  115. )
  116. endef
  117. define Build/InstallDev
  118. rm -rf $(PKG_INSTALL_DIR)/usr/man/ \
  119. $(PKG_INSTALL_DIR)/usr/share/manual/
  120. # if you need docs take a look into the build-dir :)
  121. $(INSTALL_DIR) $(1)/etc
  122. $(CP) $(PKG_INSTALL_DIR)/etc/* \
  123. $(1)/etc
  124. $(INSTALL_DIR) $(1)/usr/include/apache
  125. $(CP) $(PKG_INSTALL_DIR)/usr/include/* \
  126. $(1)/usr/include/apache
  127. $(INSTALL_DIR) $(1)/usr/lib
  128. $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \
  129. $(1)/usr/lib
  130. $(INSTALL_DIR) $(1)/usr/sbin
  131. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \
  132. $(1)/usr/sbin
  133. $(INSTALL_DIR) $(1)/usr/share
  134. $(CP) $(PKG_INSTALL_DIR)/usr/share/* \
  135. $(1)/usr/share
  136. endef
  137. define Package/apache/preinst
  138. rm /usr/sbin/httpd
  139. echo -e "You should take a look in the initscripts, busybox's httpd \n\
  140. uses some parameters which are maybe unsupported by apache."
  141. endef
  142. define Package/apache/install
  143. $(INSTALL_DIR) $(1)/usr/sbin
  144. # we don't need apxs on the router, it's just for building apache modules.
  145. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{ab,dbmmanage,htdbm,htdigest,htpasswd,httxt2dbm,logresolve} $(1)/usr/sbin/
  146. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{apachectl,checkgid,envvars,envvars-std,htcacheclean,httpd,rotatelogs} $(1)/usr/sbin/
  147. $(INSTALL_DIR) $(1)/usr/lib
  148. $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/
  149. $(INSTALL_DIR) $(1)/usr/share
  150. $(CP) $(PKG_INSTALL_DIR)/usr/share/{error,htdocs,cgi-bin,build} $(1)/usr/share/
  151. $(INSTALL_DIR) $(1)/etc/apache
  152. $(CP) $(PKG_INSTALL_DIR)/etc/apache/{httpd.conf,magic,mime.types,extra} $(1)/etc/apache/
  153. endef
  154. define Package/apache/postrm
  155. rm -rf /usr/sbin/httpd
  156. ln -s /bin/busybox /usr/sbin/httpd
  157. echo -e "You may need to change your initscripts back for the use \n\
  158. with busybox's httpd."
  159. endef
  160. define Package/apache-icons/install
  161. $(INSTALL_DIR) $(1)/usr/share
  162. $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/
  163. endef
  164. $(eval $(call BuildPackage,apache))
  165. $(eval $(call BuildPackage,apache-icons))