Sophie

Sophie

distrib > Fedora > 13 > i386 > media > updates-src > by-pkgid > 7ee60fb1169017a44b89ec3a20cb8555 > files > 3

drraw-2.2-0.6.b2.fc13.src.rpm

Name:           drraw
Version:        2.2
Release:        0.6.b2%{?dist}
Summary:        Web based presentation front-end for RRDtool

Group:          Applications/System
License:        BSD
URL:            http://web.taranis.org/drraw/
Source0:        http://web.taranis.org/drraw/dist/drraw-2.2b2.tar.gz
Source1:        drraw-httpd.conf
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch

Requires:       mod_perl 


%description
drraw is a simple web based presentation front-end for RRDtool that allows you
to interactively build graphs of your own design. A graph definition can be
turned into a template which may be applied to many Round Robin Database files.
drraw specializes in providing an easy mean of displaying data stored with
RRDtool and does not care about how the data is collected, making it a great
complement to other RRDtool front-ends.


%package selinux
Summary:          SELinux context for %{name}
Group:            Applications/System
Requires:         %name = %version-%release
Requires(post):   policycoreutils
Requires(postun): policycoreutils


%description selinux
SElinux context for drraw.


%prep
%setup -q -n drraw-2.2b2
# Set work dirs in conf file
sed -i -e "s|^\$saved_dir = .*|\$saved_dir = '/var/lib/drraw';|" \
       -e "s|^\$tmp_dir = .*|\$tmp_dir = '/var/tmp';|" drraw.conf
# Patch drraw.cgi for conf file location
sed -i -e 's|^my $config = .*|my $config = "/etc/drraw.conf";|' drraw.cgi
# Fix file encoding
iconv -f iso8859-1 -t utf-8 CHANGES > CHANGES.conv && \
touch -r CHANGES CHANGES.conv && \
mv -f CHANGES.conv CHANGES


%build
# Nothing to build


%install
rm -rf $RPM_BUILD_ROOT
install -Dp -m 0755 drraw.cgi $RPM_BUILD_ROOT/%{_datadir}/%{name}/drraw.cgi
install -Dp -m 0644 drraw.conf $RPM_BUILD_ROOT/%{_sysconfdir}/drraw.conf
install -Dp -m 0644 %{SOURCE1} $RPM_BUILD_ROOT/%{_sysconfdir}/httpd/conf.d/drraw.conf
mkdir -p $RPM_BUILD_ROOT/%{_localstatedir}/lib/%{name}


%clean
rm -rf $RPM_BUILD_ROOT


%post selinux
semanage fcontext -a -t httpd_sys_script_exec_t '%{_datadir}/%{name}(/.*)?' 2>/dev/null || :
semanage fcontext -a -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}(/.*)?' 2>/dev/null || :
restorecon -R %{_datadir}/%{name} %{_localstatedir}/lib/%{name} || :


%postun selinux
if [ $1 -eq 0 ] ; then
semanage fcontext -d -t httpd_sys_script_exec_t '%{_datadir}/%{name}(/.*)?' 2>/dev/null || :
semanage fcontext -d -t httpd_sys_rw_content_t '%{_localstatedir}/lib/%{name}(/.*)?' 2>/dev/null || :
fi


%files
%defattr(-,root,root,-)
%doc README.EVENTS LICENSE INSTALL CHANGES
%config(noreplace) %{_sysconfdir}/drraw.conf
%config(noreplace) %{_sysconfdir}/httpd/conf.d/drraw.conf
%{_datadir}/%{name}
%attr(755,apache,root) %{_localstatedir}/lib/%{name}


%files selinux
%defattr(-,root,root,-)


%changelog
* Thu Aug 19 2010 Xavier Bachelot <xavier@bachelot.org> 2.2-0.6.b2
- Fix -selinux %%post and %%postun.
- Remove comments trigering rpmlint warnings.
- Preserve timestamp on file encoding fix.
- Clean up files installation.
- Sed conf file rather than patch it.

* Fri Apr 03 2009 Xavier Bachelot <xavier@bachelot.org> 2.2-0.5.b2
- Add a Group: tag to the -selinux subpackage.

* Tue Mar 03 2009 Xavier Bachelot <xavier@bachelot.org> 2.2-0.4.b2
- Update to 2.2 beta 2.
- Drop the patch updating the code to svn revision 1564.

* Tue Jan 13 2009 Xavier Bachelot <xavier@bachelot.org> 2.2-0.3.b1
- A %%files section is needed to build a subpackage that doesn't contain any file...

* Mon Jan 12 2009 Xavier Bachelot <xavier@bachelot.org> 2.2-0.2.b1
- Update to latest trunk (rev. 1564) :
  - Added pnp4nagios awareness (courtesy of Jeremy Jacquier-Roux).
  - Dashboards weren't always sorted.
  - Updated logic to prevent Data Source Templates from skipping too many files.
  - It wasn't possible to add a numeric DS (reported by Jeremy Jacquier-roux).
  - Removed compatibility reporting code.
- Add an selinux subpackage for compatibility with selinux.

* Wed Nov 19 2008 Xavier Bachelot <xavier@bachelot.org> 2.2-0.1.b1
- Initial build.