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