2007-01-16 00:39:05 +01:00
|
|
|
#
|
2011-11-25 11:21:27 +01:00
|
|
|
# spec file for package thttpd
|
2007-01-16 00:39:05 +01:00
|
|
|
#
|
2017-08-04 02:57:10 +02:00
|
|
|
# Copyright (c) 2017 SUSE LINUX GmbH, Nuernberg, Germany.
|
2007-01-16 00:39:05 +01:00
|
|
|
#
|
2009-06-02 13:05:48 +02:00
|
|
|
# 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.
|
|
|
|
|
2007-01-16 00:39:05 +01:00
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
2014-09-09 16:51:18 +02:00
|
|
|
|
2015-07-03 09:55:09 +02:00
|
|
|
%define serverroot /srv/www
|
2014-07-21 15:48:59 +02:00
|
|
|
%if 0%{?suse_version} > 1220
|
|
|
|
%define with_systemd 1
|
|
|
|
%else
|
|
|
|
%define with_systemd 0
|
|
|
|
%endif
|
2007-01-16 00:39:05 +01:00
|
|
|
Name: thttpd
|
2017-08-04 02:57:10 +02:00
|
|
|
Version: 2.27
|
2012-03-09 12:33:10 +01:00
|
|
|
Release: 0
|
2014-09-09 16:51:18 +02:00
|
|
|
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
|
2015-07-03 09:55:09 +02:00
|
|
|
Source1: %{name}-initd.script
|
2014-07-21 15:48:59 +02:00
|
|
|
Source2: %{name}.service
|
2015-07-03 09:55:09 +02:00
|
|
|
Source3: %{name}.logrotate
|
|
|
|
Source4: %{name}.conf
|
2014-09-09 16:51:18 +02:00
|
|
|
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
|
2013-03-07 17:55:37 +01:00
|
|
|
# PATCH-FIX-SUSE CVE-2012-5640
|
|
|
|
Patch13: thttpd-2.25b-CVE-2012-5640-check_crypt_return_value.patch
|
2013-12-03 15:32:15 +01:00
|
|
|
Patch14: thttpd-CVE-2013-0348.patch
|
2014-09-09 16:51:18 +02:00
|
|
|
Patch15: thttpd-crypt_is_in_crypt.h.patch
|
2012-05-31 13:30:44 +02:00
|
|
|
BuildRequires: automake
|
|
|
|
BuildRequires: libtool
|
2014-09-09 16:51:18 +02:00
|
|
|
Requires(post): permissions
|
2015-07-03 09:55:09 +02:00
|
|
|
Recommends: logrotate
|
2015-10-14 14:18:32 +02:00
|
|
|
# both packages provide /srw/www/htdocs/index.html
|
|
|
|
Conflicts: apache2-example-pages
|
2017-08-04 02:57:10 +02:00
|
|
|
# both packages provide /usr/bin/htpasswd
|
|
|
|
Conflicts: apache2-utils
|
2015-07-03 09:55:09 +02:00
|
|
|
Provides: http_daemon
|
2014-09-09 16:51:18 +02:00
|
|
|
%if %{with_systemd}
|
|
|
|
BuildRequires: systemd
|
|
|
|
%{?systemd_requires}
|
|
|
|
%else
|
|
|
|
Requires(post): %fillup_prereq
|
|
|
|
Requires(post): %insserv_prereq
|
|
|
|
%endif
|
2007-01-16 00:39:05 +01:00
|
|
|
|
|
|
|
%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.
|
|
|
|
|
|
|
|
%prep
|
2015-07-03 09:55:09 +02:00
|
|
|
%setup -q
|
2007-01-16 00:39:05 +01:00
|
|
|
%patch0
|
|
|
|
%patch1
|
|
|
|
%patch2
|
|
|
|
%patch3
|
|
|
|
%patch4
|
|
|
|
%patch5
|
|
|
|
%patch6
|
|
|
|
%patch7
|
|
|
|
%patch8
|
2007-02-15 18:15:34 +01:00
|
|
|
%patch9
|
2007-02-16 19:27:31 +01:00
|
|
|
%patch10
|
2013-03-07 17:55:37 +01:00
|
|
|
%patch13 -p1
|
2013-12-03 15:32:15 +01:00
|
|
|
%patch14 -p1
|
2014-09-09 16:51:18 +02:00
|
|
|
%patch15 -p1
|
2007-01-16 00:39:05 +01:00
|
|
|
|
|
|
|
%build
|
2014-09-09 16:51:18 +02:00
|
|
|
cp %{_datadir}/automake-1.*/config.* .
|
2007-01-16 00:39:05 +01:00
|
|
|
mv aclocal.m4 acinclude.m4
|
|
|
|
libtoolize --force
|
|
|
|
aclocal --force
|
|
|
|
autoconf -f
|
2015-09-02 13:04:39 +02:00
|
|
|
export V_CCOPT="%{optflags} -fPIC -DPIC -fPIE"
|
|
|
|
export CFLAGS="%{optflags} -fPIC -DPIC -fPIE"
|
|
|
|
export LDFLAGS="-pie -Wl,-z,relro,-z,now"
|
2014-07-21 15:48:59 +02:00
|
|
|
%configure
|
2017-08-04 02:57:10 +02:00
|
|
|
# parallel build causes problems, single thread build takes only 10s anyway
|
|
|
|
make -j1
|
2007-01-16 00:39:05 +01:00
|
|
|
|
|
|
|
%install
|
2014-09-09 16:51:18 +02:00
|
|
|
install -d %{buildroot}%{_bindir} \
|
|
|
|
%{buildroot}%{_sbindir} \
|
2007-06-05 22:07:35 +02:00
|
|
|
%{buildroot}%{_mandir}/man1 \
|
|
|
|
%{buildroot}%{_mandir}/man8 \
|
|
|
|
%{buildroot}%{serverroot}/htdocs/users
|
2017-08-04 02:57:10 +02:00
|
|
|
%make_install
|
2015-07-03 09:55:09 +02:00
|
|
|
install -D -m0644 index.html %{buildroot}/%{serverroot}/htdocs/index.html
|
|
|
|
install -D -m0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/%{name}.conf
|
|
|
|
install -D -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
|
2014-07-21 15:48:59 +02:00
|
|
|
%if %{with_systemd}
|
2015-07-03 09:55:09 +02:00
|
|
|
install -D -m0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
|
2014-09-09 16:51:18 +02:00
|
|
|
ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
|
2015-07-03 09:55:09 +02:00
|
|
|
%else
|
|
|
|
install -D -m0644 %{SOURCE1} %{buildroot}%{_initddir}/%{name}
|
|
|
|
ln -s %{buildroot}%{_initddir}/%{name} %{buildroot}%{_sbindir}/rc%{name}
|
2014-07-21 15:48:59 +02:00
|
|
|
%endif
|
|
|
|
|
|
|
|
%if %{with_systemd}
|
2014-09-09 16:51:18 +02:00
|
|
|
%pre
|
2014-07-21 15:48:59 +02:00
|
|
|
%service_add_pre %{name}.service
|
|
|
|
%endif
|
2007-01-16 00:39:05 +01:00
|
|
|
|
|
|
|
%post
|
2014-07-21 15:48:59 +02:00
|
|
|
%if %{with_systemd}
|
|
|
|
%service_add_post %{name}.service
|
|
|
|
%else
|
2007-01-16 00:39:05 +01:00
|
|
|
%{fillup_and_insserv thttpd}
|
2014-07-21 15:48:59 +02:00
|
|
|
%endif
|
2014-09-09 16:51:18 +02:00
|
|
|
%set_permissions %{_bindir}/makeweb
|
2012-06-12 09:09:31 +02:00
|
|
|
|
2007-01-16 00:39:05 +01:00
|
|
|
%verifyscript
|
2014-09-09 16:51:18 +02:00
|
|
|
%verify_permissions -e %{_bindir}/makeweb
|
2007-01-16 00:39:05 +01:00
|
|
|
|
|
|
|
%preun
|
2014-07-21 15:48:59 +02:00
|
|
|
%if %{with_systemd}
|
|
|
|
%service_del_preun %{name}.service
|
|
|
|
%else
|
2007-01-16 00:39:05 +01:00
|
|
|
%stop_on_removal thttpd
|
2014-07-21 15:48:59 +02:00
|
|
|
%endif
|
2007-01-16 00:39:05 +01:00
|
|
|
|
|
|
|
%postun
|
2014-07-21 15:48:59 +02:00
|
|
|
%if %{with_systemd}
|
|
|
|
%service_del_postun %{name}.service
|
|
|
|
%else
|
2007-01-16 00:39:05 +01:00
|
|
|
%restart_on_update thttpd
|
2014-09-09 16:51:18 +02:00
|
|
|
%insserv_cleanup
|
2014-07-21 15:48:59 +02:00
|
|
|
%endif
|
2007-01-16 00:39:05 +01:00
|
|
|
|
|
|
|
%files
|
2015-07-03 09:55:09 +02:00
|
|
|
%doc README config.h
|
2009-06-02 13:05:48 +02:00
|
|
|
%{serverroot}/htdocs/*
|
2007-01-16 00:39:05 +01:00
|
|
|
%attr(775, root, www) %{serverroot}/htdocs/users
|
2014-09-09 16:51:18 +02:00
|
|
|
%verify(not mode) %attr(2750, root, www) %{_bindir}/makeweb
|
|
|
|
%{_bindir}/htpasswd
|
|
|
|
%{_sbindir}/*
|
|
|
|
%{_mandir}/*/*
|
2015-07-03 09:55:09 +02:00
|
|
|
%config %{_sysconfdir}/logrotate.d/%{name}
|
2014-07-21 15:48:59 +02:00
|
|
|
%if %{with_systemd}
|
|
|
|
%{_unitdir}/%{name}.service
|
|
|
|
%else
|
2014-09-09 16:51:18 +02:00
|
|
|
%config %{_initddir}/thttpd
|
2014-07-21 15:48:59 +02:00
|
|
|
%endif
|
2014-09-09 16:51:18 +02:00
|
|
|
%config(noreplace) %{_sysconfdir}/thttpd.conf
|
2007-01-16 00:39:05 +01:00
|
|
|
|
2007-02-16 19:27:31 +01:00
|
|
|
%changelog
|