Accepting request 312678 from home:thehejik:branches:server:http

Please check and forward to Factory, requested by bnc#899218

- package cleanup (bnc#899218)
  * removed SUSE branding
  * added logrotate support
  * changed note about default codepage

OBS-URL: https://build.opensuse.org/request/show/312678
OBS-URL: https://build.opensuse.org/package/show/server:http/thttpd?expand=0&rev=31
This commit is contained in:
Vítězslav Čížek 2015-07-03 07:55:09 +00:00 committed by Git OBS Bridge
parent 65421b8b00
commit 9542aab497
6 changed files with 194 additions and 27 deletions

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:eee1ce423ec3f6ecd7bd4ceca7bef9cdf5a07f21fca5a8acbac8e152bdc26cbc
size 133331

86
thttpd-initd.script Normal file
View File

@ -0,0 +1,86 @@
#! /bin/sh
# Copyright (c) 1996-1999 SuSE Gmbh Nuernberg, Germany. All rights reserved.
#
# /etc/init.d/thttpd
#
### BEGIN INIT INFO
# Provides: thttpd
# Required-Start: $network $remote_fs $syslog
# Required-Stop: $network $remote_fs $syslog
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: thttpd
# Description: Starts the http daemon thttpd
### END INIT INFO
THTTPD_BIN=/usr/sbin/thttpd
test -x $THTTPD_BIN || exit 5
. /etc/rc.status
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - insufficient privilege
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signalling is not supported) are
# considered a success.
case "$1" in
start)
echo -n "Starting service thttpd"
startproc $THTTPD_BIN -C /etc/thttpd.conf
rc_status -v
;;
stop)
echo -n "Shutting down service thttpd"
killproc -TERM $THTTPD_BIN
rc_status -v
;;
try-restart)
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
$0 status >/dev/null && $0 restart
# Remember status and be quiet
rc_status
;;
force-reload)
## Stop the service and if this succeeds (i.e. the
## service was running before), start it again.
$0 stop && sleep 1 && $0 start
# Remember status and be quiet
rc_status
;;
restart)
$0 stop
sleep 1
$0 start
rc_status
;;
reload)
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for service thttpd: "
checkproc $THTTPD_BIN
rc_status -v
;;
probe)
#
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe}"
exit 1
esac
rc_exit

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Thu Jun 18 15:07:51 UTC 2015 - thehejik@suse.com
- package cleanup (bnc#899218)
* removed SUSE branding
* added logrotate support
* changed note about default codepage
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Jun 4 15:09:12 UTC 2015 - vcizek@suse.com Thu Jun 4 15:09:12 UTC 2015 - vcizek@suse.com

70
thttpd.conf Normal file
View File

@ -0,0 +1,70 @@
# thttpd.conf -- configuration file for thttpd
#
# The strategy used is similar to e.g. OpenSSH:
# specify options with their default value where possible,
# but leave them commented. Uncommented options change
# a default value. Parenthesis state the command line option
# Port to listen on (-p)
#port=80
# www root directory (-d)
dir=/srv/www/htdocs
# The eternal question whether to chroot() or not to chroot()
# into "dir" above. If you don't want thttpd to chroot() change
# the next line to "nochroot" (-r|-nor)
#chroot
# data directory in the chroot dir
# as the default configuration just chroots into "dir"
# we leave this unset. Use it for running more complex webs with
# thttpd (note, that at some point something more robust
# (e.g. apache)might be a better choice). (-dd)
#data_dir=
# Instructs thttpd to check whether symlinked documents really
# belong to the document tree. Disable with "nosymlinkcheck",
# although this is not recommended (-s|-nos)
#symlinkcheck
# "El-cheapo" webhosting, enable with "vhost" (-v|-nov)
#novhost
# Use server-global .htpasswd file (see man page). Enable with
# "globalpasswd" (-g|-nog)
#noglobalpasswd
# User to switch to after initialization when started as root
# (-u)
#user=wwwrun
# CGI scripts pattern (-c)
#cgipat=/cgi-bin/*|**.cgi
# File of throttle settings (-t) - see manpage
#throttles=
# Hostname to bind to for multihoming (-h)
#host=your.hostname.here
# Log-file; empty = use syslog(), /dev/null = without log. (-l)
logfile=/var/log/thttpd.log
# File to write the process-id to (-i), can be used for signalling
# thttpd
pidfile=/var/run/thttpd.pid
# Character set to use with text MIME types.
# Defaults to UTF-8 (-t)
#charset=
# P3P server privacy header is returned with all responses
# (see manpage). Use p3p to enable it (-P|-noP)
##
# seconds to be used in a "Cache-Control: max-age" header and
# generates equivalent Expires meta tag
#max_age=
# -- end of thttpd.conf

10
thttpd.logrotate Normal file
View File

@ -0,0 +1,10 @@
/var/log/thttpd.log {
compress
dateext
maxage 365
rotate 99
size=+4096k
notifempty
missingok
copytruncate
}

View File

@ -16,6 +16,7 @@
# #
%define serverroot /srv/www
%if 0%{?suse_version} > 1220 %if 0%{?suse_version} > 1220
%define with_systemd 1 %define with_systemd 1
%else %else
@ -29,8 +30,10 @@ License: BSD-3-Clause
Group: Productivity/Networking/Web/Servers Group: Productivity/Networking/Web/Servers
Url: http://www.acme.com/software/thttpd/ Url: http://www.acme.com/software/thttpd/
Source: %{name}-%{version}.tar.gz Source: %{name}-%{version}.tar.gz
Source1: %{name}-SuSE.tar.bz2 Source1: %{name}-initd.script
Source2: %{name}.service Source2: %{name}.service
Source3: %{name}.logrotate
Source4: %{name}.conf
Patch0: %{name}-2.25b-configure.patch Patch0: %{name}-2.25b-configure.patch
Patch1: %{name}-2.25b-dirs.patch Patch1: %{name}-2.25b-dirs.patch
Patch2: %{name}-2.25b-time_h.patch Patch2: %{name}-2.25b-time_h.patch
@ -50,9 +53,10 @@ Patch15: thttpd-crypt_is_in_crypt.h.patch
BuildRequires: automake BuildRequires: automake
BuildRequires: libtool BuildRequires: libtool
Requires(post): permissions Requires(post): permissions
Provides: http_daemon Recommends: logrotate
# both packages provide /usr/bin/htpasswd # both packages provide /usr/bin/htpasswd
Conflicts: apache2-utils Conflicts: apache2-utils
Provides: http_daemon
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{with_systemd} %if %{with_systemd}
BuildRequires: systemd BuildRequires: systemd
@ -70,10 +74,8 @@ 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.
%define serverroot /srv/www
%prep %prep
%setup -q -a 1 %setup -q
%patch0 %patch0
%patch1 %patch1
%patch2 %patch2
@ -92,24 +94,17 @@ traffic.
%build %build
cp %{_datadir}/automake-1.*/config.* . 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 mv aclocal.m4 acinclude.m4
libtoolize --force libtoolize --force
aclocal --force aclocal --force
autoconf -f autoconf -f
V_CCOPT="%{optflags} -Wall" \ export V_CCOPT="%{optflags}"
export CFLAGS="%{optflags}"
%configure %configure
%ifarch s390 s390x %ifarch s390 s390x
make F_PIE="-fPIE" %{?_smp_mflags} make F_PIE="-fPIE" -j1
%else %else
make F_PIE="-fpie" %{?_smp_mflags} make F_PIE="-fpie" -j1
%endif %endif
%install %install
@ -119,18 +114,18 @@ install -d %{buildroot}%{_bindir} \
%{buildroot}%{_mandir}/man8 \ %{buildroot}%{_mandir}/man8 \
%{buildroot}%{serverroot}/htdocs/users %{buildroot}%{serverroot}/htdocs/users
make DESTDIR=%{buildroot} install %{?_smp_mflags} make DESTDIR=%{buildroot} install %{?_smp_mflags}
cp -a SuSE/* %{buildroot} install -D -m0644 index.html %{buildroot}/%{serverroot}/htdocs/index.html
rm -f %{buildroot}%{serverroot}/htdocs/index.html install -D -m0644 %{SOURCE4} %{buildroot}%{_sysconfdir}/%{name}.conf
install -D -m0644 %{SOURCE3} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
%if %{with_systemd} %if %{with_systemd}
rm -rf %{buildroot}%{_sysconfdir}/init.d install -D -m0644 %{SOURCE2} %{buildroot}%{_unitdir}/%{name}.service
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} ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
%else
install -D -m0644 %{SOURCE1} %{buildroot}%{_initddir}/%{name}
ln -s %{buildroot}%{_initddir}/%{name} %{buildroot}%{_sbindir}/rc%{name}
%endif %endif
%if %{with_systemd} %if %{with_systemd}
%pre %pre
%service_add_pre %{name}.service %service_add_pre %{name}.service
%endif %endif
@ -167,13 +162,14 @@ ln -s %{_sbindir}/service %{buildroot}%{_sbindir}/rc%{name}
%files %files
%defattr(-, root, root) %defattr(-, root, root)
%doc README README.SuSE config.h %doc README config.h
%{serverroot}/htdocs/* %{serverroot}/htdocs/*
%attr(775, root, www) %{serverroot}/htdocs/users %attr(775, root, www) %{serverroot}/htdocs/users
%verify(not mode) %attr(2750, root, www) %{_bindir}/makeweb %verify(not mode) %attr(2750, root, www) %{_bindir}/makeweb
%{_bindir}/htpasswd %{_bindir}/htpasswd
%{_sbindir}/* %{_sbindir}/*
%{_mandir}/*/* %{_mandir}/*/*
%config %{_sysconfdir}/logrotate.d/%{name}
%if %{with_systemd} %if %{with_systemd}
%{_unitdir}/%{name}.service %{_unitdir}/%{name}.service
%else %else