# TODO:
-# - provide or autogenerate self signed cert in post, so after installing
+# - don't use lighttpd-angel in systemd. systemd does the respawn/recovery logic itself
+# - provide or autogenerated self signed cert in post, so after installing
# lighttpd-ssl server will still work
# - patch with mod_websocket: https://github.com/Juniper/lighttpd-for-juise
# - lighttpd-mod_fd_transfer: https://redmine.lighttpd.net/boards/3/topics/4992
-# - add db specific mod_vhostdb_* - packages
+# - add db specific mod_vhostdb_* sub-packages
+# - package mod_sockproxy
+# https://github.com/lighttpd/lighttpd1.4/commit/c4d743bb4d0cc045d41322169a4e36a151e247f1
+# - TLS library options
+# - mod_openssl (existing)
+# - mod_mbedtls (experimental)
+# - mod_wolfssl (experimental)
+# - mod_gnutls (experimental)
+# - mod_nss (experimental)
#
# Conditional build:
%bcond_with tests # build with tests
%bcond_without xattr # support of extended attributes
%bcond_without ipv6 # IPv4-only version (doesn't require IPv6 in kernel)
%bcond_without largefile # largefile support (see notes above)
+%bcond_without dbi # libdbi, enables mod_vhostdb_dbi
%bcond_without ssl # ssl support
%bcond_without mysql # mysql support in mod_mysql_vhost, mod_vhostdb_mysql
+%bcond_without pgsql # PgSQL, enables mod_vhostdb_pgsql
+%bcond_without bzip2 # Enable bzip2 support for mod_deflate
+%bcond_without brotli # Enable brotli support for mod_deflate
%bcond_without geoip # GeoIP support
+%bcond_without maxminddb # MaxMind GeoIP2 module
%bcond_with krb5 # krb5 support (does not work with heimdal)
%bcond_without ldap # ldap support in mod_auth, mod_vhostdb_ldap
%bcond_without lua # LUA support in mod_cml (needs LUA >= 5.1)
Summary: Fast and light HTTP server
Summary(pl.UTF-8): Szybki i lekki serwer HTTP
Name: lighttpd
-Version: 1.4.48
-Release: 1
+Version: 1.4.56
+Release: 2
License: BSD
Group: Networking/Daemons/HTTP
Source0: https://download.lighttpd.net/lighttpd/releases-1.4.x/%{name}-%{version}.tar.xz
-# Source0-md5: 1e3a9eb5078f481e3a8a1d0aaac8c3c8
+# Source0-md5: 9d94f68c8106bfcdfe7aafa0a13f45a8
Source1: %{name}.init
Source2: %{name}.conf
Source3: %{name}.user
Source103: mod_auth.conf
Source104: mod_cgi.conf
Source105: mod_cml.conf
-Source106: mod_compress.conf
Source107: mod_deflate.conf
Source108: mod_dirlisting.conf
Source109: mod_evasive.conf
Source135: mod_extforward.conf
Source136: mod_h264_streaming.conf
Source137: mod_cgi_php.conf
-Source138: mod_compress.tmpwatch
Source139: mod_uploadprogress.conf
Source140: mod_geoip.conf
Source141: mod_authn_ldap.conf
Source143: mod_vhostdb.conf
Source144: mod_wstunnel.conf
Source145: mod_authn_mysql.conf
+Source146: mod_sockproxy.conf
+Source147: mod_maxminddb.conf
# use branch.sh script to create branch.diff
#Patch100: %{name}-branch.diff
## Patch100-md5: 7bd09235304c8bcb16f34d49d480c0fb
-Patch0: %{name}-use_bin_sh.patch
Patch1: %{name}-mod_evasive-status_code.patch
Patch2: %{name}-mod_h264_streaming.patch
Patch3: %{name}-branding.patch
Patch4: systemd.patch
-Patch6: test-port-setup.patch
-Patch7: env-documentroot.patch
+Patch5: test-port-setup.patch
URL: https://www.lighttpd.net/
%{?with_geoip:BuildRequires: GeoIP-devel}
%{?with_xattr:BuildRequires: attr-devel}
BuildRequires: autoconf >= 2.57
+%{?with_maxminddb:BuildRequires: libmaxminddb-devel}
%if "%{pld_release}" != "ac"
BuildRequires: automake >= 1:1.11.2
%else
BuildRequires: automake
%endif
-BuildRequires: bzip2-devel
+%{?with_bzip2:BuildRequires: bzip2-devel}
BuildRequires: fcgi-devel
%{?with_gamin:BuildRequires: gamin-devel}
%{?with_storage_gdbm:BuildRequires: gdbm-devel}
%{?with_krb5:BuildRequires: krb5-devel}
+%{?with_brotli:BuildRequires: libbrotli-devel}
+%{?with_dbi:BuildRequires: libdbi-devel}
%{?with_storage_memcached:BuildRequires: libmemcached-devel}
BuildRequires: libtool
BuildRequires: libuuid-devel
%{?with_ssl:BuildRequires: openssl-devel}
BuildRequires: pcre-devel
BuildRequires: pkgconfig
+%{?with_pgsql:BuildRequires: postgresql-devel}
BuildRequires: rpm >= 4.4.9-56
BuildRequires: rpmbuild(macros) >= 1.647
%{?with_webdav_props:BuildRequires: sqlite3-devel}
Summary: lighttpd module for output compression using deflate method
Summary(pl.UTF-8): Moduł lighttpd do kompresji wyjścia metodą deflate
Group: Networking/Daemons/HTTP
-URL: http://redmine.lighttpd.net/projects/lighttpd/wiki/Mod_Deflate
+URL: https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModDeflate
Requires: %{name} = %{version}-%{release}
+Obsoletes: lighttpd-mod_compress < 1.4.56
+
+%define _deflate_encodings deflate gzip %{?with_bzip2:bzip2} %{?with_brotli:brotli}
+%define deflate_encodings %(echo %_deflate_encodings | sed -e 's/ /, /g')
%description mod_deflate
-mod_deflate can compress any output from lighttpd static or dynamic.
-It doesn't support caching compressed output like mod_compress.
+mod_deflate enables output compression of responses
+(Content-Encoding).
+
+Output compression reduces the network load and can improve the
+overall throughput of the webserver. All major http-clients support
+compression by announcing it in the Accept-Encoding header. This is
+used to negotiate the most suitable compression method.
+
+This module supports %{deflate_encodings} encodings.
+
+deflate (RFC1950, RFC1951) and gzip (RFC1952) depend on zlib while
+bzip2 depends on libbzip2. bzip2 is only supported by lynx and some
+other console text-browsers. brotli (RFC7932) is supported in most
+popular browsers.
+
+Since lighttpd 1.4.56, mod_deflate subsumes and replaces mod_compress.
+mod_deflate can compress static and dynamic responses, while
+mod_compress could compress only static files.
%description mod_deflate -l pl.UTF-8
mod_deflate potrafi kompresować statyczne i dynamiczne wyjście z
%description mod_magnet -l pl.UTF-8
mod_magnet to moduł sterujący obsługą żądań w lighty.
+%package mod_maxminddb
+Summary: lighttpd module
+Group: Networking/Daemons/HTTP
+#URL: https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModGeoip
+Requires: %{name} = %{version}-%{release}
+
+%description mod_maxminddb
+
%package mod_mysql_vhost
Summary: lighttpd module for MySQL based vhosting
Summary(pl.UTF-8): Moduł lighttpd obsługujący vhosty oparte na MySQL-u
%description mod_simple_vhost -l pl.UTF-8
Moduł lighttpd do prostych hostów wirtualnych.
+%package mod_sockproxy
+Summary: Transparent socket proxy
+Group: Networking/Daemons/HTTP
+URL: https://redmine.lighttpd.net/projects/lighttpd/wiki/Docs_ModSockProxy
+Requires: %{name} = %{version}-%{release}
+
+%description mod_sockproxy
+mod_sockproxy is a transparent socket proxy. For a given $SERVER["socket"]
+config, connections will be forwarded to backend(s) without any
+interpretation of the protocol.
+
%package mod_ssi
Summary: lighttpd module for server-side includes
Summary(pl.UTF-8): Moduł lighttpd do SSI (server-side includes)
%prep
%setup -q
#%patch100 -p1
-%patch0 -p1
#%patch1 -p1 UPDATE (and submit upstream!) if you need this
%{?with_h264_streaming:%patch2 -p1}
%patch3 -p1
%patch4 -p1
-%patch6 -p1
-#%patch7 -p1 probably fixed upstream
+%patch5 -p1
rm -f src/mod_ssi_exprparser.h # bad patching: should be removed by is emptied instead
%{__automake}
%configure \
- --libdir=%{pkglibdir} \
%{!?with_ipv6:--disable-ipv6} \
%{!?with_largefile:--disable-lfs} \
- %{?with_valgrind:--with-valgrind} \
- %{?with_xattr:--with-attr} \
- %{?with_krb5:--with-krb5} \
+ %{?with_brotli:--with-brotli} \
+ %{?with_bzip2:--with-bzip2} \
+ %{?with_dbi:--with-dbi} \
+ %{?with_gamin:--with-gamin} \
%{?with_geoip:--with-geoip} \
- %{?with_mysql:--with-mysql} \
+ %{?with_krb5:--with-krb5} \
%{?with_ldap:--with-ldap} \
- %{?with_ssl:--with-openssl} \
%{?with_lua:--with-lua=lua51} \
+ %{?with_maxminddb:--with-maxminddb} \
+ %{?with_mysql:--with-mysql} \
+ %{?with_pgsql:--with-pgsql} \
+ %{?with_ssl:--with-openssl} \
+ %{?with_storage_gdbm:--with-gdbm} \
%{?with_storage_memcached:--with-memcached} \
- %{?with_webdav_props:--with-webdav-props} \
+ %{?with_valgrind:--with-valgrind} \
%{?with_webdav_locks:--with-webdav-locks} \
- %{?with_gamin:--with-gamin} \
- %{?with_storage_gdbm:--with-gdbm}
+ %{?with_webdav_props:--with-webdav-props} \
+ %{?with_xattr:--with-attr} \
+ --libdir=%{pkglibdir}
# -j1 as src/mod_ssi_exprparser.h regeneration deps are broken
%{__make} -j1
$RPM_BUILD_ROOT{/var/log/{%{name},archive/%{name}},/var/run/%{name}} \
$RPM_BUILD_ROOT%{_datadir}/lighttpd/errordocs \
$RPM_BUILD_ROOT/var/lib/lighttpd \
- $RPM_BUILD_ROOT/var/cache/lighttpd/mod_compress \
$RPM_BUILD_ROOT{%{systemdtmpfilesdir},%{systemdunitdir}}
%{__make} install \
%if %{with geoip}
cp -p %{SOURCE140} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/50_mod_geoip.conf
%endif
+%if %{with maxminddb}
+cp -p %{SOURCE147} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/50_mod_maxminddb.conf
+%endif
%if %{with ldap}
cp -p %{SOURCE141} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/50_mod_authn_ldap.conf
%endif
%if %{with mysql}
cp -p %{SOURCE133} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/50_mod_mysql_vhost.conf
%endif
+cp -p %{SOURCE146} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/50_mod_sockproxy.conf
cp -p %{SOURCE134} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/55_mod_magnet.conf
cp -p %{SOURCE111} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/55_mod_expire.conf
-cp -p %{SOURCE106} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/60_mod_compress.conf
-
cp -p %{SOURCE101} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/90_mod_accesslog.conf
cp -p %{SOURCE135} $RPM_BUILD_ROOT%{_sysconfdir}/conf.d/91_mod_extforward.conf
touch $RPM_BUILD_ROOT/var/lib/lighttpd/lighttpd.rrd
install -d $RPM_BUILD_ROOT/etc/tmpwatch
-cp -p %{SOURCE138} $RPM_BUILD_ROOT/etc/tmpwatch/lighttpd-mod_compress.conf
touch $RPM_BUILD_ROOT/var/log/%{name}/{access,error,breakage}.log
%module_scripts mod_authn_mysql
%module_scripts mod_cgi
%module_scripts mod_cml
-%module_scripts mod_compress
%module_scripts mod_deflate
%module_scripts mod_dirlisting
%module_scripts mod_evasive
%module_scripts mod_h264_streaming
%module_scripts mod_indexfile
%module_scripts mod_magnet
+%module_scripts mod_maxminddb
%module_scripts mod_mysql_vhost
%module_scripts mod_openssl
%module_scripts mod_proxy
%module_scripts mod_secdownload
%module_scripts mod_setenv
%module_scripts mod_simple_vhost
+%module_scripts mod_sockproxy
%module_scripts mod_ssi
%module_scripts mod_staticfile
%module_scripts mod_status
# rrdtool database is stored there
%dir %attr(771,root,lighttpd) /var/lib/lighttpd
-# mod_compress can put cached files there
-%dir /var/cache/lighttpd
-
%files mod_access
%defattr(644,root,root,755)
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*mod_access.conf
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*mod_cml.conf
%attr(755,root,root) %{pkglibdir}/mod_cml.so
-%files mod_compress
-%defattr(644,root,root,755)
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) /etc/tmpwatch/lighttpd-mod_compress.conf
-%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*mod_compress.conf
-%attr(755,root,root) %{pkglibdir}/mod_compress.so
-%dir %attr(775,root,lighttpd) /var/cache/lighttpd/mod_compress
-
%files mod_deflate
%defattr(644,root,root,755)
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*mod_deflate.conf
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*mod_magnet.conf
%attr(755,root,root) %{pkglibdir}/mod_magnet.so
+%if %{with maxminddb}
+%files mod_maxminddb
+%defattr(644,root,root,755)
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*mod_maxminddb.conf
+%attr(755,root,root) %{pkglibdir}/mod_maxminddb.so
+%endif
+
%if %{with mysql}
%files mod_mysql_vhost
%defattr(644,root,root,755)
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*mod_simple_vhost.conf
%attr(755,root,root) %{pkglibdir}/mod_simple_vhost.so
+%files mod_sockproxy
+%defattr(644,root,root,755)
+%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*mod_sockproxy.conf
+%attr(755,root,root) %{pkglibdir}/mod_sockproxy.so
+
%files mod_ssi
%defattr(644,root,root,755)
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*mod_ssi.conf
%defattr(644,root,root,755)
%attr(640,root,root) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/conf.d/*mod_vhostdb.conf
%attr(755,root,root) %{pkglibdir}/mod_vhostdb.so
+# TODO: subpackages
+%if %{with dbi}
+%attr(755,root,root) %{pkglibdir}/mod_vhostdb_dbi.so
+%endif
%if %{with ldap}
%attr(755,root,root) %{pkglibdir}/mod_vhostdb_ldap.so
%endif
%if %{with mysql}
%attr(755,root,root) %{pkglibdir}/mod_vhostdb_mysql.so
%endif
+%if %{with pgsql}
+%attr(755,root,root) %{pkglibdir}/mod_vhostdb_pgsql.so
+%endif
%files mod_webdav
%defattr(644,root,root,755)