1################################################################################
2#
3# lighttpd
4#
5################################################################################
6
7LIGHTTPD_VERSION_MAJOR = 1.4
8LIGHTTPD_VERSION = $(LIGHTTPD_VERSION_MAJOR).76
9LIGHTTPD_SOURCE = lighttpd-$(LIGHTTPD_VERSION).tar.xz
10LIGHTTPD_SITE = http://download.lighttpd.net/lighttpd/releases-$(LIGHTTPD_VERSION_MAJOR).x
11LIGHTTPD_LICENSE = BSD-3-Clause
12LIGHTTPD_LICENSE_FILES = COPYING
13LIGHTTPD_CPE_ID_VENDOR = lighttpd
14LIGHTTPD_DEPENDENCIES = host-pkgconf xxhash
15LIGHTTPD_CONF_OPTS = \
16	-Dwith_dbi=disabled \
17	-Dwith_fam=disabled \
18	-Dwith_gnutls=false \
19	-Dwith_libev=disabled \
20	-Dwith_libunwind=disabled \
21	-Dwith_mbedtls=false \
22	-Dwith_nettle=false \
23	-Dwith_nss=false \
24	-Dwith_pcre=disabled \
25	-Dwith_sasl=disabled \
26	-Dwith_wolfssl=false \
27	-Dwith_xattr=false \
28	-Dwith_xxhash=enabled \
29	-Dbuild_extra_warnings=false \
30	-Dbuild_static=false \
31	-Dmoduledir=lib/lighttpd
32
33ifeq ($(BR2_PACKAGE_LIBXCRYPT),y)
34LIGHTTPD_DEPENDENCIES += libxcrypt
35endif
36
37ifeq ($(BR2_PACKAGE_LIGHTTPD_BROTLI),y)
38LIGHTTPD_DEPENDENCIES += brotli
39LIGHTTPD_CONF_OPTS += -Dwith_brotli=enabled
40else
41LIGHTTPD_CONF_OPTS += -Dwith_brotli=disabled
42endif
43
44ifeq ($(BR2_PACKAGE_LIGHTTPD_BZIP2),y)
45LIGHTTPD_DEPENDENCIES += bzip2
46LIGHTTPD_CONF_OPTS += -Dwith_bzip=enabled
47else
48LIGHTTPD_CONF_OPTS += -Dwith_bzip=disabled
49endif
50
51ifeq ($(BR2_PACKAGE_LIGHTTPD_KRB5),y)
52LIGHTTPD_DEPENDENCIES += libkrb5
53LIGHTTPD_CONF_OPTS += -Dwith_krb5=enabled
54else
55LIGHTTPD_CONF_OPTS += -Dwith_krb5=disabled
56endif
57
58ifeq ($(BR2_PACKAGE_LIGHTTPD_LDAP),y)
59LIGHTTPD_DEPENDENCIES += openldap
60LIGHTTPD_CONF_OPTS += -Dwith_ldap=enabled
61else
62LIGHTTPD_CONF_OPTS += -Dwith_ldap=disabled
63endif
64
65ifeq ($(BR2_PACKAGE_LIGHTTPD_LUA),y)
66LIGHTTPD_DEPENDENCIES += lua
67LIGHTTPD_CONF_OPTS += -Dwith_lua=true
68else
69LIGHTTPD_CONF_OPTS += -Dwith_lua=false
70endif
71
72ifeq ($(BR2_PACKAGE_LIGHTTPD_MAXMINDDB),y)
73LIGHTTPD_DEPENDENCIES += libmaxminddb
74LIGHTTPD_CONF_OPTS += -Dwith_maxminddb=enabled
75else
76LIGHTTPD_CONF_OPTS += -Dwith_maxminddb=disabled
77endif
78
79ifeq ($(BR2_PACKAGE_LIGHTTPD_MYSQL),y)
80LIGHTTPD_DEPENDENCIES += mariadb
81LIGHTTPD_CONF_OPTS += -Dwith_mysql=enabled
82else
83LIGHTTPD_CONF_OPTS += -Dwith_mysql=disabled
84endif
85
86ifeq ($(BR2_PACKAGE_LIGHTTPD_OPENSSL),y)
87LIGHTTPD_DEPENDENCIES += openssl
88LIGHTTPD_CONF_OPTS += -Dwith_openssl=true
89else
90LIGHTTPD_CONF_OPTS += -Dwith_openssl=false
91endif
92
93ifeq ($(BR2_PACKAGE_LIGHTTPD_PAM),y)
94LIGHTTPD_DEPENDENCIES += linux-pam
95LIGHTTPD_CONF_OPTS += -Dwith_pam=enabled
96else
97LIGHTTPD_CONF_OPTS += -Dwith_pam=disabled
98endif
99
100ifeq ($(BR2_PACKAGE_LIGHTTPD_PCRE),y)
101LIGHTTPD_DEPENDENCIES += pcre2
102LIGHTTPD_CONF_OPTS += -Dwith_pcre2=true
103else
104LIGHTTPD_CONF_OPTS += -Dwith_pcre2=false
105endif
106
107ifeq ($(BR2_PACKAGE_LIGHTTPD_PGSQL),y)
108LIGHTTPD_DEPENDENCIES += postgresql
109LIGHTTPD_CONF_OPTS += -Dwith_pgsql=enabled
110else
111LIGHTTPD_CONF_OPTS += -Dwith_pgsql=disabled
112endif
113
114ifeq ($(BR2_PACKAGE_LIGHTTPD_WEBDAV),y)
115LIGHTTPD_DEPENDENCIES += libxml2 sqlite
116LIGHTTPD_CONF_OPTS += -Dwith_webdav_props=enabled
117ifeq ($(BR2_PACKAGE_UTIL_LINUX_LIBUUID),y)
118LIGHTTPD_CONF_OPTS += -Dwith_webdav_locks=enabled
119LIGHTTPD_DEPENDENCIES += util-linux
120else
121LIGHTTPD_CONF_OPTS += -Dwith_webdav_locks=disabled
122endif
123else
124LIGHTTPD_CONF_OPTS += -Dwith_webdav_props=disabled -Dwith_webdav_locks=disabled
125endif
126
127ifeq ($(BR2_PACKAGE_LIGHTTPD_ZLIB),y)
128LIGHTTPD_DEPENDENCIES += zlib
129LIGHTTPD_CONF_OPTS += -Dwith_zlib=enabled
130else
131LIGHTTPD_CONF_OPTS += -Dwith_zlib=disabled
132endif
133
134ifeq ($(BR2_PACKAGE_LIGHTTPD_ZSTD),y)
135LIGHTTPD_DEPENDENCIES += zstd
136LIGHTTPD_CONF_OPTS += -Dwith_zstd=enabled
137else
138LIGHTTPD_CONF_OPTS += -Dwith_zstd=disabled
139endif
140
141define LIGHTTPD_INSTALL_CONFIG
142	$(INSTALL) -d -m 0755 $(TARGET_DIR)/etc/lighttpd/conf.d
143	$(INSTALL) -d -m 0755 $(TARGET_DIR)/var/www
144	$(INSTALL) -D -m 0644 $(@D)/doc/config/lighttpd.conf \
145		$(TARGET_DIR)/etc/lighttpd/lighttpd.conf
146	$(INSTALL) -D -m 0644 $(@D)/doc/config/modules.conf \
147		$(TARGET_DIR)/etc/lighttpd/modules.conf
148	$(INSTALL) -D -m 0644 $(@D)/doc/config/conf.d/access_log.conf \
149		$(TARGET_DIR)/etc/lighttpd/conf.d/access_log.conf
150	$(INSTALL) -D -m 0644 $(@D)/doc/config/conf.d/debug.conf \
151		$(TARGET_DIR)/etc/lighttpd/conf.d/debug.conf
152	$(INSTALL) -D -m 0644 $(@D)/doc/config/conf.d/dirlisting.conf \
153		$(TARGET_DIR)/etc/lighttpd/conf.d/dirlisting.conf
154	$(INSTALL) -D -m 0644 $(@D)/doc/config/conf.d/mime.conf \
155		$(TARGET_DIR)/etc/lighttpd/conf.d/mime.conf
156endef
157
158LIGHTTPD_POST_INSTALL_TARGET_HOOKS += LIGHTTPD_INSTALL_CONFIG
159
160define LIGHTTPD_INSTALL_INIT_SYSV
161	$(INSTALL) -D -m 0755 package/lighttpd/S50lighttpd \
162		$(TARGET_DIR)/etc/init.d/S50lighttpd
163endef
164
165define LIGHTTPD_INSTALL_INIT_SYSTEMD
166	$(INSTALL) -D -m 0644 $(@D)/doc/systemd/lighttpd.service \
167		$(TARGET_DIR)/usr/lib/systemd/system/lighttpd.service
168	$(INSTALL) -D -m 644 package/lighttpd/lighttpd_tmpfiles.conf \
169		$(TARGET_DIR)/usr/lib/tmpfiles.d/lighttpd.conf
170endef
171
172$(eval $(meson-package))
173