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.

166 lines
5.0 KiB

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