lighttpd: update to verion 1.4.28 and add mod
[packages.git] / net / lighttpd / Makefile
1 #
2 # Copyright (C) 2006-2010 OpenWrt.org
3 #
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
6 #
7
8 include $(TOPDIR)/rules.mk
9
10 PKG_NAME:=lighttpd
11 PKG_VERSION:=1.4.28
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
15 PKG_SOURCE_URL:=http://download.lighttpd.net/lighttpd/releases-1.4.x/
16 PKG_MD5SUM:=586eb535d31ac299652495b058dd87c4
17
18 PKG_FIXUP:=libtool
19 PKG_INSTALL:=1
20
21 include $(INCLUDE_DIR)/package.mk
22
23 define Package/lighttpd/Default
24   SUBMENU:=Web
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   DEPENDS:=+libopenssl +libpcre +libpthread
34   TITLE:=A flexible and lightweight web server
35 endef
36
37 define Package/lighttpd-mod-access
38   $(call Package/lighttpd/Default)
39   DEPENDS:=lighttpd
40   TITLE:=Access restrictions module
41 endef
42
43 define Package/lighttpd-mod-accesslog
44   $(call Package/lighttpd/Default)
45   DEPENDS:=lighttpd
46   TITLE:=Access logging module
47 endef
48
49 define Package/lighttpd-mod-alias
50   $(call Package/lighttpd/Default)
51   DEPENDS:=lighttpd
52   TITLE:=Directory alias module
53 endef
54
55 define Package/lighttpd-mod-auth
56   $(call Package/lighttpd/Default)
57   DEPENDS:=lighttpd
58   TITLE:=Authentication module
59 endef
60
61 define Package/lighttpd-mod-cgi
62   $(call Package/lighttpd/Default)
63   DEPENDS:=lighttpd
64   TITLE:=CGI module
65 endef
66
67 define Package/lighttpd-mod-cml
68   $(call Package/lighttpd/Default)
69   DEPENDS:=lighttpd
70   TITLE:=Cache Meta Language module
71 endef
72
73 define Package/lighttpd-mod-compress
74   $(call Package/lighttpd/Default)
75   DEPENDS:=lighttpd +zlib
76   TITLE:=Compress output module
77 endef
78
79 define Package/lighttpd-mod-evasive
80   $(call Package/lighttpd/Default)
81   DEPENDS:=lighttpd
82   TITLE:=Evasive module
83 endef
84
85 define Package/lighttpd-mod-evhost
86   $(call Package/lighttpd/Default)
87   DEPENDS:=lighttpd
88   TITLE:=Exnhanced Virtual-Hosting module
89 endef
90
91 define Package/lighttpd-mod-expire
92   $(call Package/lighttpd/Default)
93   DEPENDS:=lighttpd
94   TITLE:=Expire module
95 endef
96
97 define Package/lighttpd-mod-extforward
98   $(call Package/lighttpd/Default)
99   DEPENDS:=lighttpd
100   TITLE:=Extract client IP module
101 endef
102
103 define Package/lighttpd-mod-fastcgi
104   $(call Package/lighttpd/Default)
105   DEPENDS:=lighttpd
106   TITLE:=FastCGI module
107 endef
108
109 define Package/lighttpd-mod-flv-streaming
110   $(call Package/lighttpd/Default)
111   DEPENDS:=lighttpd
112   TITLE:=flv streaming module
113 endef
114
115 define Package/lighttpd-mod-magnet
116   $(call Package/lighttpd/Default)
117   DEPENDS:=lighttpd
118   TITLE:=magnet module
119 endef
120
121 define Package/lighttpd-mod-mysql-vhost
122   $(call Package/lighttpd/Default)
123   DEPENDS:=lighttpd +libmysqlclient
124   TITLE:=Mysql virtual hosting module
125 endef
126
127 define Package/lighttpd-mod-proxy
128   $(call Package/lighttpd/Default)
129   DEPENDS:=lighttpd
130   TITLE:=Proxy module
131 endef
132
133 define Package/lighttpd-mod-redirect
134   $(call Package/lighttpd/Default)
135   DEPENDS:=lighttpd +libpcre
136   TITLE:=URL redirection module
137 endef
138
139 define Package/lighttpd-mod-rewrite
140   $(call Package/lighttpd/Default)
141   DEPENDS:=lighttpd +libpcre
142   TITLE:=URL rewriting module
143 endef
144
145 define Package/lighttpd-mod-rrdtool
146   $(call Package/lighttpd/Default)
147   DEPENDS:=lighttpd
148   TITLE:=rrdtool module
149 endef
150
151 define Package/lighttpd-mod-scgi
152   $(call Package/lighttpd/Default)
153   DEPENDS:=lighttpd
154   TITLE:=SCGI module
155 endef
156
157 define Package/lighttpd-mod-secdownload
158   $(call Package/lighttpd/Default)
159   DEPENDS:=lighttpd
160   TITLE:=Secure and fast download module
161 endef
162
163 define Package/lighttpd-mod-setenv
164   $(call Package/lighttpd/Default)
165   DEPENDS:=lighttpd
166   TITLE:=Environment variable setting module
167 endef
168
169 define Package/lighttpd-mod-simple-vhost
170   $(call Package/lighttpd/Default)
171   DEPENDS:=lighttpd
172   TITLE:=Simple virtual hosting module
173 endef
174
175 define Package/lighttpd-mod-ssi
176   $(call Package/lighttpd/Default)
177   DEPENDS:=lighttpd +libpcre
178   TITLE:=SSI module
179 endef
180
181 define Package/lighttpd-mod-status
182   $(call Package/lighttpd/Default)
183   DEPENDS:=lighttpd
184   TITLE:=Server status display module
185 endef
186
187 define Package/lighttpd-mod-trigger-b4-dl
188   $(call Package/lighttpd/Default)
189   DEPENDS:=lighttpd +libpcre
190   TITLE:=Trigger before download module
191 endef
192
193 define Package/lighttpd-mod-userdir
194   $(call Package/lighttpd/Default)
195   DEPENDS:=lighttpd
196   TITLE:=User directory module
197 endef
198
199 define Package/lighttpd-mod-usertrack
200   $(call Package/lighttpd/Default)
201   DEPENDS:=lighttpd
202   TITLE:=User tracking module
203 endef
204
205 define Package/lighttpd-mod-webdav
206   $(call Package/lighttpd/Default)
207   DEPENDS:=lighttpd +libsqlite3 +libuuid +libxml2
208   TITLE:=WebDAV module
209 endef
210
211 CONFIGURE_ARGS+= \
212         --libdir=/usr/lib/lighttpd \
213         --sysconfdir=/etc/lighttpd \
214         --enable-shared \
215         --enable-static \
216         --disable-rpath \
217         --without-attr \
218         --without-bzip2 \
219         --without-fam \
220         --without-gdbm \
221         --without-ldap \
222         --without-lua \
223         --without-memcache \
224         --without-mysql \
225         --with-openssl="$(STAGING_DIR)/usr" \
226         --with-pcre \
227         --without-valgrind \
228
229 CONFIGURE_VARS+= \
230         PCRE_LIB="-lpcre" \
231
232 ifneq ($(CONFIG_LARGEFILE),y)
233   CONFIGURE_ARGS+= \
234         --disable-lfs
235 endif
236
237 ifeq ($(CONFIG_IPV6),y)
238   CONFIGURE_ARGS+= \
239         --enable-ipv6
240 endif
241
242 ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-webdav),)
243   CONFIGURE_ARGS+= \
244         --with-webdav-locks \
245         --with-webdav-props
246   # XXX: needed by sqlite3 to prevent segfaults in mod_webdav.so
247   CONFIGURE_VARS+= \
248         LIBS="-lpthread"
249 else
250   CONFIGURE_ARGS+= \
251         --without-webdav-locks \
252         --without-webdav-props
253 endif
254
255 define Build/Configure
256 $(call Build/Configure/Default)
257         # XXX: override pcre (mis)detection by ./configure when cross-compiling
258         echo "#define HAVE_LIBPCRE 1" >>$(PKG_BUILD_DIR)/config.h
259         echo "#define HAVE_PCRE_H 1" >>$(PKG_BUILD_DIR)/config.h
260 endef
261
262 define Package/lighttpd/conffiles
263 /etc/lighttpd/lighttpd.conf
264 /etc/default/lighttpd
265 endef
266
267 define Package/lighttpd/install
268         $(INSTALL_DIR) $(1)/etc/lighttpd
269         $(INSTALL_DATA) ./files/lighttpd.conf $(1)/etc/lighttpd/
270         $(INSTALL_DIR) $(1)/etc/default
271         $(INSTALL_DATA) ./files/lighttpd.default $(1)/etc/default/lighttpd
272         $(INSTALL_DIR) $(1)/etc/init.d
273         $(INSTALL_BIN) ./files/lighttpd.init $(1)/etc/init.d/lighttpd
274         $(INSTALL_DIR) $(1)/usr/lib/lighttpd
275         for m in dirlisting indexfile staticfile; do \
276                 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$$$${m}.so $(1)/usr/lib/lighttpd/ ; \
277         done
278         $(INSTALL_DIR) $(1)/usr/sbin
279         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lighttpd $(1)/usr/sbin/
280 endef
281
282 define BuildPlugin
283   define Package/$(1)/install
284         [ -z "$(2)" ] || $(INSTALL_DIR) $$(1)/usr/lib/lighttpd
285         for m in $(2); do \
286                 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$$$$$$$${m}.so $$(1)/usr/lib/lighttpd/ ; \
287         done
288   endef
289
290   $$(eval $$(call BuildPackage,$(1)))
291 endef
292
293 $(eval $(call BuildPackage,lighttpd))
294 $(eval $(call BuildPlugin,lighttpd-mod-access,access))
295 $(eval $(call BuildPlugin,lighttpd-mod-accesslog,accesslog))
296 $(eval $(call BuildPlugin,lighttpd-mod-alias,alias))
297 $(eval $(call BuildPlugin,lighttpd-mod-auth,auth))
298 $(eval $(call BuildPlugin,lighttpd-mod-cgi,cgi))
299 $(eval $(call BuildPlugin,lighttpd-mod-cml,cml))
300 $(eval $(call BuildPlugin,lighttpd-mod-compress,compress))
301 $(eval $(call BuildPlugin,lighttpd-mod-evasive,evasive))
302 $(eval $(call BuildPlugin,lighttpd-mod-evhost,evhost))
303 $(eval $(call BuildPlugin,lighttpd-mod-expire,expire))
304 $(eval $(call BuildPlugin,lighttpd-mod-extforward,extforward))
305 $(eval $(call BuildPlugin,lighttpd-mod-fastcgi,fastcgi))
306 $(eval $(call BuildPlugin,lighttpd-mod-flv-streaming,flv_streaming))
307 $(eval $(call BuildPlugin,lighttpd-mod-magnet,magnet))
308 $(eval $(call BuildPlugin,lighttpd-mod-proxy,proxy))
309 $(eval $(call BuildPlugin,lighttpd-mod-redirect,redirect))
310 $(eval $(call BuildPlugin,lighttpd-mod-rewrite,rewrite))
311 $(eval $(call BuildPlugin,lighttpd-mod-rrdtool,rrdtool))
312 $(eval $(call BuildPlugin,lighttpd-mod-scgi,scgi))
313 $(eval $(call BuildPlugin,lighttpd-mod-secdownload,secdownload))
314 $(eval $(call BuildPlugin,lighttpd-mod-setenv,setenv))
315 $(eval $(call BuildPlugin,lighttpd-mod-simple-vhost,simple_vhost))
316 $(eval $(call BuildPlugin,lighttpd-mod-ssi,ssi))
317 $(eval $(call BuildPlugin,lighttpd-mod-status,status))
318 $(eval $(call BuildPlugin,lighttpd-mod-trigger-b4-dl,trigger_b4_dl))
319 $(eval $(call BuildPlugin,lighttpd-mod-userdir,userdir))
320 $(eval $(call BuildPlugin,lighttpd-mod-usertrack,usertrack))
321 $(eval $(call BuildPlugin,lighttpd-mod-webdav,webdav))