Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > 0b91cf6ce22e2364f6c1be47ebb667b0 > files > 6

yaws-1.89-3.fc13.src.rpm

# We're in fact noarch
%global xdebug_package %{nil}

%bcond_without docs

Name:           yaws
Version:        1.89
Release:        3%{?dist}
Summary:        Web server for dynamic content written in Erlang
Group:          System Environment/Daemons
# BSD: see LICENSE
# ERPL: json.erl, benchmarks/bench.erl, benchmarks/bench.hrl,
#        benchmarks/all.erl, haxe.erl
# LGPLv2: test/ibrowse
# Copyright only: priv/soap.xsd, priv/wsdl.xsd
# W3C: priv/envelope.xsd
License:        BSD and ERPL and LGPLv2 and Copyright only and W3C
URL:            http://yaws.hyber.org/
Source0:        http://yaws.hyber.org/download/%{name}-%{version}.tar.gz
Source1:        yaws.logrotate
Patch0:         yaws-1.85-sysvinit.patch
Patch1:         yaws-1.88-fhs.patch
# backported from upstream
Patch3:		yaws-0003-Add-yaws_dime.erl-to-the-list-of-modules-to-compile.patch
BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)

BuildRequires:  erlang-erts
BuildRequires:  erlang-erlsom
BuildRequires:  erlang-kernel
BuildRequires:  erlang-mnesia
BuildRequires:  erlang-sasl
BuildRequires:  erlang-ssl
BuildRequires:  erlang-stdlib
BuildRequires:  pam-devel
%if %{with docs}
BuildRequires:  tex(latex)
BuildRequires:  tex(dvips)
BuildRequires:  latex2html
%endif

Requires:       erlang >= R13B
Requires:       erlang-erlsom
Requires:       erlang-ibrowse
Requires:       erlang-xmlrpc
Requires:       logrotate
Requires(post): chkconfig
Requires(preun): chkconfig


%description
HTTP 1.0 and HTTP 1.1 web server capable of both static content page
delivery and dynamic content generation using embedded Erlang code in the
HTML pages. It provides virtual hosting capabilities and implements
HTTP tracing and other debugging functionality such as interactive
interpreter environment. Performance can be boosted with built-in support
for RAM caching and streaming capabilities of dynamically generated
content. Among security features are SSL and support for WWW-Authenticated
pages.


%package devel
Summary:        Development Files for %{name}
Group:          Development/Libraries
Requires:       %{name} = %{version}-%{release}

%description devel
This package contains a pkg-config configuration for %{name}.


%prep
%setup -q
%patch0 -p1 -b .sysvinit
%patch1 -p1 -b .fhs
%patch3 -p1 -b .missing_module

# This requires egssapi which is not yet available
rm -f src/authmod_gssapi.erl

# Weird file name in Change Log is latin1-encoded
iconv -f iso8859-1 -t utf8 ChangeLog >ChangeLog.utf8
touch -r ChangeLog ChangeLog.utf8
mv ChangeLog.utf8 ChangeLog

# These are corrupted
find . -name '*.dia' -delete


%build
%configure --libdir=%{_libdir}/erlang/lib
make %{?_smp_mflags} all
%if %{with docs}
# fails to build with smp_mflags sometimes
make docs
%endif


%install
rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT

# Move init script to correct location
install -d $RPM_BUILD_ROOT%{_initrddir}
mv $RPM_BUILD_ROOT%{_sysconfdir}/init.d/yaws \
        $RPM_BUILD_ROOT%{_initrddir}/yaws
rmdir $RPM_BUILD_ROOT%{_sysconfdir}/init.d

# Logrotate configuration
install -d $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
install -p -m0644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/yaws

mkdir -p $RPM_BUILD_ROOT%{_libdir}
mv $RPM_BUILD_ROOT%{_libdir}/erlang/lib/pkgconfig $RPM_BUILD_ROOT%{_libdir}


%clean
rm -rf $RPM_BUILD_ROOT


%post
/sbin/chkconfig --add yaws


%preun
if [ $1 = 0 ]
then
        /sbin/service yaws stop >/dev/null 2>&1
        /sbin/chkconfig --del yaws
fi


%postun
if [ $1 -ge 1 ]
then
        /sbin/service yaws condrestart >/dev/null 2>&1 || :
fi


%files
%defattr(-,root,root,-)
%{_initrddir}/yaws
%dir %{_sysconfdir}/yaws
%config(noreplace) %{_sysconfdir}/yaws/yaws-cert.pem
%config(noreplace) %{_sysconfdir}/yaws/yaws-key.pem
%config(noreplace) %{_sysconfdir}/yaws/yaws.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/yaws
%dir %{_localstatedir}/log/%{name}
%{_localstatedir}/lib/yaws
%{_bindir}/yaws
%{_libdir}/erlang/lib/yaws
%exclude %{_libdir}/erlang/lib/yaws/ebin/.empty
%if %{with docs}
%doc doc/yaws.pdf
%endif
%doc %{_datadir}/man/man1/yaws.1*
%doc %{_datadir}/man/man5/yaws.conf.5*
%doc %{_datadir}/man/man5/yaws_api.5*
%doc README LICENSE ChangeLog
%exclude %{_libdir}/erlang/lib/yaws/examples

%files devel
%defattr(-,root,root,-)
%{_libdir}/pkgconfig/yaws.pc


%changelog
* Thu Nov 18 2010 Peter Lemenkov <lemenkov@gmail.com> - 1.89-3
- Make building docs conditional
- Added one more module to package
- Added missing runtime dependency - erlang-xmlrpc

* Thu Oct 21 2010 Lubomir Rintel (GoodData) <lkundrak@v3.sk> - 1.89-2
- Require newer Erlang (Peter Lemenkov)
- Exclude examples/ and src/

* Wed Oct 20 2010 Lubomir Rintel (GoodData) <lkundrak@v3.sk> - 1.89-1
- Rebase to 1.89
- No longer required patch for compiling using system-wide erlsom (Peter Lemenkov)
- Ver. 1.89 now requires erlang-ibrowse library (Peter Lemenkov)
- Shorten the dependency chain (Peter Lemenkov)

* Mon Sep 13 2010 Lubomir Rintel (GoodData) <lkundrak@v3.sk> - 1.88-1
- Rebase to 1.88
- Look for erlsom in system-wide location (Peter Lemenkov)
- Drop authmod_gssapi, dependencies not satisfied

* Sat Nov 21 2009 Lubomir Rintel (Good Data) <lkundrak@v3.sk> - 1.85-2
- Install to erlang lib directory, make arch dependent
- Install the source code

* Mon Nov 02 2009 Lubomir Rintel (Good Data) <lkundrak@v3.sk> - 1.85-1
- Initial packaging, partly based on Hans Ulrich Niedermann's package