Accepting request 241749 from server:http

1

OBS-URL: https://build.opensuse.org/request/show/241749
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/thttpd?expand=0&rev=31
This commit is contained in:
Stephan Kulow 2014-07-21 19:40:29 +00:00 committed by Git OBS Bridge
commit 5a78415803
3 changed files with 58 additions and 16 deletions

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Fri Jul 18 16:40:22 UTC 2014 - p.drouand@gmail.com
- Use systemd instead of sysvinit in openSUSE > 12.2
------------------------------------------------------------------- -------------------------------------------------------------------
Tue Dec 3 14:31:18 UTC 2013 - vcizek@suse.com Tue Dec 3 14:31:18 UTC 2013 - vcizek@suse.com

10
thttpd.service Normal file
View File

@ -0,0 +1,10 @@
[Unit]
Description=Tiny HTTP Daemon
[Service]
PIDFile=/run/thttpd.pid
ExecStart=/usr/bin/thttpd -D -C /etc/thttpd.conf
Restart=always
[Install]
WantedBy=multi-user.target

View File

@ -1,7 +1,7 @@
# #
# spec file for package thttpd # spec file for package thttpd
# #
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
# #
# All modifications and additions to the file contributed by third parties # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # remain the property of their copyright owners, unless otherwise agreed
@ -15,14 +15,26 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/ # 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 Name: thttpd
Provides: http_daemon Provides: http_daemon
PreReq: %fillup_prereq %insserv_prereq permissions %if %{with_systemd}
BuildRequires: systemd
%{?systemd_requires}
%else
PreReq: %fillup_prereq %insserv_prereq
%endif
PreReq: permissions
Version: 2.25b Version: 2.25b
Release: 0 Release: 0
Source: %{name}-%{version}.tar.bz2 Source: %{name}-%{version}.tar.bz2
Source1: %{name}-SuSE.tar.bz2 Source1: %{name}-SuSE.tar.bz2
Source2: %{name}.service
Patch0: %{name}-%{version}-configure.patch Patch0: %{name}-%{version}-configure.patch
Patch1: %{name}-%{version}-dirs.patch Patch1: %{name}-%{version}-dirs.patch
Patch2: %{name}-%{version}-time_h.patch Patch2: %{name}-%{version}-time_h.patch
@ -55,12 +67,6 @@ in memory use. Basic support for cgi scripts, authentication, and ssi
is provided for. Advanced features include the ability to throttle is provided for. Advanced features include the ability to throttle
traffic. traffic.
Authors:
--------
jef@acme.com
%define serverroot /srv/www %define serverroot /srv/www
%prep %prep
@ -96,11 +102,7 @@ libtoolize --force
aclocal --force aclocal --force
autoconf -f autoconf -f
V_CCOPT="$RPM_OPT_FLAGS -Wall" \ V_CCOPT="$RPM_OPT_FLAGS -Wall" \
./configure \ %configure
--mandir=%{_mandir} \
--prefix=%{_prefix} \
--infodir=%{_infodir} \
--sysconfdir=%{_sysconfdir}
%ifarch s390 s390x %ifarch s390 s390x
make F_PIE="-fPIE" make F_PIE="-fPIE"
%else %else
@ -116,9 +118,25 @@ install -d %{buildroot}/usr/bin \
make DESTDIR=%{buildroot} install make DESTDIR=%{buildroot} install
cp -a SuSE/* %{buildroot} cp -a SuSE/* %{buildroot}
rm -f %{buildroot}%{serverroot}/htdocs/index.html rm -f %{buildroot}%{serverroot}/htdocs/index.html
%if %{with_systemd}
rm -rf %{buildroot}/etc/init.d
rm %{buildroot}%{_sbindir}/rc%{name}
mkdir -p %{buildroot}%{_unitdir}
install -m 644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rc%{name}
%endif
%if %{with_systemd}
%pre
%service_add_pre %{name}.service
%endif
%post %post
%if %{with_systemd}
%service_add_post %{name}.service
%else
%{fillup_and_insserv thttpd} %{fillup_and_insserv thttpd}
%endif
%if 0%{?suse_version} <= 1130 %if 0%{?suse_version} <= 1130
%run_permissions %run_permissions
%else %else
@ -129,14 +147,19 @@ rm -f %{buildroot}%{serverroot}/htdocs/index.html
%verify_permissions -e /usr/bin/makeweb %verify_permissions -e /usr/bin/makeweb
%preun %preun
%if %{with_systemd}
%service_del_preun %{name}.service
%else
%stop_on_removal thttpd %stop_on_removal thttpd
%endif
%postun %postun
%if %{with_systemd}
%service_del_postun %{name}.service
%else
%restart_on_update thttpd %restart_on_update thttpd
%{insserv_cleanup} %{insserv_cleanup}
%endif
%clean
rm -rf "%{buildroot}"
%files %files
%defattr(-, root, root) %defattr(-, root, root)
@ -147,7 +170,11 @@ rm -rf "%{buildroot}"
/usr/bin/htpasswd /usr/bin/htpasswd
/usr/sbin/* /usr/sbin/*
/usr/share/man/*/* /usr/share/man/*/*
%if %{with_systemd}
%{_unitdir}/%{name}.service
%else
%config /etc/init.d/thttpd %config /etc/init.d/thttpd
%endif
%config(noreplace) /etc/thttpd.conf %config(noreplace) /etc/thttpd.conf
%changelog %changelog