DESCRIPTION:= is obselete
[packages.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 PKG_CAT:=zcat
21
22 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
23 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
24
25 include $(INCLUDE_DIR)/package.mk
26
27 define Package/apache/Default
28   SECTION:=net
29   CATEGORY:=Network
30   SUBMENU:=Web
31   TITLE:=The Apache Web Server
32   URL:=http://httpd.apache.org/
33 endef
34
35 define Package/apache
36   $(call Package/apache/Default)
37   MENU=1
38   DEPENDS:=+libapr +libaprutil +zlib +libexpat +libpcre +libopenssl +libsqlite3
39 endef
40
41 define Package/apache-server
42   $(call Package/apache/Default)
43   TITLE:=The apache server & and some tools
44   DEPENDS:=apache
45 endef
46
47 define Package/apache-server/description
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-server/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 Build/Configure  
83         $(call Build/Configure/Default, \
84                 --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
85                 --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
86                 --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
87                 --enable-http \
88                 --enable-ssl \
89                 --enable-proxy \
90                 --disable-disk-cache \
91                 --enable-maintainer-mode \
92                 --enable-mime-magic \
93                 --without-suexec-bin \
94                 --sysconfdir=/etc/apache \
95                 ap_void_ptr_lt_long=no \
96                 logfiledir="/var/log" \
97         )
98 endef
99
100 define Build/Compile    
101         $(MAKE) -C $(PKG_BUILD_DIR) \
102                 DESTDIR="$(PKG_INSTALL_DIR)" \
103                 all install
104 endef
105
106 define Build/InstallDev
107         rm -rf  $(PKG_INSTALL_DIR)/usr/man/ \
108                 $(PKG_INSTALL_DIR)/usr/share/manual/
109         # if you need docs take a look into the build-dir :)
110         mkdir -p $(1)/etc
111         $(CP)   $(PKG_INSTALL_DIR)/etc/* \
112                 $(1)/etc
113         mkdir -p $(1)/usr/include
114         $(CP)   $(PKG_INSTALL_DIR)/usr/include/* \
115                 $(1)/usr/include
116         mkdir -p $(1)/usr/lib
117         $(CP)   $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \
118                 $(1)/usr/lib
119         mkdir -p $(1)/usr/sbin
120         $(CP)   $(PKG_INSTALL_DIR)/usr/sbin/* \
121                 $(1)/usr/sbin
122         mkdir -p $(1)/usr/share
123         $(CP)   $(PKG_INSTALL_DIR)/usr/share/* \
124                 $(1)/usr/share
125 endef
126
127 define Build/UninstallDev
128         rm -rf  $(STAGING_DIR)/usr/include/{ap_*,http*,mod_*,mpm*,os.h,scoreboard.h,unixd.h,util_*} \
129                 $(STAGING_DIR)/etc/{httpd.conf,magic,mime.types,extra,original} \
130                 $(STAGING_DIR)/usr/sbin/{ab,apachectl,apxs,checkgid,dbmmanage,envvars,envvars-std,htcacheclean,htdbm,htdigest,htpasswd,httpd,httxt2dbm,logresolve,rotatelogs} \
131                 $(STAGING_DIR)/usr/share/{error,icons,htdocs,cgi-bin,build} \
132                 $(STAGING_DIR)/usr/lib/httpd.exp
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         $(CP) $(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))