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.

173 lines
5.3 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.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:=@APACHE/httpd/
  16. PKG_HASH:=71fcc128238a690515bd8174d5330a5309161ef314a326ae45c7c15ed139c13a
  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 +zlib
  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. TARGET_LDFLAGS += -lpthread
  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. --with-crypto \
  87. --with-sqlit3="$(STAGING_DIR)/usr" \
  88. --with-openssl="$(STAGING_DIR)/usr" \
  89. --enable-ssl \
  90. --enable-proxy \
  91. --disable-disk-cache \
  92. --enable-maintainer-mode \
  93. --with-mpm=prefork \
  94. --with-mpm=worker \
  95. --enable-mime-magic \
  96. --without-suexec-bin \
  97. --sysconfdir=/etc/apache \
  98. ap_cv_void_ptr_lt_long=no \
  99. logfiledir="/var/log" \
  100. runtimedir="/var/run" \
  101. EXTRA_LIBS="-ldl -lpthread -lcrypto -lrt -lssl" \
  102. )
  103. endef
  104. define Build/InstallDev
  105. rm -rf $(PKG_INSTALL_DIR)/usr/man/ \
  106. $(PKG_INSTALL_DIR)/usr/share/manual/
  107. # if you need docs take a look into the build-dir :)
  108. $(INSTALL_DIR) $(1)/etc
  109. $(CP) $(PKG_INSTALL_DIR)/etc/* \
  110. $(1)/etc
  111. $(INSTALL_DIR) $(1)/usr/include/apache
  112. $(CP) $(PKG_INSTALL_DIR)/usr/include/* \
  113. $(1)/usr/include/apache
  114. $(INSTALL_DIR) $(1)/usr/lib
  115. $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \
  116. $(1)/usr/lib
  117. $(INSTALL_DIR) $(1)/usr/sbin
  118. $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \
  119. $(1)/usr/sbin
  120. $(INSTALL_DIR) $(1)/usr/share
  121. $(CP) $(PKG_INSTALL_DIR)/usr/share/* \
  122. $(1)/usr/share
  123. endef
  124. define Package/apache/preinst
  125. rm /usr/sbin/httpd
  126. echo -e "You should take a look in the initscripts, busybox's httpd \n\
  127. uses some parameters which are maybe unsupported by apache."
  128. endef
  129. define Package/apache/install
  130. $(INSTALL_DIR) $(1)/usr/sbin
  131. # we don't need apxs on the router, it's just for building apache modules.
  132. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{ab,dbmmanage,htdbm,htdigest,htpasswd,httxt2dbm,logresolve} $(1)/usr/sbin/
  133. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{apachectl,checkgid,envvars,envvars-std,htcacheclean,httpd,rotatelogs} $(1)/usr/sbin/
  134. $(INSTALL_DIR) $(1)/usr/lib
  135. $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/
  136. $(INSTALL_DIR) $(1)/usr/share
  137. $(CP) $(PKG_INSTALL_DIR)/usr/share/{error,htdocs,cgi-bin,build} $(1)/usr/share/
  138. $(INSTALL_DIR) $(1)/etc/apache
  139. $(CP) $(PKG_INSTALL_DIR)/etc/apache/{httpd.conf,magic,mime.types,extra} $(1)/etc/apache/
  140. endef
  141. define Package/apache/postrm
  142. rm -rf /usr/sbin/httpd
  143. ln -s /bin/busybox /usr/sbin/httpd
  144. echo -e "You may need to change your initscripts back for the use \n\
  145. with busybox's httpd."
  146. endef
  147. define Package/apache-icons/install
  148. $(INSTALL_DIR) $(1)/usr/share
  149. $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/
  150. endef
  151. $(eval $(call BuildPackage,apache))
  152. $(eval $(call BuildPackage,apache-icons))