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.

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