2 # Copyright (C) 2007 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
9 include $(TOPDIR)/rules.mk
14 PKG_SOURCE_NAME:=httpd
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
21 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
22 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
24 include $(INCLUDE_DIR)/package.mk
26 define Package/apache/Default
30 TITLE:=The Apache Web Server
31 URL:=http://httpd.apache.org/
35 $(call Package/apache/Default)
37 DEPENDS:=+libapr +libaprutil +zlib +libexpat +libpcre +libopenssl +libsqlite3
40 define Package/apache-server
41 $(call Package/apache/Default)
42 TITLE:=The apache server & and some tools
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.
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
72 /etc/apache/mime.types
75 define Package/apache-icons
76 $(call Package/apache/Default)
77 TITLE:=Icons from Apache
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)/usr/bin/pcre-config" \
89 --disable-disk-cache \
90 --enable-maintainer-mode \
92 --without-suexec-bin \
93 --sysconfdir=/etc/apache \
94 ap_void_ptr_lt_long=no \
95 logfiledir="/var/log" \
100 $(MAKE) -C $(PKG_BUILD_DIR) \
101 DESTDIR="$(PKG_INSTALL_DIR)" \
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 :)
110 $(CP) $(PKG_INSTALL_DIR)/etc/* \
112 mkdir -p $(1)/usr/include
113 $(CP) $(PKG_INSTALL_DIR)/usr/include/* \
115 mkdir -p $(1)/usr/lib
116 $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp \
118 mkdir -p $(1)/usr/sbin
119 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/* \
121 mkdir -p $(1)/usr/share
122 $(CP) $(PKG_INSTALL_DIR)/usr/share/* \
126 define Build/UninstallDev
127 rm -rf $(STAGING_DIR)/usr/include/{ap_*,http*,mod_*,mpm*,os.h,scoreboard.h,unixd.h,util_*} \
128 $(STAGING_DIR)/etc/{httpd.conf,magic,mime.types,extra,original} \
129 $(STAGING_DIR)/usr/sbin/{ab,apachectl,apxs,checkgid,dbmmanage,envvars,envvars-std,htcacheclean,htdbm,htdigest,htpasswd,httpd,httxt2dbm,logresolve,rotatelogs} \
130 $(STAGING_DIR)/usr/share/{error,icons,htdocs,cgi-bin,build} \
131 $(STAGING_DIR)/usr/lib/httpd.exp
134 define Package/apache-server/preinst
136 echo -e "You should take a look in the initscripts, busybox's httpd \n\
137 uses some parameters which are maybe unsupported by apache."
140 define Package/apache-server/install
141 $(INSTALL_DIR) $(1)/usr/sbin
142 # we don't need apxs on the router, it's just for building apache modules.
143 $(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/
144 $(INSTALL_DIR) $(1)/usr/lib
145 $(CP) $(PKG_INSTALL_DIR)/usr/lib/httpd.exp $(1)/usr/lib/
146 $(INSTALL_DIR) $(1)/usr/share
147 $(CP) $(PKG_INSTALL_DIR)/usr/share/{error,htdocs,cgi-bin,build} $(1)/usr/share/
148 $(INSTALL_DIR) $(1)/etc/apache
149 $(CP) $(PKG_INSTALL_DIR)/etc/apache/{magic,mime.types,extra} $(1)/etc/apache/
150 $(CP) ./files/etc/apache/httpd.conf $(1)/etc/apache/
153 define Package/apache-server/postrm
154 rm -rf /usr/sbin/httpd
155 ln -s /bin/busybox /usr/sbin/httpd
156 echo -e "You may need to change your initscripts back for the use \n\
157 with busybox's httpd."
160 define Package/apache-icons/install
161 $(INSTALL_DIR) $(1)/usr/share
162 $(CP) $(PKG_INSTALL_DIR)/usr/share/icons $(1)/usr/share/
165 $(eval $(call BuildPackage,apache))
166 $(eval $(call BuildPackage,apache-server))
167 $(eval $(call BuildPackage,apache-icons))