2 # Copyright (C) 2007-2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
13 PKG_SOURCE_NAME
:=httpd
14 PKG_MAINTAINER
:=Thomas Heil
<heil@terminal-consulting.de
>
15 PKG_LICENSE
:=Apache License
17 PKG_SOURCE
:=$(PKG_SOURCE_NAME
)-$(PKG_VERSION
).
tar.bz2
18 PKG_SOURCE_URL
:=@APACHE
/httpd
/
19 PKG_HASH
:=c1197a3a62a4ab5c584ab89b249af38cf28b4adee9c0106b62999fd29f920666
21 PKG_BUILD_DIR
:=$(BUILD_DIR
)/$(PKG_SOURCE_NAME
)-$(PKG_VERSION
)
25 PKG_CONFIG_DEPENDS
:= \
29 ifeq ($(CONFIG_APACHE_HTTP2
),y
)
30 ADDITIONAL_MODULES
+= --enable-http2
32 ifneq ($(CONFIG_APACHE_HTTP2
),y
)
33 ADDITIONAL_MODULES
+= --enable-http2
=no
36 include $(INCLUDE_DIR
)/package.mk
38 define Package
/apache
/Default
41 SUBMENU
:=Web Servers
/Proxies
42 TITLE
:=The Apache Web Server
43 URL
:=http
://httpd.apache.org
/
46 define Package
/apache
/Default
/description
47 The Apache Web Server is a powerful and flexible HTTP
/1.1 compliant
48 web server. Originally designed
as a replacement for the NCSA HTTP
49 Server
, it has grown to be the most popular web server on the Internet.
52 define Package
/apache
/config
53 source
"$(SOURCE)/Config.in"
57 $(call Package
/apache
/Default
)
58 DEPENDS
:=+libapr
+libaprutil
+libpcre
+libopenssl
+unixodbc
+zlib
+APACHE_HTTP2
:libnghttp2
61 define Package
/apache
/description
62 $(call Package
/apache
/Default
/description
)
64 This package contains the Apache web server and utility programs.
66 Take care that you don
't include apache at the moment into your image
67 please select it only as module because busybox will override
68 /usr/sbin/httpd. It'll be solved soon. If you need to
include this
69 package in the image anyway
, remove httpd from busybox
70 (Base system
--> Configuration
--> Networking Utilities
--> httpd
).
71 Also you should take care for the initscripts
, apache
's httpd isn't
72 compatible with the one from busybox
, so if you want to use apache
73 for running your webif
, you
'll need to change the parameters in the
74 scripts and configure the rest in /etc/httpd.conf.
77 define Package/apache/conffiles
78 /etc/apache/httpd.conf
79 /etc/apache/extra/httpd-autoindex.conf
80 /etc/apache/extra/httpd-dav.conf
81 /etc/apache/extra/httpd-default.conf
82 /etc/apache/extra/httpd-info.conf
83 /etc/apache/extra/httpd-languages.conf
84 /etc/apache/extra/httpd-manual.conf
85 /etc/apache/extra/httpd-mpm.conf
86 /etc/apache/extra/httpd-multilang-errordoc.conf
87 /etc/apache/extra/httpd-ssl.conf
88 /etc/apache/extra/httpd-userdir.conf
89 /etc/apache/extra/httpd-vhosts.conf
91 /etc/apache/mime.types
94 define Package/apache-icons
95 $(call Package/apache/Default)
96 TITLE:=Icons from Apache
100 define Package/apache-icons/description
101 $(call Package/apache/Default/description)
103 This package contains the icons from Apache.
106 TARGET_CFLAGS += $(FPIC)
107 TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
108 TARGET_LDFLAGS += -lpthread
110 define Build/Configure
111 $(call Build/Configure/Default, \
112 --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
113 --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
114 --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
115 $(ADDITIONAL_MODULES) \
118 --with-sqlit3="$(STAGING_DIR)/usr" \
119 --with-openssl="$(STAGING_DIR)/usr" \
122 --disable-disk-cache \
123 --enable-maintainer-mode \
126 --enable-mime-magic \
127 --without-suexec-bin \
128 --sysconfdir=/etc/apache \
129 ap_cv_void_ptr_lt_long=no \
130 logfiledir="/var/log" \
131 runtimedir="/var/run" \
132 EXTRA_LIBS="-ldl -lpthread -lcrypto -lrt -lssl" \
136 define Build/InstallDev
137 rm -rf $(PKG_INSTALL_DIR)/usr/man/ \
138 $(PKG_INSTALL_DIR)/usr/share/manual/
139 # if you need docs take a look into the build-dir :)
140 $(INSTALL_DIR) $(1)/etc
141 $(CP) $(PKG_INSTALL_DIR)/etc/* \
143 $(INSTALL_DIR) $(1)/usr/include/apache
144 $(CP) $(PKG_INSTALL_DIR)/usr/include/* \
145 $(1)/usr/include/apache
146 $(INSTALL_DIR) $(1)/usr/lib
147 $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \
149 $(INSTALL_DIR) $(1)/usr/sbin
150 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \
152 $(INSTALL_DIR) $(1)/usr/share
153 $(CP) $(PKG_INSTALL_DIR)/usr/share/* \
157 define Package/apache/preinst
159 echo -e "You should take a look in the initscripts, busybox's httpd
\n\
160 uses some parameters which are maybe unsupported by apache.
"
163 define Package/apache/install
164 $(INSTALL_DIR) $(1)/usr/sbin
165 # we don't need apxs on the router, it's just for building apache modules.
166 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/{ab,dbmmanage,htdbm,htdigest,htpasswd,httxt2dbm,logresolve} $(1)/usr/sbin/
167 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/{apachectl,checkgid,envvars,envvars-std,htcacheclean,httpd,rotatelogs} $(1)/usr/sbin/
168 $(INSTALL_DIR) $(1)/usr/lib
169 $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/
170 $(INSTALL_DIR) $(1)/usr/share
171 $(CP) $(PKG_INSTALL_DIR)/usr/share/{error,htdocs,cgi-bin,build} $(1)/usr/share/
172 $(INSTALL_DIR) $(1)/etc/apache
173 $(CP) $(PKG_INSTALL_DIR)/etc/apache/{httpd.conf,magic,mime.types,extra} $(1)/etc/apache/
176 define Package/apache/postrm
177 rm -rf /usr/sbin/httpd
178 ln -s /bin/busybox /usr/sbin/httpd
179 echo -e "You may need to change your initscripts back for the use
\n\
180 with busybox
's httpd."
183 define Package/apache-icons/install
184 $(INSTALL_DIR) $(1)/usr/share
185 $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/
188 $(eval $(call BuildPackage,apache))
189 $(eval $(call BuildPackage,apache-icons))