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