Summary: Opsview Web License: GPL Group: Administration Name: opsview-web Prefix: /usr/local/opsview-web Provides: opsview-web Release: 1%{?distribution:.%{distribution}} Version: %VERSION% Source: opsview-web-%VERSION%.tar.gz URL: http://www.opsview.com Buildroot: /tmp/opsview-web #opsview-web is arch specific due to PAR files #BuildArch: noarch Autoreq: 0 Autoreqprov: 0 Requires: opsview-base = %VERSION% Requires: opsview-core = %VERSION% Requires: php, php-mysql, graphviz %define debug_package %{nil} %description This is the web portion of Opsview %prep %setup %build %install make install DESTDIR=%{buildroot} mkdir -p %{buildroot}/etc/init.d cp -p %{buildroot}%{prefix}/bin/opsview-web %{buildroot}/etc/init.d/opsview-web %post /sbin/chkconfig --add opsview-web # Only restart opsview-web on upgrades # On an initial install the database will not be setup if [ "$1" -ge 2 ] ; then # Need to remove this file. This is because if upgrading past 3.13.1, the db file for Reports is removed in opsview-core # but yum leaves ReportsDB.pm in the filesystem. I guess it cleans up files no longer in the package after the %post is run # and that seems like a silly design decision, especially for Catalyst, which parses the filesystem for what to load # Will need to keep this line in until everyone past 3.13.1 rm -f /usr/local/opsview-web/lib/Opsview/Web/Model/ReportsDB.pm # Another file to delete on an upgrade. Not sure why, but RPM does not delete previous files # As the existence of this file will cause opsview-web to not start correctly, we # delete it here rm -f /usr/local/opsview-web/lib/Opsview/Web/Controller/Admin/Graph.pm /etc/init.d/opsview-web start fi %pre if [ "$1" -ge 2 ] ; then # make sure opsview-compatibility-check is installed rpm -q opsview-compatibility-check-%VERSION% >/dev/null || exit 1 if [ -x /etc/init.d/opsview-web ] ; then /etc/init.d/opsview-web stop fi fi # clear old libraries rm -fr /usr/local/opsview-web/lib/ %preun if [ "$1" = 0 ] ; then %{prefix}/bin/opsview-web stop /sbin/chkconfig --del opsview-web fi %clean rm -rf %{buildroot} %files # This defattr should be -,-,-, but it looks like debian has its own behaviour to set permissions to nagios. Should be done in Makefile %defattr(-,nagios,nagios) /usr/local/opsview-web %attr(0555,root,root) /etc/init.d/opsview-web