Merge pull request #11353 from kvuorine/fwknop-fixes
[feed/packages.git] / net / lighttpd / Makefile
1 #
2 # Copyright (C) 2006-2018 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.55
12 PKG_RELEASE:=2
13
14 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.xz
15 PKG_SOURCE_URL:=https://download.lighttpd.net/lighttpd/releases-1.4.x
16 PKG_HASH:=6a0b50e9c9d5cc3d9e48592315c25a2d645858f863e1ccd120507a30ce21e927
17
18 PKG_MAINTAINER:=W. Michael Petullo <mike@flyn.org>
19 PKG_LICENSE:=BSD-3-Clause
20 PKG_LICENSE_FILES:=COPYING
21 PKG_CPE_ID:=cpe:/a:lighttpd:lighttpd
22
23 PKG_INSTALL:=1
24 PKG_BUILD_DEPENDS:=meson/host
25 PKG_CONFIG_DEPENDS:=CONFIG_LIGHTTPD_SSL $(patsubst %,CONFIG_PACKAGE_lighttpd-mod-%,$(REBUILD_MODULES))
26
27 REBUILD_MODULES=authn_gssapi authn_ldap authn_mysql cml magnet mysql_vhost trigger_b4_dl webdav
28
29 include $(INCLUDE_DIR)/package.mk
30 # iconv is required for lighttpd's mysql plugin
31 include $(INCLUDE_DIR)/nls.mk
32 include ../../devel/meson/meson.mk
33
34 define Package/lighttpd/Default
35 SECTION:=net
36 CATEGORY:=Network
37 SUBMENU:=Web Servers/Proxies
38 URL:=https://www.lighttpd.net/
39 endef
40
41 define Package/lighttpd
42 $(call Package/lighttpd/Default)
43 MENU:=1
44 DEPENDS:=+LIGHTTPD_SSL:libopenssl +libpcre +libpthread
45 TITLE:=A flexible and lightweight web server
46 endef
47
48 define Package/lighttpd/config
49 config LIGHTTPD_SSL
50 bool "SSL support"
51 depends on PACKAGE_lighttpd
52 default y
53 help
54 Implements SSL support in lighttpd (using libopenssl). This
55 option is required if you enable the SSL engine in your
56 lighttpd confguration file.
57 endef
58
59 MESON_ARGS += \
60 -Dwith_bzip=false \
61 -Dwith_dbi=$(if $(CONFIG_PACKAGE_lighttpd-mod-vhostdb_dbi),true,false) \
62 -Dwith_fam=false \
63 -Dwith_gdbm=$(if $(CONFIG_PACKAGE_lighttpd-mod-trigger_b4_dl),true,false) \
64 -Dwith_geoip=$(if $(CONFIG_PACKAGE_lighttpd-mod-geoip),true,false) \
65 -Dwith_krb5=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_gssapi),true,false) \
66 -Dwith_ldap=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_ldap)$(CONFIG_PACKAGE_lighttpd-mod-vhostdb_ldap),true,false) \
67 -Dwith_libev=false \
68 -Dwith_libunwind=false \
69 -Dwith_lua=$(if $(CONFIG_PACKAGE_lighttpd-mod-cml)$(CONFIG_PACKAGE_lighttpd-mod-magnet),true,false) \
70 -Dwith_maxminddb=$(if $(CONFIG_PACKAGE_lighttpd-mod-maxminddb),true,false) \
71 -Dwith_memcached=false \
72 -Dwith_mysql=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_mysql)$(CONFIG_PACKAGE_lighttpd-mod-mysql_vhost)$(CONFIG_PACKAGE_lighttpd-mod-vhostdb_mysql),true,false) \
73 -Dwith_openssl=$(if $(CONFIG_LIGHTTPD_SSL),true,false) \
74 -Dwith_pam=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_pam),true,false) \
75 -Dwith_pcre=true \
76 -Dwith_pgsql=$(if $(CONFIG_PACKAGE_lighttpd-mod-vhostdb_pgsql),true,false) \
77 -Dwith_sasl=$(if $(CONFIG_PACKAGE_lighttpd-mod-authn_sasl),true,false) \
78 -Dwith_webdav_locks=$(if $(CONFIG_PACKAGE_lighttpd-mod-webdav),true,false) \
79 -Dwith_webdav_props=$(if $(CONFIG_PACKAGE_lighttpd-mod-webdav),true,false) \
80 -Dwith_wolfssl=false \
81 -Dwith_xattr=false \
82 -Dwith_zlib=$(if $(CONFIG_PACKAGE_lighttpd-mod-compress)$(CONFIG_PACKAGE_lighttpd-mod-deflate),true,false)
83
84 BASE_MODULES:=dirlisting indexfile staticfile
85
86 ifneq ($(strip $(CONFIG_LIGHTTPD_SSL)),)
87 BASE_MODULES+= openssl
88 endif
89
90 define Package/lighttpd/conffiles
91 /etc/lighttpd/lighttpd.conf
92 endef
93
94 define Package/lighttpd/install
95 $(INSTALL_DIR) $(1)/etc/lighttpd
96 $(INSTALL_DATA) ./files/lighttpd.conf $(1)/etc/lighttpd/
97 $(INSTALL_DATA) $(PKG_BUILD_DIR)/doc/config/conf.d/mime.conf $(1)/etc/lighttpd/
98 $(INSTALL_DIR) $(1)/etc/lighttpd/conf.d
99 $(INSTALL_DIR) $(1)/etc/init.d
100 $(INSTALL_BIN) ./files/lighttpd.init $(1)/etc/init.d/lighttpd
101 $(INSTALL_DIR) $(1)/usr/lib/lighttpd
102 for m in $(BASE_MODULES); do \
103 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$$$${m}.so $(1)/usr/lib/lighttpd/ ; \
104 done
105 $(INSTALL_DIR) $(1)/usr/sbin
106 $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/sbin/lighttpd $(1)/usr/sbin/
107 endef
108
109 define BuildPlugin
110 define Package/lighttpd-mod-$(1)
111 $(call Package/lighttpd/Default)
112 DEPENDS:=lighttpd
113 ifneq ($(3),)
114 DEPENDS+= $(3)
115 endif
116 TITLE:=$(2) module
117 endef
118
119 define Package/lighttpd-mod-$(1)/conffiles
120 /etc/lighttpd/conf.d/$(4)-$(1).conf
121 endef
122
123 ifneq ($(SDK)$(CONFIG_PACKAGE_lighttpd-mod-$(1)),)
124 define Package/lighttpd-mod-$(1)/install
125 $(INSTALL_DIR) $$(1)/usr/lib/lighttpd
126 $(CP) $(PKG_INSTALL_DIR)/usr/lib/lighttpd/mod_$(1).so $$(1)/usr/lib/lighttpd
127 $(INSTALL_DIR) $$(1)/etc/lighttpd/conf.d
128 if [ -f $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf ]; then \
129 $(CP) $(PKG_BUILD_DIR)/doc/config/conf.d/$(1).conf $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
130 if ! grep -qF 'mod_$(1)' $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf; then \
131 sed -i "`sed '/^##/ !q' $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf | wc -l` i\
132 server.modules += ( \"mod_$(1)\" )" $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
133 fi \
134 else \
135 echo 'server.modules += ( "mod_$(1)" )' > $$(1)/etc/lighttpd/conf.d/$(4)-$(1).conf ; \
136 fi
137 endef
138 endif
139
140 $$(eval $$(call BuildPackage,lighttpd-mod-$(1)))
141 endef
142
143 $(eval $(call BuildPackage,lighttpd))
144
145 # First, permit redirect from HTTP to HTTPS.
146 $(eval $(call BuildPlugin,redirect,URL redirection,+PACKAGE_lighttpd-mod-redirect:libpcre,10))
147
148 # Next, permit authentication.
149 $(eval $(call BuildPlugin,auth,Authentication,,20))
150 $(eval $(call BuildPlugin,authn_file,File-based authentication,lighttpd-mod-auth,20))
151 $(eval $(call BuildPlugin,authn_gssapi,Kerberos-based authentication,lighttpd-mod-auth +PACKAGE_lighttpd-mod-authn_gssapi:krb5-libs,20))
152 $(eval $(call BuildPlugin,authn_ldap,LDAP-based authentication,lighttpd-mod-auth +PACKAGE_lighttpd-mod-authn_ldap:libopenldap,20))
153 $(eval $(call BuildPlugin,authn_mysql,Mysql-based authentication,lighttpd-mod-auth +PACKAGE_lighttpd-mod-authn_mysql:libmysqlclient,20))
154 $(eval $(call BuildPlugin,authn_pam,PAM-based authentication,lighttpd-mod-auth +PACKAGE_lighttpd-mod-authn_pam:libpam,20))
155 $(eval $(call BuildPlugin,authn_sasl,SASL-based authentication,lighttpd-mod-auth +PACKAGE_lighttpd-mod-authn_sasl:libsasl2,20))
156
157 # Finally, everything else.
158 $(eval $(call BuildPlugin,access,Access restrictions,,30))
159 $(eval $(call BuildPlugin,accesslog,Access logging,,30))
160 $(eval $(call BuildPlugin,alias,Directory alias,,30))
161 $(eval $(call BuildPlugin,cgi,CGI,,30))
162 #$(eval $(call BuildPlugin,cml,Cache Meta Language,+PACKAGE_lighttpd-mod-cml:liblua +PACKAGE_lighttpd-mod-cml:libmemcached,30))
163 $(eval $(call BuildPlugin,cml,Cache Meta Language,+PACKAGE_lighttpd-mod-cml:liblua,30))
164 $(eval $(call BuildPlugin,compress,Compress output,+PACKAGE_lighttpd-mod-compress:zlib,30))
165 $(eval $(call BuildPlugin,deflate,Compress dynamic output,+PACKAGE_lighttpd-mod-deflate:zlib,30))
166 $(eval $(call BuildPlugin,evasive,Evasive,,30))
167 $(eval $(call BuildPlugin,evhost,Enhanced Virtual-Hosting,,30))
168 $(eval $(call BuildPlugin,expire,Expire,,30))
169 $(eval $(call BuildPlugin,extforward,Extract client,,30))
170 $(eval $(call BuildPlugin,fastcgi,FastCGI,,30))
171 $(eval $(call BuildPlugin,flv_streaming,FLV streaming,,30))
172 #$(eval $(call BuildPlugin,geoip,Geolocation,+PACKAGE_lighttpd-mod-geoip:libgeoip,30)) #libgeoip is not in OpenWrt
173 $(eval $(call BuildPlugin,magnet,Magnet,+PACKAGE_lighttpd-mod-magnet:liblua,30))
174 $(eval $(call BuildPlugin,maxminddb,MaxMind DB,+PACKAGE_lighttpd-mod-maxminddb:libmaxminddb,30))
175 $(eval $(call BuildPlugin,mysql_vhost,Mysql virtual hosting,+PACKAGE_lighttpd-mod-mysql_vhost:libmysqlclient,30))
176 $(eval $(call BuildPlugin,proxy,Proxy,,30))
177 $(eval $(call BuildPlugin,rewrite,URL rewriting,+PACKAGE_lighttpd-mod-rewrite:libpcre,30))
178 $(eval $(call BuildPlugin,rrdtool,RRDtool,,30))
179 $(eval $(call BuildPlugin,scgi,SCGI,,30))
180 $(eval $(call BuildPlugin,secdownload,Secure and fast download,,30))
181 $(eval $(call BuildPlugin,setenv,Environment variable setting,,30))
182 $(eval $(call BuildPlugin,simple_vhost,Simple virtual hosting,,30))
183 $(eval $(call BuildPlugin,sockproxy,sockproxy,,30))
184 $(eval $(call BuildPlugin,ssi,SSI,+PACKAGE_lighttpd-mod-ssi:libpcre,30))
185 $(eval $(call BuildPlugin,staticfile,staticfile,,30))
186 $(eval $(call BuildPlugin,status,Server status display,,30))
187 #$(eval $(call BuildPlugin,trigger_b4_dl,Trigger before download,+PACKAGE_lighttpd-mod-trigger_b4_dl:libpcre +PACKAGE_lighttpd-mod-trigger_b4_dl:libgdbm +PACKAGE_lighttpd-mod-trigger_b4_dl:libmemcached,30))
188 $(eval $(call BuildPlugin,trigger_b4_dl,Trigger before download,+PACKAGE_lighttpd-mod-trigger_b4_dl:libpcre +PACKAGE_lighttpd-mod-trigger_b4_dl:libgdbm,30))
189 $(eval $(call BuildPlugin,uploadprogress,Upload Progress,,30))
190 $(eval $(call BuildPlugin,userdir,User directory,,30))
191 $(eval $(call BuildPlugin,usertrack,User tracking,,30))
192 $(eval $(call BuildPlugin,vhostdb_dbi,Virtual Host Database (DBI),+PACKAGE_lighttpd-mod-vhostdb_dbi:libdbi,30))
193 $(eval $(call BuildPlugin,vhostdb_ldap,Virtual Host Database (LDAP),+PACKAGE_lighttpd-mod-vhostdb_ldap:libopenldap,30))
194 $(eval $(call BuildPlugin,vhostdb_mysql,Virtual Host Database (MariaDB),+PACKAGE_lighttpd-mod-vhostdb_mysql:libmysqlclient,30))
195 $(eval $(call BuildPlugin,vhostdb_pgsql,Virtual Host Database (PostgreSQL),+PACKAGE_lighttpd-mod-vhostdb_pgsql:libpq,30))
196 $(eval $(call BuildPlugin,vhostdb,Virtual Host Database,,30))
197 $(eval $(call BuildPlugin,webdav,WebDAV,+PACKAGE_lighttpd-mod-webdav:libsqlite3 +PACKAGE_lighttpd-mod-webdav:libuuid +PACKAGE_lighttpd-mod-webdav:libxml2,30))
198 $(eval $(call BuildPlugin,wstunnel,Websocket tunneling,,30))