File nagiosQL.spec of Package nagiosQL

#
# spec file for package nagiosQL (Version 2.0.2)
#
# Copyright (c) 2007 Scorpio IT, Deidesheim, Germany
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# Please submit bugfixes or comments via <rpm@scorpio-it.net>

%if %{?rel:0}%{!?rel:1}
%define rel 1
%endif

%define apxs2 /usr/sbin/apxs2-prefork
%define apache2_sysconfdir %(%{apxs2} -q SYSCONFDIR)

#Distribution:   %dist
#Packager:       %packager
#Vendor:         %vendor

Name:           nagiosQL
Summary:        The Nagios admin Tool
Version:        2.0.2
Release:        %{rel}.%{pid}
License:        GNU General Public License (GPL)
Group:          System/Monitoring
URL:            http://www.%{name}.org/
%define QL_DIR /usr/share/%{name}
Source0:        nagiosql-%{version}.tar.bz2
Source1:        %{name}-httpd.conf
Patch1:         nagiosql-2.0.2-settings.patch
Patch2:         nagiosql-2.0.2-DB_initial.patch
Patch3:         nagiosql-2.0.2-DB_update.patch
Patch4:         nagiosql-2.0.2-misccommands.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
BuildArch:      noarch
BuildRequires:  apache2-devel
Requires:       nagios >= 2.0
Requires:       nagios-www >= 2.0
Requires:       httpd
Requires:       apache2-mod_php5
Requires:       php >= 5.0
Requires:       mysql >= 5.0
Requires:       php5-mysql
Requires:       php-pear-HTML_Template_IT

#----------------------------------------------------------------------
%description
#----------------------------------------------------------------------
NagiosQL is a web based administration tool for nagios 2.x.
It helps you to easy build a complex configuration with all options,
manage them and use them.
NagiosQL needs a webserver with php, MySQL and

  !! file access to the nagios configuration files. !!

  Author:       Martin Willisegger

----------------------------------------------------------------------

#----------------------------------------------------------------------
%prep
#----------------------------------------------------------------------
%setup -n nagiosql-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1

#----------------------------------------------------------------------
%build
#----------------------------------------------------------------------

#----------------------------------------------------------------------
%install
#----------------------------------------------------------------------
install -d ${RPM_BUILD_ROOT}%{apache2_sysconfdir}/conf.d/
install -d ${RPM_BUILD_ROOT}%{QL_DIR}
cp %{SOURCE1} $RPM_BUILD_ROOT%{apache2_sysconfdir}/conf.d/%{name}.conf
cp -a * ${RPM_BUILD_ROOT}%{QL_DIR}
rm ${RPM_BUILD_ROOT}%{QL_DIR}/{Changelog,INSTALL_de,INSTALL_en,LEGAL,LICENSE,TODO,UPGRADE}

#----------------------------------------------------------------------
%pre
#----------------------------------------------------------------------

#----------------------------------------------------------------------
%post
#----------------------------------------------------------------------
# on `rpm -ivh` PARAM is 1
# on `rpm -Uvh` PARAM is 2
if [ "$1" = "1" ]; then
  echo "!!! DB-Setup !!!"
  echo "initialize your nagiosQL-DB"
  echo "Example: "
  echo "mysql -u root -p < %{QL_DIR}/config/nagiosQL_v2_db_mysql.sql"
fi

#----------------------------------------------------------------------
%preun
#----------------------------------------------------------------------

#----------------------------------------------------------------------
%postun
#----------------------------------------------------------------------

#----------------------------------------------------------------------
%clean
#----------------------------------------------------------------------
[ "$RPM_BUILD_ROOT" != "/" ] && [ -d $RPM_BUILD_ROOT ] && rm -rf $RPM_BUILD_ROOT

#----------------------------------------------------------------------
%files
#----------------------------------------------------------------------
%defattr(-,root,root)
%doc Changelog INSTALL_* LEGAL LICENSE TODO UPGRADE
%config(noreplace) %{apache2_sysconfdir}/conf.d/%{name}.conf
%dir %{QL_DIR}
%{QL_DIR}/*

#----------------------------------------------------------------------
%changelog -n nagiosQL
#----------------------------------------------------------------------
* Thu Jan 15 2009 - rpm@scorpio-it.net - 2.0.2
- reworked miscommands patch
* Mon Jan 12 2009 - rpm@scorpio-it.net - 2.0.2
- some rpmlint fixes
* Thu Jul 17 2008 - rpm@scorpio-it.net - 2.0.2
- added misccommands.patch
- fixed DB_initial.patch
* Mon Jul 14 2008 - rpm@scorpio-it.net - 2.0.2
- initial obs package
- upgrade to new Version
* Mon Jun 04 2007 - rpm@scorpio-it.net - 2.00 - 3
- fixed missing `tbl_relation` data
* Sun Jun 03 2007 - rpm@scorpio-it.net - 2.00 - 2
- dependencies (apache2-mod_php5)
- added initial data for setup
  changed charset to utf8
* Sun Apr 29 2007 - rpm@scorpio-it.net - 2.00 - 1
- intial run
openSUSE Build Service is sponsored by