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