moved readline to libreadline to represent the package name correctly
[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 PKG_MD5SUM:=d050a49bd7532ec21c6bb593b3473a5d
19 PKG_CAT:=zcat
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 DEPENDS:=+apr +apr-util +zlib +libexpat +libpcre +libopenssl +libsqlite3
30 TITLE:=The Apache Web Server
31 URL:=http://httpd.apache.org/
32 SUBMENU:=apache
33 endef
34
35 define Package/apache-server
36 $(call Package/apache/Default)
37 TITLE:=The apache server & and some tools
38 DESCRIPTION:=\
39 Take care that you don't include apache at the moment into your image\\\
40 please select it only as module because busybox will override\\\
41 /usr/sbin/httpd. It'll be solved soon. If you need to include this\\\
42 package in the image anyway, remove httpd from busybox\\\
43 (Base system --> Configuration --> Networking Utilities --> httpd).\\\
44 Also you should take care for the initscripts, apache's httpd isn't\\\
45 compatible with the one from busybox, so if you want to use apache\\\
46 for running your webif, you'll need to change the parameters in the\\\
47 scripts and configure the rest in /etc/httpd.conf.
48 endef
49
50 define Package/apache-server/conffiles
51 /etc/apache/httpd.conf
52 /etc/apache/extra/httpd-autoindex.conf
53 /etc/apache/extra/httpd-dav.conf
54 /etc/apache/extra/httpd-default.conf
55 /etc/apache/extra/httpd-info.conf
56 /etc/apache/extra/httpd-languages.conf
57 /etc/apache/extra/httpd-manual.conf
58 /etc/apache/extra/httpd-mpm.conf
59 /etc/apache/extra/httpd-multilang-errordoc.conf
60 /etc/apache/extra/httpd-ssl.conf
61 /etc/apache/extra/httpd-userdir.conf
62 /etc/apache/extra/httpd-vhosts.conf
63 /etc/apache/magic
64 /etc/apache/mime.types
65 endef
66
67 define Package/apache-icons
68 $(call Package/apache/Default)
69 TITLE:=Icons from Apache
70 DEPENDS:=
71 endef
72
73 define Build/Configure
74 $(call Build/Configure/Default, \
75 --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
76 --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
77 --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
78 --enable-http \
79 --enable-ssl \
80 --enable-proxy \
81 --disable-disk-cache \
82 --enable-maintainer-mode \
83 --enable-mime-magic \
84 --without-suexec-bin \
85 --sysconfdir=/etc/apache \
86 ap_void_ptr_lt_long=no \
87 logfiledir="/var/log" \
88 )
89 endef
90
91 define Build/Compile
92 $(MAKE) -C $(PKG_BUILD_DIR) \
93 DESTDIR="$(PKG_INSTALL_DIR)" \
94 all install
95 endef
96
97 define Build/InstallDev
98 rm -rf $(PKG_INSTALL_DIR)/usr/man/ \
99 $(PKG_INSTALL_DIR)/usr/share/manual/
100 # if you need docs take a look into the build-dir :)
101 mkdir -p $(STAGING_DIR)/etc
102 $(CP) $(PKG_INSTALL_DIR)/etc/* \
103 $(STAGING_DIR)/etc
104 mkdir -p $(STAGING_DIR)/usr/include
105 $(CP) $(PKG_INSTALL_DIR)/usr/include/* \
106 $(STAGING_DIR)/usr/include
107 mkdir -p $(STAGING_DIR)/usr/lib
108 $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \
109 $(STAGING_DIR)/usr/lib
110 mkdir -p $(STAGING_DIR)/usr/sbin
111 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \
112 $(STAGING_DIR)/usr/sbin
113 mkdir -p $(STAGING_DIR)/usr/share
114 $(CP) $(PKG_INSTALL_DIR)/usr/share/* \
115 $(STAGING_DIR)/usr/share
116 endef
117
118 define Build/UninstallDev
119 rm -rf $(STAGING_DIR)/usr/include/{ap_*,http*,mod_*,mpm*,os.h,scoreboard.h,unixd.h,util_*} \
120 $(STAGING_DIR)/etc/{httpd.conf,magic,mime.types,extra,original} \
121 $(STAGING_DIR)/usr/sbin/{ab,apachectl,apxs,checkgid,dbmmanage,envvars,envvars-std,htcacheclean,htdbm,htdigest,htpasswd,httpd,httxt2dbm,logresolve,rotatelogs} \
122 $(STAGING_DIR)/usr/share/{error,icons,htdocs,cgi-bin,build} \
123 $(STAGING_DIR)/usr/lib/httpd.exp
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 $(CP) $(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-server))
158 $(eval $(call BuildPackage,apache-icons))