nginx: moved to github
[packages.git] / net / lighttpd / Makefile
1         #
2 # Copyright (C) 2006-2013 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.35
12 PKG_RELEASE:=1
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=http://download.lighttpd.net/lighttpd/releases-1.4.x
16 PKG_MD5SUM:=c7ae774eab4cb7ac85e41b712f4ee9ba
17
18 PKG_LICENSE:=BSD-3c
19 PKG_LICENSE_FILES:=COPYING
20
21 PKG_FIXUP:=autoreconf
22 PKG_INSTALL:=1
23
24 include $(INCLUDE_DIR)/package.mk
25
26 define Package/lighttpd/Default
27   SUBMENU:=Web Servers/Proxies
28   SECTION:=net
29   CATEGORY:=Network
30   URL:=http://www.lighttpd.net/
31 endef
32
33 define Package/lighttpd
34   $(call Package/lighttpd/Default)
35   MENU:=1
36   DEPENDS:=+LIGHTTPD_SSL:libopenssl +libpcre +libpthread
37   TITLE:=A flexible and lightweight web server
38 endef
39
40 define Package/lighttpd/config
41 config LIGHTTPD_SSL
42         bool "SSL support"
43         depends on PACKAGE_lighttpd
44         default y
45         help
46           Implements SSL support in lighttpd (using libopenssl). This
47           option is required if you enable the SSL engine in your
48           lighttpd confguration file.
49 endef
50
51 CONFIGURE_ARGS+= \
52         --libdir=/usr/lib/lighttpd \
53         --sysconfdir=/etc/lighttpd \
54         --enable-shared \
55         --enable-static \
56         --disable-rpath \
57         --without-attr \
58         --without-bzip2 \
59         --without-fam \
60         --without-gdbm \
61         --without-ldap \
62         --without-lua \
63         --without-memcache \
64         --with-pcre \
65         --without-valgrind \
66          $(call autoconf_bool,CONFIG_IPV6,ipv6)
67
68 CONFIGURE_VARS+= \
69         PCRE_LIB="-lpcre" \
70
71 ifneq ($(strip $(CONFIG_LIGHTTPD_SSL)),)
72   CONFIGURE_ARGS+= \
73         --with-openssl="$(STAGING_DIR)/usr"
74 else
75   CONFIGURE_ARGS+= \
76         --without-openssl
77 endif
78
79 ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-mysql-vhost),)
80   CONFIGURE_ARGS+= \
81         --with-mysql
82 else
83   CONFIGURE_ARGS+= \
84         --without-mysql
85 endif
86
87 ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-webdav),)
88   CONFIGURE_ARGS+= \
89         --with-webdav-locks \
90         --with-webdav-props
91   # XXX: needed by sqlite3 to prevent segfaults in mod_webdav.so
92   CONFIGURE_VARS+= \
93         LIBS="-lpthread"
94 else
95   CONFIGURE_ARGS+= \
96         --without-webdav-locks \
97         --without-webdav-props
98 endif
99
100 define Build/Configure
101 $(call Build/Configure/Default)
102         # XXX: override pcre (mis)detection by ./configure when cross-compiling
103         echo "#define HAVE_LIBPCRE 1" >>$(PKG_BUILD_DIR)/config.h
104         echo "#define HAVE_PCRE_H 1" >>$(PKG_BUILD_DIR)/config.h
105 endef
106
107 define Package/lighttpd/conffiles
108 /etc/lighttpd/lighttpd.conf
109 endef
110
111 define Package/lighttpd/install
112         $(INSTALL_DIR) $(1)/etc/lighttpd
113         $(INSTALL_DATA) ./files/lighttpd.conf $(1)/etc/lighttpd/
114         $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/config/conf.d/mime.conf $(1)/etc/lighttpd/
115         $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d
116         $(INSTALL_DIR) $(1)/etc/init.d
117         $(INSTALL_BIN) ./files/lighttpd.init $(1)/etc/init.d/lighttpd
118         $(INSTALL_DIR) $(1)/usr/lib/lighttpd
119         for m in dirlisting indexfile staticfile; do \
120                 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$$$${m}.so $(1)/usr/lib/lighttpd/ ; \
121         done
122         $(INSTALL_DIR) $(1)/usr/sbin
123         $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lighttpd $(1)/usr/sbin/
124 endef
125
126 define BuildPlugin
127   define Package/lighttpd-mod-$(1)
128     $(call Package/lighttpd/Default)
129     DEPENDS:=lighttpd
130     ifneq ($(3),)
131       DEPENDS+= $(3)
132     endif
133     TITLE:=$(2) module
134   endef
135
136   define Package/lighttpd-mod-$(1)/install
137         $(INSTALL_DIR) $$(1)/usr/lib/lighttpd
138         $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$(1).so $$(1)/usr/lib/lighttpd
139         $(INSTALL_DIR) $$(1)/etc/lighttpd/conf.d
140         if [ -f $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf ]; then \
141                 $(CP) $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
142         else \
143                 echo 'server.modules += ( "mod_$(1)" )' > $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
144         fi
145   endef
146
147   $$(eval $$(call BuildPackage,lighttpd-mod-$(1)))
148 endef
149
150 $(eval $(call BuildPackage,lighttpd))
151 $(eval $(call BuildPlugin,access,Access restrictions,,10))
152 $(eval $(call BuildPlugin,accesslog,Access logging,,10))
153 $(eval $(call BuildPlugin,alias,Directory alias,,10))
154 $(eval $(call BuildPlugin,auth,Authentication,,05))
155 $(eval $(call BuildPlugin,cgi,CGI,,10))
156 $(eval $(call BuildPlugin,cml,Cache Meta Language,,10))
157 $(eval $(call BuildPlugin,compress,Compress output,+PACKAGE_lighttpd-mod-compress:zlib,10))
158 $(eval $(call BuildPlugin,evasive,Evasive,,10))
159 $(eval $(call BuildPlugin,evhost,Exnhanced Virtual-Hosting,,10))
160 $(eval $(call BuildPlugin,expire,Expire,,10))
161 $(eval $(call BuildPlugin,extforward,Extract client,,10))
162 $(eval $(call BuildPlugin,fastcgi,FastCGI,,10))
163 $(eval $(call BuildPlugin,flv_streaming,FLV streaming,,10))
164 $(eval $(call BuildPlugin,magnet,Magnet,,10))
165 $(eval $(call BuildPlugin,mysql_vhost,Mysql virtual hosting,+PACKAGE_lighttpd-mod-mysql_vhost:libmysqlclient,10))
166 $(eval $(call BuildPlugin,proxy,Proxy,,10))
167 $(eval $(call BuildPlugin,redirect,URL redirection,+PACKAGE_lighttpd-mod-redirect:libpcre,10))
168 $(eval $(call BuildPlugin,rewrite,URL rewriting,+PACKAGE_lighttpd-mod-rewrite:libpcre,10))
169 $(eval $(call BuildPlugin,rrdtool,RRDtool,,10))
170 $(eval $(call BuildPlugin,scgi,SCGI,,10))
171 $(eval $(call BuildPlugin,secdownload,Secure and fast download,,10))
172 $(eval $(call BuildPlugin,setenv,Environment variable setting,,10))
173 $(eval $(call BuildPlugin,simple_vhost,Simple virtual hosting,,10))
174 $(eval $(call BuildPlugin,ssi,SSI,+libpcre,10))
175 $(eval $(call BuildPlugin,status,Server status display,,10))
176 $(eval $(call BuildPlugin,trigger_b4_dl,Trigger before download,+PACKAGE_lighttpd-mod-trigger_b4_dl:libpcre,10))
177 $(eval $(call BuildPlugin,userdir,User directory,,10))
178 $(eval $(call BuildPlugin,usertrack,User tracking,,10))
179 $(eval $(call BuildPlugin,webdav,WebDAV,+PACKAGE_lighttpd-mod-webdav:libsqlite3 +PACKAGE_lighttpd-mod-webdav:libuuid +PACKAGE_lighttpd-mod-webdav:libxml2,10))
180