File yaws.spec of Package yaws

# norootforbuild

Name:           yaws
Version:        1.96
Release:        0
#
%define pkg_name yaws
#
Group:          Productivity/Networking/Web/Servers
License:        BSD-3-Clause
#
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildRequires:  pam-devel
BuildRequires:  erlang
%define yaws_var /srv
#
URL:            http://yaws.hyber.org/
Source0:        http://yaws.hyber.org/download/%{name}-%{version}.tar.gz
Patch0:         lsb.patch
# for now de-activate treating warnings as errors until a fix for R16B01
# is integrated into a new yaws release for the following warning:
# crypto:sha/1 is deprecated and will be removed in in a future release; use crypto:hash/2
Patch1:         no-werror.patch
#
Summary:        A high performance HTTP 1.1 webserver
%description
Yaws is a HTTP high perfomance 1.1 webserver particularly 
well suited for dynamic-content webapplications. Two separate 
modes of operations are supported.

* Standalone mode where Yaws runs as a regular webserver daemon. 
  This is the default mode.
* Embedded mode where Yaws runs as an embedded webserver in another 
  erlang application

%prep
%setup -q %{name}-%{version}
%patch0 -p1
%patch1 -p2
rm ebin/.empty

%build
export CFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
export CXXFLAGS="$RPM_OPT_FLAGS -fno-strict-aliasing"
%configure \
    --with-ssl=%{_prefix} \
    --with-defaultcharset=UTF-8 \
    --localstatedir=%{yaws_var}
%{__make} BINDIR=%{_bindir} LIBDIR=%{_libdir}

%install
%makeinstall BINDIR=%{_bindir} LIBDIR=%{_libdir} INSTALL_PREFIX=%{buildroot}
%{__install} -D -m 0755 scripts/suse/yaws.init.d %{buildroot}%{_sysconfdir}/init.d/%{pkg_name}
mkdir -p %{buildroot}%{_sbindir}
ln -sf %{_sysconfdir}/init.d/%{pkg_name} %{buildroot}%{_sbindir}/rc%{pkg_name}

%clean
%{__rm} -rf %{buildroot}

%preun
%stop_on_removal %{pkg_name}

%postun
%restart_on_update %{pkg_name}
%insserv_cleanup

%files
%defattr(-,root,root)
%doc README ChangeLog
%{_bindir}/*
%config(noreplace) %{_sysconfdir}/%{name}/%{name}-*.pem
%config(noreplace) %{_sysconfdir}/%{name}/%{name}.conf
%{_sysconfdir}/init.d/%{pkg_name}
%{_sysconfdir}/%{pkg_name}
%{_libdir}/%{name}
%{_mandir}/man1/%{name}.1.*
%{_mandir}/man5/%{name}*.5.*
%{_sbindir}/rc%{pkg_name}
%{yaws_var}/%{name}
%{_libdir}/pkgconfig/%{name}.pc


%changelog
* Thu Jan 3 2013 kruber@zib.de 1.96
- version bump to 1.96
 - Websocket release, lots of work and rewrites of the websocket code which
   is now topnotch.
 - Handle relative paths when Yaws is started in embedded mode (capflam)
 - ensure compatibility with Erlang R13B04 (steve)
 - Handle case with DOS attack towards pam login with embedded NUL chars in
   username or password. The protocol cannot handle NUL chars and Yaws dies
   (klacke)
 - Extend syntax of redirect block to allow an optional status code. (capflam)
 - Support multipart/form-data "name" with backslash at the end.
   (Johannes Weiss)
 - Make be possible to chain appmods (capflam)
 - Flush remaining data in case of 3xx redirect (capflam)
 - Add support of the 'Vary' header in response (capflam)
 - Add access functions for #gconf{} and #sconf{} records (capflam)
 - Refactor WebSockets and add support of optional callback functions
   (capflam)
- (temporarily) disable treating warnings as errors for R16B01
- do not package .empty file
- fix license in rpm meta
- add missing preun and postun sections
- add missing /usr/sbin/rcyaws symlink
* Thu Jan 3 2013 kruber@zib.de 1.95
- version bump to 1.95
* Fri Jun 1 2012 ghaskins@novell.com 1.92
- version bump to 1.92
* Thu Aug 12 2010 ghaskins@novell.com
- fix LSB header in ./scripts/suse/yaws.init.d
* Fri Jun  4 2010 alex@simonov.in.ua 1.88
- version bump to 1.88
* Thu Aug 27 2009 alex@simonov.in.ua 1.84
- add patch for starting embedded server. Thanks to Dmitry Nezhinsky.
* Sat Aug 15 2009 alex@simonov.in.ua 1.84
- version bump to 1.84
* Fri Apr 24 2009 alex@simonov.in.ua 1.81
- version bump to 1.81
 - Several cleanups by Hans Ulrich Niedermann, file perms, speling errors etc.
 - remove leading slash in yapp_appmods examples (Tom McNulty)
 - Add DIME support for SOAP Anders Nygren
 - patch by Jouni Ryno finding broken fdsrv support
 - Two patches by Joseph Wayen Norton, one dbg-bug and one providing better cookie support for yaws sesssions
 - When yaws_ctl checks the CTL file to see if any current instance is running, check the socket opened to the port read from the CTL file to verify that the ephemeral port for that socket is not the same as the port read from the CTL file. This avoids a false positive caused by connecting the socket to its own port. (Steve Vinoski)
 - cleaned up the redirect feature. It was poorly implemented and poorly documented. This fix is backwards compatible for users using redirect in confd.conf. However, it is NOT backwards compatible for embedded users that specify the redirect_map explicitly in their #sconf{} records. The required changes for embedded users should be evident from the code. The new required format is documented in the code where #sconf{} is defined (klacke)
 - Full windows support with a proper .exe Windows installer (klacke)
 - Added a timestamp check on the ssl cert/key files making it possible to just upload new cert/key files and do yaws --hup to automatically have the new cert/key files being used (klacke)
 - Disgusting DOS attack discovered by Manuel Duran Aguete whereby if a neverendig series of headers are sent to yaws, we die of out of memory. Actual attack not described here. Contact me (klacke) if you're interested in the details
 - and want a backport patch. I'm not reallu sure this is indeed the right procedure for announcing a DOS bug. (First time !!!)
 - init_db patch cleanup by Liu Yubao
 - patch by Liu Yubao to remove timeout in ssl accept
 - add pkg-config support contributed by Olivier Girondel
 - add --disable-sendfile option to configure, fix src/Makefile to clean yaws_configure.hrl (Steve)
 - set HEART_COMMAND to allow a maximum of 5 restarts within any 60 second period (Steve)
 - patch for queryparts that contain a question mark
 - Document the --wait-started option for the yaws script (Steve)
 - Fix the yaws script to allow --id ID to be passed after --wait-started (Steve)
 - Allow optional wait time to be specified to yaws via --wait-started= (Steve)
 - added kpoll as default
 - fix sendfile socket fd handling problems on 64-bit platforms (Steve)
 - cygwin build patch by Davide marques
 - stream content with a timeout patch from Davide Marques
 - traffic trace was broken for certain types of requsts - found by wde
* Tue Feb 10 2009 alex@simonov.in.ua 1.79
- version bump to 1.79
 - This release fixes the completely broken 1.78 release. So at last, we have good sendfile support.
 - traffic trace was broken for certain types of requsts - found by wde
 - Fixed several sendfile related bugs (vinoski)
 - Improved yaws supervision structure (klacke)
 - apply case-insensitive servername comparison patch from John Webb
* Wed Dec 24 2008 <alex@simonov.in.ua> 1.77-7
- move yaws www data to /srv/yaws for FHS 2.2 compatible
* Thu Nov 20 2008 <alex@simonov.in.ua> 1.77-7
- fix for build in OBS
* Wed Nov 19 2008 <alex@simonov.in.ua> 1.77-1
- initial build
openSUSE Build Service is sponsored by