688a955f2997a82d5a4185fda9b8fabe266ef13d
[openwrt/svn-archive/archive.git] / net / lighttpd / Makefile
1 #
2 # Copyright (C) 2006 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:=lighttpd
12 PKG_VERSION:=1.4.16
13 PKG_RELEASE:=2
14
15 PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
16 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
17 PKG_SOURCE_URL:=http://www.lighttpd.net/download/
18 PKG_MD5SUM:=ea671997591f772417b7e540d325f8cc
19
20 PKG_INSTALL_DIR:=$(PKG_BUILD_DIR)/ipkg-install
21
22 include $(INCLUDE_DIR)/package.mk
23
24 define Package/lighttpd/Default
25 SECTION:=net
26 CATEGORY:=Network
27 URL:=http://www.lighttpd.net/
28 endef
29
30 define Package/lighttpd
31 $(call Package/lighttpd/Default)
32 MENU:=1
33 SECTION:=net
34 CATEGORY:=Network
35 DEPENDS:=+libopenssl +libpcre +libpthread +libsqlite3 +libxml2
36 TITLE:=A flexible and lightweight web server
37 URL:=http://www.lighttpd.net/
38 endef
39
40 define Package/lighttpd/conffiles
41 /etc/lighttpd.conf
42 /etc/default/lighttpd
43 /etc/init.d/lighttpd
44 endef
45
46 define Package/lighttpd-mod-accesslog
47 $(call Package/lighttpd/Default)
48 DEPENDS:=lighttpd
49 TITLE:=Access logging module
50 endef
51
52 define Package/lighttpd-mod-alias
53 $(call Package/lighttpd/Default)
54 DEPENDS:=lighttpd
55 TITLE:=Directory alias module
56 endef
57
58 define Package/lighttpd-mod-auth
59 $(call Package/lighttpd/Default)
60 DEPENDS:=lighttpd
61 TITLE:=Authentication module
62 endef
63
64 define Package/lighttpd-mod-cgi
65 $(call Package/lighttpd/Default)
66 DEPENDS:=lighttpd
67 TITLE:=CGI module
68 endef
69
70 define Package/lighttpd-mod-evasive
71 $(call Package/lighttpd/Default)
72 DEPENDS:=lighttpd
73 TITLE:=Evasive module
74 endef
75
76 define Package/lighttpd-mod-expire
77 $(call Package/lighttpd/Default)
78 DEPENDS:=lighttpd
79 TITLE:=Expire module
80 endef
81
82 define Package/lighttpd-mod-fastcgi
83 $(call Package/lighttpd/Default)
84 DEPENDS:=lighttpd
85 TITLE:=FastCGI module
86 endef
87
88 define Package/lighttpd-mod-proxy
89 $(call Package/lighttpd/Default)
90 DEPENDS:=lighttpd
91 TITLE:=Proxy module
92 endef
93
94 define Package/lighttpd-mod-redirect
95 $(call Package/lighttpd/Default)
96 DEPENDS:=lighttpd
97 TITLE:=URL redirection module
98 endef
99
100 define Package/lighttpd-mod-rewrite
101 $(call Package/lighttpd/Default)
102 DEPENDS:=lighttpd
103 TITLE:=URL rewriting module
104 endef
105
106 define Package/lighttpd-mod-setenv
107 $(call Package/lighttpd/Default)
108 DEPENDS:=lighttpd
109 TITLE:=Environment variable setting module
110 endef
111
112 define Package/lighttpd-mod-simple-vhost
113 $(call Package/lighttpd/Default)
114 DEPENDS:=lighttpd
115 TITLE:=Simple virtual hosting module
116 endef
117
118 define Package/lighttpd-mod-ssi
119 $(call Package/lighttpd/Default)
120 DEPENDS:=lighttpd
121 TITLE:=SSI module
122 endef
123
124 define Package/lighttpd-mod-status
125 $(call Package/lighttpd/Default)
126 DEPENDS:=lighttpd
127 TITLE:=Server status display module
128 endef
129
130 define Package/lighttpd-mod-usertrack
131 $(call Package/lighttpd/Default)
132 DEPENDS:=lighttpd
133 TITLE:=User tracking module
134 endef
135
136 define Package/lighttpd-mod-webdav
137 $(call Package/lighttpd/Default)
138 DEPENDS:=lighttpd
139 TITLE:=WebDAV module
140 endef
141
142
143 CONFIGURE_ARGS += \
144 --libdir=/usr/lib/lighttpd \
145 --sysconfdir=/etc/lighttpd \
146 --enable-shared \
147 --enable-static \
148 --disable-rpath \
149 --without-attr \
150 --without-bzip2 \
151 --without-fam \
152 --without-gdbm \
153 --without-ldap \
154 --without-lua \
155 --without-memcache \
156 --without-mysql \
157 --with-openssl="$(STAGING_DIR)/usr" \
158 --with-pcre \
159 --without-valgrind \
160 --with-webdav-props \
161 , \
162 CPPFLAGS="-I$(STAGING_DIR)/usr/include/libxml2 $$$$CPPFLAGS" \
163 PCRE_LIB="-lpcre"
164
165 MAKE_FLAGS += \
166 DESTDIR="$(PKG_INSTALL_DIR)" \
167 all install
168
169 define Package/lighttpd/install
170 $(INSTALL_DIR) $(1)/etc
171 $(INSTALL_DATA) ./files/lighttpd.conf $(1)/etc/
172 $(INSTALL_DIR) $(1)/etc/default
173 $(INSTALL_DATA) ./files/lighttpd.default $(1)/etc/default/lighttpd
174 $(INSTALL_DIR) $(1)/etc/init.d
175 $(INSTALL_BIN) ./files/lighttpd.init $(1)/etc/init.d/lighttpd
176 $(INSTALL_DIR) $(1)/usr/lib/lighttpd
177 for m in dirlisting indexfile staticfile; do \
178 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$$$${m}.so $(1)/usr/lib/lighttpd/ ; \
179 done
180 $(INSTALL_DIR) $(1)/usr/sbin
181 $(CP) $(PKG_INSTALL_DIR)/usr/sbin/lighttpd $(1)/usr/sbin/
182 endef
183
184 define BuildPlugin
185 define Package/$(1)/install
186 [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/lighttpd
187 for m in $(2); do \
188 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$$$$$$$${m}.so $$(1)/usr/lib/lighttpd/ ; \
189 done
190 endef
191
192 $$(eval $$(call BuildPackage,$(1)))
193 endef
194
195 $(eval $(call BuildPackage,lighttpd))
196 $(eval $(call BuildPlugin,lighttpd-mod-accesslog,accesslog))
197 $(eval $(call BuildPlugin,lighttpd-mod-alias,alias))
198 $(eval $(call BuildPlugin,lighttpd-mod-auth,auth))
199 $(eval $(call BuildPlugin,lighttpd-mod-cgi,cgi))
200 $(eval $(call BuildPlugin,lighttpd-mod-evasive,evasive))
201 $(eval $(call BuildPlugin,lighttpd-mod-expire, expire))
202 $(eval $(call BuildPlugin,lighttpd-mod-fastcgi,fastcgi))
203 $(eval $(call BuildPlugin,lighttpd-mod-proxy,proxy))
204 $(eval $(call BuildPlugin,lighttpd-mod-redirect,redirect))
205 $(eval $(call BuildPlugin,lighttpd-mod-rewrite,rewrite))
206 $(eval $(call BuildPlugin,lighttpd-mod-setenv,setenv))
207 $(eval $(call BuildPlugin,lighttpd-mod-simple-vhost,simple_vhost))
208 $(eval $(call BuildPlugin,lighttpd-mod-ssi,ssi))
209 $(eval $(call BuildPlugin,lighttpd-mod-status,status))
210 $(eval $(call BuildPlugin,lighttpd-mod-usertrack,usertrack))
211 $(eval $(call BuildPlugin,lighttpd-mod-webdav,webdav))