Blob Blame History Raw

%global htmldir /var/www/yawn
%global apacheconfdir /etc/httpd
%global svnrev 561

Name:           yawn
Version:        0
Release:        0.4.20120227svn%{svnrev}%{?dist}
Summary:        Yet Another WBEM Navigator


Group:          Applications/System
License:        GPLv2
URL:            https://sourceforge.net/apps/mediawiki/pywbem/index.php?title=YAWN
# The source for this package was pulled from upstream's vcs.  Use the
# following command to get the file:
#  wget http://pywbem.svn.sourceforge.net/viewvc/pywbem/yawn/trunk/yawn.py
Source0:        yawn.py

# Patch0: resolves bz#802683, reported upstream (see link in bz)
Patch0:         yawn-0-content-type.patch
# Patch1: fixes URLs
Patch1:         yawn-0-urls.patch

BuildRequires:  httpd
Requires:       mod_python, pywbem, httpd
BuildArch:      noarch

%description
Web-based CIM/WBEM browser

%prep
cp %{SOURCE0} .
%patch0 -p1 -b .content-type
%patch1 -p1 -b .urls

%build

%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{htmldir}
install ./yawn.py $RPM_BUILD_ROOT%{htmldir}/index.py
install -d $RPM_BUILD_ROOT%{apacheconfdir}/conf.d/
cat > $RPM_BUILD_ROOT%{apacheconfdir}/conf.d/yawn.conf << EOS
Alias /yawn /var/www/yawn

<Location /yawn>
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
    Allow from ::1
    # Allow from .example.com
</Location>

<Directory /var/www/yawn>
    SetHandler mod_python
    PythonHandler mod_python.publisher
    PythonDebug On
</Directory>
EOS

%clean
rm -rf $RPM_BUILD_ROOT

%post 
/bin/systemctl try-restart httpd.service >/dev/null 2>&1 || :

%files
%defattr(-,root,root,-)
%{htmldir}
%config(noreplace) %{apacheconfdir}/conf.d/yawn.conf

%changelog
* Thu May 17 2012 Vitezslav Crhonek <vcrhonek@redhat.com> - 0-0.4.20120227svn561
- Fix URLs (patch by Radek Novacek, rnovacek@redhat.com)

* Tue Mar 13 2012 Vitezslav Crhonek <vcrhonek@redhat.com> - 0-0.3.20120227svn561
- Fix Pickle method sets Content-type: text/plain instead of text/html
  (patch by Jan Safranek, jsafrane@redhat.com)
  Resolves: #802683

* Tue Feb 28 2012 Vitezslav Crhonek <vcrhonek@redhat.com> - 0-0.2.20120227svn561
- Fix twice listed files

* Mon Feb 27 2012 Vitezslav Crhonek <vcrhonek@redhat.com> - 0-0.1.20120227svn561
- Remove obsolete BuildRoot tag, use systemctl instead of service, own htmldir,
  fix source and version

* Thu Feb 23 2012 Vitezslav Crhonek <vcrhonek@redhat.com>
- Change htmldir, fix license

* Wed Jan 25 2012 Vitezslav Crhonek <vcrhonek@redhat.com>
- Initial build for Fedora