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