apache: update to 2.4.28
[feed/packages.git] / net / apache / Makefile
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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=apache
11 PKG_VERSION:=2.4.28
12 PKG_RELEASE:=1
13 PKG_SOURCE_NAME:=httpd
14 PKG_MAINTAINER:=Thomas Heil <heil@terminal-consulting.de>
15 PKG_LICENSE:=Apache License
16
17 PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2
18 PKG_SOURCE_URL:=@APACHE/httpd/
19 PKG_HASH:=c1197a3a62a4ab5c584ab89b249af38cf28b4adee9c0106b62999fd29f920666
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
22
23 PKG_INSTALL:=1
24
25 PKG_CONFIG_DEPENDS := \
26 CONFIG_APACHE_HTTP2
27
28 ADDITIONAL_MODULES:=
29 ifeq ($(CONFIG_APACHE_HTTP2),y)
30 ADDITIONAL_MODULES += --enable-http2
31 endif
32 ifneq ($(CONFIG_APACHE_HTTP2),y)
33 ADDITIONAL_MODULES += --enable-http2=no
34 endif
35
36 include $(INCLUDE_DIR)/package.mk
37
38 define Package/apache/Default
39 SECTION:=net
40 CATEGORY:=Network
41 SUBMENU:=Web Servers/Proxies
42 TITLE:=The Apache Web Server
43 URL:=http://httpd.apache.org/
44 endef
45
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.
50 endef
51
52 define Package/apache/config
53 source "$(SOURCE)/Config.in"
54 endef
55
56 define Package/apache
57 $(call Package/apache/Default)
58 DEPENDS:=+libapr +libaprutil +libpcre +libopenssl +unixodbc +zlib +APACHE_HTTP2:libnghttp2
59 endef
60
61 define Package/apache/description
62 $(call Package/apache/Default/description)
63 .
64 This package contains the Apache web server and utility programs.
65 .
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.
75 endef
76
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
90 /etc/apache/magic
91 /etc/apache/mime.types
92 endef
93
94 define Package/apache-icons
95 $(call Package/apache/Default)
96 TITLE:=Icons from Apache
97 DEPENDS:=apache
98 endef
99
100 define Package/apache-icons/description
101 $(call Package/apache/Default/description)
102 .
103 This package contains the icons from Apache.
104 endef
105
106 TARGET_CFLAGS += $(FPIC)
107 TARGET_CPPFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -D_GNU_SOURCE
108 TARGET_LDFLAGS += -lpthread
109
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) \
116 --enable-http \
117 --with-crypto \
118 --with-sqlit3="$(STAGING_DIR)/usr" \
119 --with-openssl="$(STAGING_DIR)/usr" \
120 --enable-ssl \
121 --enable-proxy \
122 --disable-disk-cache \
123 --enable-maintainer-mode \
124 --with-mpm=prefork \
125 --with-mpm=worker \
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" \
133 )
134 endef
135
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/* \
142 $(1)/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 \
148 $(1)/usr/lib
149 $(INSTALL_DIR) $(1)/usr/sbin
150 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \
151 $(1)/usr/sbin
152 $(INSTALL_DIR) $(1)/usr/share
153 $(CP) $(PKG_INSTALL_DIR)/usr/share/* \
154 $(1)/usr/share
155 endef
156
157 define Package/apache/preinst
158 rm /usr/sbin/httpd
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."
161 endef
162
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/
174 endef
175
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."
181 endef
182
183 define Package/apache-icons/install
184 $(INSTALL_DIR) $(1)/usr/share
185 $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/
186 endef
187
188 $(eval $(call BuildPackage,apache))
189 $(eval $(call BuildPackage,apache-icons))