d8e8fb2827b4cf349915e77c01f5f9e8e4faa6f1
[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
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=apache
11 PKG_VERSION:=2.2.9
12 PKG_RELEASE:=1
13 PKG_SOURCE_NAME:=httpd
14
15 PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.bz2
16 PKG_SOURCE_URL:=http://ftp.uni-erlangen.de/pub/mirrors/apache/httpd/ \
17 http://apache.imsam.info/httpd/
18 PKG_MD5SUM:=3afa8137dc1999be695a20b62fdf032b
19
20 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/apache/Default
25 SECTION:=net
26 CATEGORY:=Network
27 SUBMENU:=Web
28 TITLE:=The Apache Web Server
29 URL:=http://httpd.apache.org/
30 endef
31
32 define Package/apache
33 $(call Package/apache/Default)
34 MENU=1
35 DEPENDS:=+libapr +libaprutil +zlib +libexpat +libpcre +libopenssl +libsqlite3
36 endef
37
38 define Package/apache/description
39 The Apache Web Server is a powerful and flexible HTTP/1.1 compliant
40 web server. Originally designed as a replacement for the NCSA HTTP
41 Server, it has grown to be the most popular web server on the Internet.
42 endef
43
44 define Package/apache-server
45 $(call Package/apache/Default)
46 TITLE:=The Apache Web Server and some tools
47 DEPENDS:=apache
48 endef
49
50 define Package/apache-server/description
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-server/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/description)
87 This package contains the icons from Apache.
88 endef
89
90 define Build/Configure
91 $(call Build/Configure/Default, \
92 --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
93 --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
94 --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
95 --enable-http \
96 --enable-ssl \
97 --enable-proxy \
98 --disable-disk-cache \
99 --enable-maintainer-mode \
100 --enable-mime-magic \
101 --without-suexec-bin \
102 --sysconfdir=/etc/apache \
103 ap_void_ptr_lt_long=no \
104 logfiledir="/var/log" \
105 )
106 endef
107
108 define Build/Compile
109 $(MAKE) -C $(PKG_BUILD_DIR) \
110 DESTDIR="$(PKG_INSTALL_DIR)" \
111 all install
112 endef
113
114 define Build/InstallDev
115 rm -rf $(PKG_INSTALL_DIR)/usr/man/ \
116 $(PKG_INSTALL_DIR)/usr/share/manual/
117 # if you need docs take a look into the build-dir :)
118 mkdir -p $(1)/etc
119 $(CP) $(PKG_INSTALL_DIR)/etc/* \
120 $(1)/etc
121 mkdir -p $(1)/usr/include/apache
122 $(CP) $(PKG_INSTALL_DIR)/usr/include/* \
123 $(1)/usr/include/apache
124 mkdir -p $(1)/usr/lib
125 $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \
126 $(1)/usr/lib
127 mkdir -p $(1)/usr/sbin
128 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \
129 $(1)/usr/sbin
130 mkdir -p $(1)/usr/share
131 $(CP) $(PKG_INSTALL_DIR)/usr/share/* \
132 $(1)/usr/share
133 endef
134
135 define Package/apache-server/preinst
136 rm /usr/sbin/httpd
137 echo -e "You should take a look in the initscripts, busybox's httpd \n\
138 uses some parameters which are maybe unsupported by apache."
139 endef
140
141 define Package/apache-server/install
142 $(INSTALL_DIR) $(1)/usr/sbin
143 # we don't need apxs on the router, it's just for building apache modules.
144 $(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/
145 $(INSTALL_DIR) $(1)/usr/lib
146 $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/
147 $(INSTALL_DIR) $(1)/usr/share
148 $(CP) $(PKG_INSTALL_DIR)/usr/share/{error,htdocs,cgi-bin,build} $(1)/usr/share/
149 $(INSTALL_DIR) $(1)/etc/apache
150 $(CP) $(PKG_INSTALL_DIR)/etc/apache/{magic,mime.types,extra} $(1)/etc/apache/
151 $(CP) ./files/etc/apache/httpd.conf $(1)/etc/apache/
152 endef
153
154 define Package/apache-server/postrm
155 rm -rf /usr/sbin/httpd
156 ln -s /bin/busybox /usr/sbin/httpd
157 echo -e "You may need to change your initscripts back for the use \n\
158 with busybox's httpd."
159 endef
160
161 define Package/apache-icons/install
162 $(INSTALL_DIR) $(1)/usr/share
163 $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/
164 endef
165
166 $(eval $(call BuildPackage,apache))
167 $(eval $(call BuildPackage,apache-server))
168 $(eval $(call BuildPackage,apache-icons))