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