Blob Blame History Raw
# documentation fails to build on ppc64le due to:
# https://bugzilla.redhat.com/show_bug.cgi?id=1243784
%ifnarch ppc64le
%bcond_without docs
%endif

Name:           yaws
Version:        1.98
Release:        8%{?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
# Copyright only: priv/soap.xsd, priv/wsdl.xsd
# W3C: priv/envelope.xsd
License:        BSD and ERPL and Copyright only and W3C
URL:            http://yaws.hyber.org/
Source0:        http://yaws.hyber.org/download/%{name}-%{version}.tar.gz
Source1:        yaws.logrotate
Source2:        yaws@.service
Source3:        yaws.service
Patch1:         yaws-1.98-fhs.patch
Patch2:         yaws-1.98-conf.patch
Patch3:         yaws-1.98-m32.patch
Patch4:         yaws-1.98-m64.patch

BuildRequires:  systemd-units
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:  tex-epstopdf
BuildRequires:  latex2html
%endif

Requires:       erlang >= R13B
Requires:       erlang-erlsom
Requires:       erlang-ibrowse
Requires:       erlang-xmlrpc
Requires:       logrotate
Requires(post):   systemd-units
Requires(preun):  systemd-units
Requires(postun): systemd-units


%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
%patch1 -p1 -b .fhs
%patch2 -p1 -b .conf
%patch3 -p1 -b .m32
%patch4 -p1 -b .m64

# 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
make %{?_smp_mflags} all
%if %{with docs}
# fails to build with smp_mflags sometimes
make docs EPSTOPDF=epstopdf
%endif


%install
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

# The systemd bits
mkdir -p $RPM_BUILD_ROOT/%{_unitdir}
cp -p %{SOURCE2} $RPM_BUILD_ROOT/%{_unitdir}

# Backward compatibility: keep "systemctl start yaws"
# This should be removed in the future
install -p -m0644 %{SOURCE3} $RPM_BUILD_ROOT/%{_unitdir}/yaws.service


%post
%systemd_post yaws@yaws.service


%preun
%systemd_preun yaws@yaws.service


%postun
%systemd_postun


%files
%defattr(-,root,root,-)
%exclude %{_initrddir}/yaws
%{_unitdir}/yaws@.service
%{_unitdir}/yaws.service
%dir %{_sysconfdir}/yaws
%config(noreplace) %{_sysconfdir}/yaws/yaws.conf
%config(noreplace) %{_sysconfdir}/logrotate.d/yaws
%dir %{_localstatedir}/log/%{name}
%{_localstatedir}/lib/yaws
%{_bindir}/yaws
%{_libdir}/yaws
%exclude %{_libdir}/yaws/ebin/.empty
%if %{with docs}
%doc %{_docdir}/yaws/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

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


%changelog
* Thu Apr 28 2016 Yaakov Selkowitz <yselkowi@redhat.com> - 1.98-8
- Do not use -m64 on aarch64 (#1291483)
- Disable docs on ppc64le

* Mon Jul 13 2015 Dan HorĂ¡k <dan[at]danny.cz> - 1.98-7
- skip -m32 also on s390

* Fri Jun 26 2015 Filip Andres <filip@andresovi.net> - 1.98-6
- Do not use -m32 flag on armv7 builds

* Sun Apr 5 2015 Antoine Catton <devel@antoine.catton.fr> - 1.98-5
- Tested with SELinux

* Wed Dec 31 2014 Antoine Catton <devel@antoine.catton.fr> - 1.98-4
- Remove "--deamon" option (which was forking)

* Sat Dec 06 2014 Antoine Catton <devel@antoine.catton.fr> - 1.98-3
- Rename unit file to allow to specify an instance (while keeping backward compatible instance file)
- Add ability stop and reload yaws with systemctl
- Support running multiple instance
- Do not fork from systemd

* Fri Feb 21 2014 Lubomir Rintel (GoodData) <lkundrak@v3.sk> - 1.98-2
- sysvinit -> systemd
- Remove old RPM artifacts

* Thu Feb 13 2014 Lubomir Rintel (GoodData) <lkundrak@v3.sk> - 1.98-1
- Rebase

* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.92-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.92-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Jan 03 2012 Lubomir Rintel (GoodData) <lkundrak@v3.sk> - 1.92-1
- Update

* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.89-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* 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