bea09a694eb6299a1f5ac8cfec926828473acafe
[openwrt/svn-archive/archive.git] / net / apache / Makefile
1 #
2 # Copyright (C) 2007-2008 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7 # $Id$
8
9 include $(TOPDIR)/rules.mk
10
11 PKG_NAME:=apache
12 PKG_VERSION:=2.2.9
13 PKG_RELEASE:=1
14 PKG_SOURCE_NAME:=httpd
15
16 PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=http://ftp.uni-erlangen.de/pub/mirrors/apache/httpd/ \
18 http://apache.imsam.info/httpd/
19 PKG_MD5SUM:=3afa8137dc1999be695a20b62fdf032b
20
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
22
23 include $(INCLUDE_DIR)/package.mk
24
25 define Package/apache/Default
26 SECTION:=net
27 CATEGORY:=Network
28 SUBMENU:=Web
29 TITLE:=The Apache Web Server
30 URL:=http://httpd.apache.org/
31 endef
32
33 define Package/apache
34 $(call Package/apache/Default)
35 MENU=1
36 DEPENDS:=+libapr +libaprutil +zlib +libexpat +libpcre +libopenssl +libsqlite3
37 endef
38
39 define Package/apache/description
40 The Apache Web Server is a powerful and flexible HTTP/1.1 compliant
41 web server. Originally designed as a replacement for the NCSA HTTP
42 Server, it has grown to be the most popular web server on the Internet.
43 endef
44
45 define Package/apache-server
46 $(call Package/apache/Default)
47 TITLE:=The Apache Web Server and some tools
48 DEPENDS:=apache
49 endef
50
51 define Package/apache-server/description
52 Take care that you don't include apache at the moment into your image
53 please select it only as module because busybox will override
54 /usr/sbin/httpd. It'll be solved soon. If you need to include this
55 package in the image anyway, remove httpd from busybox
56 (Base system --> Configuration --> Networking Utilities --> httpd).
57 Also you should take care for the initscripts, apache's httpd isn't
58 compatible with the one from busybox, so if you want to use apache
59 for running your webif, you'll need to change the parameters in the
60 scripts and configure the rest in /etc/httpd.conf.
61 endef
62
63 define Package/apache-server/conffiles
64 /etc/apache/httpd.conf
65 /etc/apache/extra/httpd-autoindex.conf
66 /etc/apache/extra/httpd-dav.conf
67 /etc/apache/extra/httpd-default.conf
68 /etc/apache/extra/httpd-info.conf
69 /etc/apache/extra/httpd-languages.conf
70 /etc/apache/extra/httpd-manual.conf
71 /etc/apache/extra/httpd-mpm.conf
72 /etc/apache/extra/httpd-multilang-errordoc.conf
73 /etc/apache/extra/httpd-ssl.conf
74 /etc/apache/extra/httpd-userdir.conf
75 /etc/apache/extra/httpd-vhosts.conf
76 /etc/apache/magic
77 /etc/apache/mime.types
78 endef
79
80 define Package/apache-icons
81 $(call Package/apache/Default)
82 TITLE:=Icons from Apache
83 DEPENDS:=apache
84 endef
85
86 define Package/apache-icons/description
87 $(call Package/apache/description)
88 This package contains the icons from Apache.
89 endef
90
91 define Build/Configure
92 $(call Build/Configure/Default, \
93 --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
94 --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
95 --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
96 --enable-http \
97 --enable-ssl \
98 --enable-proxy \
99 --disable-disk-cache \
100 --enable-maintainer-mode \
101 --enable-mime-magic \
102 --without-suexec-bin \
103 --sysconfdir=/etc/apache \
104 ap_void_ptr_lt_long=no \
105 logfiledir="/var/log" \
106 )
107 endef
108
109 define Build/Compile
110 $(MAKE) -C $(PKG_BUILD_DIR) \
111 DESTDIR="$(PKG_INSTALL_DIR)" \
112 all install
113 endef
114
115 define Build/InstallDev
116 rm -rf $(PKG_INSTALL_DIR)/usr/man/ \
117 $(PKG_INSTALL_DIR)/usr/share/manual/
118 # if you need docs take a look into the build-dir :)
119 mkdir -p $(1)/etc
120 $(CP) $(PKG_INSTALL_DIR)/etc/* \
121 $(1)/etc
122 mkdir -p $(1)/usr/include
123 $(CP) $(PKG_INSTALL_DIR)/usr/include/* \
124 $(1)/usr/include
125 mkdir -p $(1)/usr/lib
126 $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \
127 $(1)/usr/lib
128 mkdir -p $(1)/usr/sbin
129 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \
130 $(1)/usr/sbin
131 mkdir -p $(1)/usr/share
132 $(CP) $(PKG_INSTALL_DIR)/usr/share/* \
133 $(1)/usr/share
134 endef
135
136 define Package/apache-server/preinst
137 rm /usr/sbin/httpd
138 echo -e "You should take a look in the initscripts, busybox's httpd \n\
139 uses some parameters which are maybe unsupported by apache."
140 endef
141
142 define Package/apache-server/install
143 $(INSTALL_DIR) $(1)/usr/sbin
144 # we don't need apxs on the router, it's just for building apache modules.
145 $(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/
146 $(INSTALL_DIR) $(1)/usr/lib
147 $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/
148 $(INSTALL_DIR) $(1)/usr/share
149 $(CP) $(PKG_INSTALL_DIR)/usr/share/{error,htdocs,cgi-bin,build} $(1)/usr/share/
150 $(INSTALL_DIR) $(1)/etc/apache
151 $(CP) $(PKG_INSTALL_DIR)/etc/apache/{magic,mime.types,extra} $(1)/etc/apache/
152 $(CP) ./files/etc/apache/httpd.conf $(1)/etc/apache/
153 endef
154
155 define Package/apache-server/postrm
156 rm -rf /usr/sbin/httpd
157 ln -s /bin/busybox /usr/sbin/httpd
158 echo -e "You may need to change your initscripts back for the use \n\
159 with busybox's httpd."
160 endef
161
162 define Package/apache-icons/install
163 $(INSTALL_DIR) $(1)/usr/share
164 $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/
165 endef
166
167 $(eval $(call BuildPackage,apache))
168 $(eval $(call BuildPackage,apache-server))
169 $(eval $(call BuildPackage,apache-icons))