Upgrade to 0.12.1 (#2186)
[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.4
13 PKG_RELEASE:=1
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:=3add41e0b924d4bb53c2dee55a38c09e
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-icons
51 $(call Package/apache/Default)
52 TITLE:=Icons from Apache
53 DEPENDS:=
54 endef
55
56 define Build/Configure
57 $(call Build/Configure/Default, \
58 --with-apr="$(STAGING_DIR)/usr/bin/apr-1-config" \
59 --with-apr-util="$(STAGING_DIR)/usr/bin/apu-1-config" \
60 --with-pcre="$(STAGING_DIR)/usr/bin/pcre-config" \
61 --enable-http \
62 --enable-ssl \
63 --disable-disk-cache \
64 --enable-maintainer-mode \
65 --enable-mime-magic \
66 --without-suexec-bin \
67 ap_void_ptr_lt_long=no \
68 logfiledir="/var/log" \
69 )
70 endef
71
72 define Build/Compile
73 $(MAKE) -C $(PKG_BUILD_DIR) \
74 DESTDIR="$(PKG_INSTALL_DIR)" \
75 all install
76 endef
77
78 define Build/InstallDev
79 rm -rf $(PKG_INSTALL_DIR)/usr/man/ \
80 $(PKG_INSTALL_DIR)/usr/share/manual/
81 # if you need docs take a look into the build-dir :)
82 mkdir -p $(STAGING_DIR)/etc
83 $(CP) $(PKG_INSTALL_DIR)/etc/* \
84 $(STAGING_DIR)/etc
85 mkdir -p $(STAGING_DIR)/usr/include
86 $(CP) $(PKG_INSTALL_DIR)/usr/include/* \
87 $(STAGING_DIR)/usr/include
88 mkdir -p $(STAGING_DIR)/usr/lib
89 $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \
90 $(STAGING_DIR)/usr/lib
91 mkdir -p $(STAGING_DIR)/usr/sbin
92 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \
93 $(STAGING_DIR)/usr/sbin
94 mkdir -p $(STAGING_DIR)/usr/share
95 $(CP) $(PKG_INSTALL_DIR)/usr/share/* \
96 $(STAGING_DIR)/usr/share
97 endef
98
99 define Build/UninstallDev
100 rm -rf $(STAGING_DIR)/usr/include/{ap_*,http*,mod_*,mpm*,os.h,scoreboard.h,unixd.h,util_*} \
101 $(STAGING_DIR)/etc/{httpd.conf,magic,mime.types,extra,original} \
102 $(STAGING_DIR)/usr/sbin/{ab,apachectl,apxs,checkgid,dbmmanage,envvars,envvars-std,htcacheclean,htdbm,htdigest,htpasswd,httpd,httxt2dbm,logresolve,rotatelogs} \
103 $(STAGING_DIR)/usr/share/{error,icons,htdocs,cgi-bin,build} \
104 $(STAGING_DIR)/usr/lib/httpd.exp
105 endef
106
107 define Package/apache-server/preinst
108 rm /usr/sbin/httpd
109 echo -e "You should take a look in the initscripts, busybox's httpd \n\
110 uses some parameters which are maybe unsupported by apache."
111 endef
112
113 define Package/apache-server/install
114 $(INSTALL_DIR) $(1)/usr/sbin
115 # we don't need apxs on the router, it's just for building apache modules.
116 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/{ab,apachectl,checkgid,dbmmanage,envvars,envvars-std,htcacheclean,htdbm,htdigest,htpasswd,httpd,httxt2dbm,logresolve,rotatelogs} $(1)/usr/sbin/
117 $(INSTALL_DIR) $(1)/usr/lib
118 $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/
119 $(INSTALL_DIR) $(1)/usr/share
120 $(CP) $(PKG_INSTALL_DIR)/usr/share/{error,htdocs,cgi-bin,build} $(1)/usr/share/
121 $(INSTALL_DIR) $(1)/etc
122 $(CP) $(PKG_INSTALL_DIR)/etc/{magic,mime.types,extra} $(1)/etc/
123 $(CP) ./files/etc/httpd.conf $(1)/etc/
124 endef
125
126 define Package/apache-server/postrm
127 rm -rf /usr/sbin/httpd
128 ln -s /bin/busybox /usr/sbin/httpd
129 echo -e "You may need to change your initscripts back for the use \n\
130 with busybox's httpd."
131 endef
132
133 define Package/apache-icons/install
134 $(INSTALL_DIR) $(1)/usr/share
135 $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/
136 endef
137
138 $(eval $(call BuildPackage,apache-server))
139 $(eval $(call BuildPackage,apache-icons))