# # spec file for package thttpd # # Copyright (c) 2014 SUSE LINUX Products 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/ # %if 0%{?suse_version} > 1220 %define with_systemd 1 %else %define with_systemd 0 %endif Name: thttpd Version: 2.26 Release: 0 Summary: Small and very simple webserver License: BSD-3-Clause Group: Productivity/Networking/Web/Servers Url: http://www.acme.com/software/thttpd/ Source: %{name}-%{version}.tar.gz Source1: %{name}-SuSE.tar.bz2 Source2: %{name}.service Patch0: %{name}-2.25b-configure.patch Patch1: %{name}-2.25b-dirs.patch Patch2: %{name}-2.25b-time_h.patch Patch3: %{name}-2.25b-newautoconf.patch Patch4: %{name}-2.25b-sec.patch Patch5: %{name}-2.25b-static.patch Patch6: %{name}-2.25b-pie.patch Patch7: %{name}-2.25b-syslogtocern.diff Patch8: %{name}-2.25b-overflow.diff Patch9: %{name}-2.25b-chown.diff Patch10: %{name}-2.25b-zerolen.patch Patch11: %{name}-2.25b-strcpy.patch # PATCH-FIX-SUSE CVE-2012-5640 Patch13: thttpd-2.25b-CVE-2012-5640-check_crypt_return_value.patch Patch14: thttpd-CVE-2013-0348.patch Patch15: thttpd-crypt_is_in_crypt.h.patch BuildRequires: automake BuildRequires: libtool Requires(post): permissions Provides: http_daemon BuildRoot: %{_tmppath}/%{name}-%{version}-build %if %{with_systemd} BuildRequires: systemd %{?systemd_requires} %else Requires(post): %fillup_prereq Requires(post): %insserv_prereq %endif %description Thttpd is a very compact no-frills httpd serving daemon that can handle very high loads. While lacking many of the advanced features of Roxen or Apache, thttpd operates without forking and is extremely efficient in memory use. Basic support for cgi scripts, authentication, and ssi is provided for. Advanced features include the ability to throttle traffic. %define serverroot /srv/www %prep %setup -q -a 1 %patch0 %patch1 %patch2 %patch3 %patch4 %patch5 %patch6 %patch7 %patch8 %patch9 %patch10 %patch11 %patch13 -p1 %patch14 -p1 %patch15 -p1 %build cp %{_datadir}/automake-1.*/config.* . # update server root path sed -i "s@__SRVROOT__@%{serverroot}/htdocs@g" README.SuSE SuSE%{_sysconfdir}/thttpd.conf sed -i "s@__PREFIX__@%{_prefix}@g;\ s@__SYSCONFDIR__@%{_sysconfdir}@g;\ s@__NAME__@%{name}@g;\ s@__VERSION__@%{version}@g" SuSE%{_initddir}/thttpd chmod 744 SuSE%{_initddir}/thttpd chmod 644 SuSE%{_sysconfdir}/thttpd.conf mv aclocal.m4 acinclude.m4 libtoolize --force aclocal --force autoconf -f V_CCOPT="%{optflags} -Wall" \ %configure %ifarch s390 s390x make F_PIE="-fPIE" %{?_smp_mflags} %else make F_PIE="-fpie" %{?_smp_mflags} %endif %install install -d %{buildroot}%{_bindir} \ %{buildroot}%{_sbindir} \ %{buildroot}%{_mandir}/man1 \ %{buildroot}%{_mandir}/man8 \ %{buildroot}%{serverroot}/htdocs/users make DESTDIR=%{buildroot} install %{?_smp_mflags} cp -a SuSE/* %{buildroot} rm -f %{buildroot}%{serverroot}/htdocs/index.html %if %{with_systemd} rm -rf %{buildroot}%{_sysconfdir}/init.d rm %{buildroot}%{_sbindir}/rc%{name} mkdir -p %{buildroot}%{_unitdir} install -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name} %endif %if %{with_systemd} %pre %service_add_pre %{name}.service %endif %post %if %{with_systemd} %service_add_post %{name}.service %else %{fillup_and_insserv thttpd} %endif %if 0%{?suse_version} <= 1130 %run_permissions %else %set_permissions %{_bindir}/makeweb %endif %verifyscript %verify_permissions -e %{_bindir}/makeweb %preun %if %{with_systemd} %service_del_preun %{name}.service %else %stop_on_removal thttpd %endif %postun %if %{with_systemd} %service_del_postun %{name}.service %else %restart_on_update thttpd %insserv_cleanup %endif %files %defattr(-, root, root) %doc README README.SuSE config.h %{serverroot}/htdocs/* %attr(775, root, www) %{serverroot}/htdocs/users %verify(not mode) %attr(2750, root, www) %{_bindir}/makeweb %{_bindir}/htpasswd %{_sbindir}/* %{_mandir}/*/* %if %{with_systemd} %{_unitdir}/%{name}.service %else %config %{_initddir}/thttpd %endif %config(noreplace) %{_sysconfdir}/thttpd.conf %changelog