File lighttpd2.spec of Package lighttpd2
#
# spec file for package lighttpd
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
%if 0%{?suse_version} > 1230
%bcond_without systemd
%else
%bcond_with systemd
%endif
%ifarch s390x ppc64
%bcond_with libunwind
%else
%bcond_without libunwind
%endif
%if 0%{?suse_version} >= 1130
%bcond_without check
%else
%bcond_with check
%endif
Name: lighttpd2
Version: 2.0.0~snap_20210228_191007_g850aea
Release: 0
#
%define tarball_version 2.0.0~snap-20210228-191007-g850aea
%define pkg_name lighttpd
%define pkg_version 2.0.0
#
%define pkg_user lighttpd
%define pkg_home /var/lib/%{name}
%define _libexecdir %{_prefix}/lib
#
Group: Productivity/Networking/Web/Servers
License: BSD-3-Clause
#
BuildRoot: %{_tmppath}/%{name}-%{version}-build
# tarball is xz
BuildRequires: xz
%if 0%{?suse_version} >= 1120
BuildRequires: git
%endif
BuildRequires: glib2-devel >= 2.16
BuildRequires: ragel6
BuildRequires: libev-devel
%if 0%{?suse_version} && 0%{?suse_version} < 1030 || 0%{?suse_version} > 1210
BuildRequires: lua51-devel
%else
BuildRequires: lua-devel >= 5.1
BuildRequires: lua-devel < 5.2
%endif
BuildRequires: zlib-devel
BuildRequires: libbz2-devel
BuildRequires: openssl-devel
%if 0%{?suse_version} >= 1100
BuildRequires: libgnutls-devel
%endif
%if %{with libunwind}
BuildRequires: libunwind-devel
%endif
%if %{with check}
# needed for make check
BuildRequires: python3 python3-pycurl
# otherwise it skips the fastcgi checks
BuildRequires: fcgi-cgi
%endif
#
%if %{with systemd}
BuildRequires: pkgconfig(systemd)
%{?systemd_requires}
%endif
#
Url: http://redmine.lighttpd.net/projects/lighttpd2/wiki
Source: %{name}_%{tarball_version}.orig.tar.xz
#
Summary: Lighttpd 2 snapshot build
%description
Lighttpd 2.0 is work in progress - it is not finished and should
not be used in a production environment We do not provide any
support for it until it is somewhat complete and ready for testing.
Do NOT ask questions in the lighttpd forum. Thanks for
understanding.
%package devel
Group: Development/Languages/C and C++
Requires: %{name} = %{version}
Requires: glib2-devel >= 2.16
#
Summary: Development files to develop for lighttpd 2
%description devel
Lighttpd 2.0 is work in progress - it is not finished and should
not be used in a production environment We do not provide any
support for it until it is somewhat complete and ready for testing.
Do NOT ask questions in the lighttpd forum. Thanks for
understanding.
This package holds the files to develop for/against lighttpd 2
%prep
%setup -n %{pkg_name}-%{pkg_version}
%build
#autoreconf -fi
export CFLAGS="%{optflags} -DPACKAGE_NO_BUILD_DATE"
%configure \
%if 0%{?suse_version} >= 1100
--with-gnutls \
%endif
--with-lua \
--with-kerberos5 \
--with-openssl \
%if %{with libunwind}
--with-libunwind \
%endif
--with-zlib \
--with-bzip2
make %{?_smp_flags}
%if %{with check}
%check
make check
%endif
%install
make install DESTDIR="%{buildroot}"
find %{buildroot} -name \*.la -delete -print
#
%{__install} -d -m 0755 \
%{buildroot}%{pkg_home}/sockets/ \
%{buildroot}%{_var}/cache/%{name}/compress \
%{buildroot}%{_var}/log/%{name} \
%{buildroot}%{_sysconfdir}/%{name}
%if %{with systemd}
install -D -m 0644 contrib/systemd/%{name}.service %{buildroot}%{_unitdir}/%{name}.service
%{__ln_s} -f %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
%endif
%clean
%{__rm} -rf %{buildroot}
%pre
/usr/sbin/groupadd -r %{pkg_user} &>/dev/null ||:
/usr/sbin/useradd -g %{pkg_user} -s /bin/false -r -c "user for %{pkg_user}" -d %{pkg_home} %{pkg_user} &>/dev/null ||:
%if %{with systemd}
%service_add_pre %{name}.service
%preun
%service_del_preun %{name}.service
%post
%service_add_post %{name}.service
%postun
%service_del_postun %{name}.service
%endif
%files
%defattr(-,root,root,-)
%{_sbindir}/lighttpd2
%dir %{_libexecdir}/lighttpd2/
%{_libexecdir}/lighttpd2/lighttpd2-worker
%{_libdir}/lighttpd-2.0.0/
%{_libdir}/liblighttpd2-common-2.0.0.so
%{_libdir}/liblighttpd2-shared-2.0.0.so
%{_libdir}/liblighttpd2-sharedangel-2.0.0.so
%{_mandir}/man8/lighttpd2.8*
%{_mandir}/man8/lighttpd2-worker.8*
%doc contrib/default.html
%doc contrib/*.conf
%doc contrib/service
%doc COPYING
#
%dir %attr(751,root,%{pkg_user}) %{_sysconfdir}/%{name}
%dir %attr(751,%{pkg_user},%{pkg_user}) %{pkg_home}/
%dir %attr(751,%{pkg_user},%{pkg_user}) %{pkg_home}/sockets/
%attr(751,%{pkg_user},%{pkg_user}) %{_var}/cache/%{name}/
%attr(751,%{pkg_user},%{pkg_user}) %{_var}/cache/%{name}/compress/
%dir %attr(750,%{pkg_user},%{pkg_user}) %{_var}/log/%{name}/
%{_datadir}/lighttpd2/
%if %{with systemd}
%{_sbindir}/rc%{name}
%{_unitdir}/%{name}.service
%endif
%files devel
%defattr(-,root,root,-)
%{_includedir}/lighttpd/
%{_libdir}/pkgconfig/lighttpd2.pc
%{_libdir}/liblighttpd2-common.so
%{_libdir}/liblighttpd2-shared.so
%{_libdir}/liblighttpd2-sharedangel.so
%changelog