LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File centreon-web.spec of Package centreon-web (Project home:ecsos:monitoring)

#
# spec file for package centreon-web
#
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

%define d_name centreon

#centreon is not truely compatible with php7!
%define php_name php7

%if ! %{defined _fillupdir}
%define _fillupdir /var/adm/fillup-templates
%endif

Name:		centreon-web
Summary:	Network & System Monitoring WebGui
Version:	19.04.0
Release:	0
Source:		https://s3-eu-west-1.amazonaws.com/centreon-download/public/centreon/%{name}-%{version}.tar.gz
# Source from github
#Source:         https://github.com/centreon/centreon/archive/%%{version}/%%{name}-%%{version}.tar.gz
# Vendor source generate with: composer update --no-dev
#Source1:	%%{name}-vendor-%%{version}.tar.gz
Source2:	install.conf.php
Source3:	%{name}.permissions
Source5:	%{name}.tmpfiles.d
Source6:	%{name}.my.cnf
Source7:	%{name}.sysctl.conf
Source8:	%{name}.centcore.logrotate
Source9:	%{name}.centreon.logrotate
Source10:	%{name}.centstorage.logrotate
Source90:	README.SUSE
Source99:	%{name}.rpmlintrc
Patch1:		%{name}-install.patch
Patch2:		%{name}-install-vars-for-steps.patch
Patch3:		%{name}-etc-inst.patch
Patch4:		%{name}-centreonbroker_module_path.patch
Patch5:		%{name}-cron-path.patch
Patch6:		%{name}-naming_errors.patch
#Patch7:		%%{name}-centreon_path.patch
#Patch8:		%%{name}-php7.patch
# PATCH-FIX_OPENSUSE - New commits since last version.
###Patch50:        centreon-web-master_2bfd7a0.diff
License:	GPL-2.0
Group:		Productivity/Networking/Web/Frontends
Url:		http://www.centreon.com
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildArch:	noarch

AutoReqProv:	no 
PreReq: 		permissions
PreReq:			%fillup_prereq
PreReq:         %insserv_prereq

BuildRequires:	systemd
#BuildRequires:	systemd-sysvinit
BuildRequires:	systemd-rpm-macros
%{?systemd_requires}
BuildRequires:	groff
BuildRequires:	mariadb >= 5.5.35
BuildRequires:	apache2 >= 2.2
BuildRequires:	gnutls >= 2.0
BuildRequires:	net-snmp >= 5.5
BuildRequires:	openssl >= 1.0.1e
BuildRequires:	dos2unix
BuildRequires: 	nagios monitoring-plugins
Requires:	centreon-engine >= 19.04.0
Requires:	centreon-broker >= 18.04.0
Requires:	centreon-connectors
Requires:	centreon-clib >= 19.04.0
Requires:	openssl	>= 1.0.1e
#Requires:	libqt >= 4.7.4
Requires:	rrdtool >= 1.4.7
Requires:	zlib >= 1.2.3
Requires: 	sudo 
Requires: 	cron
Requires: 	net-snmp
Requires: 	util-linux
Requires: 	logrotate
Requires: 	openssh
Requires: 	monitoring-plugins
Requires: 	apache2
Requires: 	gd
Requires: 	mariadb mariadb-client mariadb-errormessages mariadb-tools
Requires:  	mod_php_any
# PHP
Requires:  	%{php_name}
Requires:   %{php_name}-gd >= 5.4
Requires:  	%{php_name}-gettext >= 5.4
Requires:   %{php_name}-intl >= 5.4
Requires:  	%{php_name}-ldap >= 5.4
Requires:  	%{php_name}-mbstring >= 5.4
Requires:  	%{php_name}-mysql >= 5.4
Requires:  	%{php_name}-posix >= 5.4
Requires:  	%{php_name}-snmp >= 5.4
Requires:  	%{php_name}-soap >= 5.4
Requires: 	%{php_name}-sqlite >= 5.4
Requires:  	%{php_name}-xmlwriter >= 5.4
Requires:  	%{php_name}-pear >= 5.4
Requires:  	%{php_name}-pear-Auth_SASL >= 1.0.1
Requires:  	%{php_name}-pear-DB >= 1.7.6
Requires:  	%{php_name}-pear-DB_DataObject >= 1.8.4
Requires:  	%{php_name}-pear-DB_DataObject_FormBuilder >= 1.0.0RC4
Requires:  	%{php_name}-pear-Date >= 1.4.6
Requires:  	%{php_name}-pear-HTML_Common >= 1.2.2
Requires: 	%{php_name}-pear-HTML_QuickForm >= 3.2.5
Requires:  	%{php_name}-pear-HTML_QuickForm_advmultiselect >= 1.1.0
Requires:  	%{php_name}-pear-HTML_Table >= 1.6.1
Requires:  	%{php_name}-pear-Log >= 1.9.11
Requires:  	%{php_name}-pear-MDB2 >= 2.0.0
Requires:  	%{php_name}-pear-Net_SMTP >= 1.2.8
Requires:  	%{php_name}-pear-Net_Socket >= 1.0.1
Requires:  	%{php_name}-pear-Net_Traceroute >= 0.21
Requires:  	%{php_name}-pear-Net_Ping >= 2.4.1
# Requires:  	php-pear-SOAP >= 0.10.1  # Use builtin soap client
Requires:  	%{php_name}-pear-Validate >= 0.6.2
Requires:  	%{php_name}-pear-XML_RPC >= 1.4.5
Requires:  	%{php_name}-pear-Archive_Tar >= 1.1
Requires:  	%{php_name}-pear-Archive_Zip >= 0.1.2
#Requires:  	php-pear-Console_Getopt >= 1.2
# PERL
Requires:  	perl >= 5.18.1
Requires:  	perl-Config-IniFiles
Requires:  	perl-Crypt-DES
Requires:  	perl-DBI
Requires:  	perl-DBD-mysql
Requires:  	perl-Digest-HMAC
Requires:  	perl-Digest-SHA1
Requires:  	perl-GD
Requires:  	perl-IO-Socket-INET6
Requires:  	perl-Net-SNMP
Requires(post): %fillup_prereq
Obsoletes:	centreon < 2.8.0
Provides:	centreon = %{version}

%description
Centreon is a network, system, applicative supervision and monitoring tool,
it is based upon the most effective Open Source monitoring engine : Nagios.
Centreon provides a new frontend and new functionnalities to Nagios.

It allows you to be more efficient in your network monitoring, but also allows
you to make your supervision information readable by a largest range of users.
Indeed, a non technical user can now use the Centreon/Nagios couple to easily
understand your network infrastructure thanks to charts and graphical representations
of the gathered information. Skilled users still have access to specific and technical
information collected  by Nagios though.


%prep
# setup with source from amazonews
%setup -q -n %{name}-%{version}
# setup with source from git. There is vendor source missing.
#%%setup -q -n centreon-%%{version} -b 1
# remainder
install -m644 %{SOURCE90} .
# not needed?
rmdir --ignore-fail-on-non-empty tests
rm -rf "vendor/symfony/finder/Tests/Fixtures/with space"
%patch1 -p0
%patch2 -p1
%{__mkdir_p} etc
pushd etc
%patch3 -p1
popd
%patch4 -p1
%patch5 -p1
%patch6 -p1
#%%patch7 -p1
#%%patch8 -p1
###%%patch50 -p1

# remove unneeded file
find -name ".gitignore" | xargs -r rm -r
find -name ".github" | xargs -r rm -r
find -name ".cvsignore" | xargs -r rm -r
find -name "*.orig" | xargs -r rm
find -name "._*" | xargs -r rm
find -name ".DS_Store" | xargs -r rm
# rpmlint
find -name "*.rst" | xargs -r dos2unix
find -name "*.pl" | xargs -r dos2unix
find -name "*.py" | xargs -r dos2unix
find -name "*.html" | xargs -r dos2unix
find -name "*.scss" | xargs -r dos2unix
find -name "Makefile" | xargs -r dos2unix
find . -type f -exec sed -i -e 's|\/usr\/bin\/env bash|\/bin\/bash|g' {} \;
find . -type f -exec sed -i -e 's|\/usr\/bin\/env perl|\/usr\/bin\/perl|g' {} \;
find . -type f -exec sed -i -e 's|\/usr\/bin\/env php|\/usr\/bin\/php|g' {} \;
# rpmlint
#chmod -x www/install/php/Update-2.7.4_to_2.7.5.php
find -name "*.scss" | xargs -r chmod -x
find -name "*.ihtml" | xargs -r chmod -x
find -name "*.html" | xargs -r chmod -x
find -name "*.js" | xargs -r chmod -x
find -name "*.svg" | xargs -r chmod -x
find -name "*.json" | xargs -r chmod -x
find -name "README.md" | xargs -r chmod -x

# copy install.conf.php
%{__cp} -v %{S:2} .

# perl version ?
# perl_version=`rpm -q --qf "%%{VERSION}" perl`

find . -type f | xargs sed -i -e 's:@BIN_MAIL@:/bin/mail:g' \
                              -e 's:@BIN_RRDTOOL@:/usr/bin/rrdtool:g' \
                              -e 's:@BIN_SCP@:/usr/bin/scp:g' \
                              -e 's:@BIN_SSH@:/usr/bin/ssh:g' \
                              -e 's:@MAILER@:/bin/mail:g' \
                              -e 's:@CENTCORE_BINDIR@:%{_datadir}/%{d_name}/bin:g' \
                              -e 's:@CENTPLUGINS_TMP@:/var/lib/%{d_name}/centplugins:g' \
                              -e 's:@CENTPLUGINSTRAPS_BINDIR@:%{_datadir}/%{d_name}/bin:g' \
                              -e 's:@CENTREONTRAPD_BINDIR@:%{_datadir}/%{d_name}/bin:g' \
                              -e 's:@CENTREON_DIR@:%{_datadir}/%{d_name}:g' \
                              -e 's:@CENTREON_ETC@:/etc/centreon:g' \
                              -e 's:@CENTREON_LOG@:/var/log/%{d_name}:g' \
                              -e 's:@CENTREON_BINDIR@:%{_datadir}/%{d_name}/bin:g' \
                              -e 's:@CENTREON_DATADIR@:%{_datadir}/%{d_name}/data:g' \
                              -e 's:@CENTREON_ENGINE_CONNECTORS@:%{_libdir}/centreon-connectors:g' \
                              -e 's:@CENTREON_GENDIR@:/var/cache/%{d_name}:g' \
                              -e 's:@CENTREON_PATH@:%{_datadir}/%{d_name}:g' \
                              -e 's:@CENTREON_RUNDIR@:/var/run/centreon:g' \
                              -e 's:@CENTREON_VARLIB@:/var/lib/%{d_name}:g' \
                              -e 's:@CENTREON_USER@:centreon:g' \
                              -e 's:@CENTREON_GROUP@:centreon:g' \
                              -e 's:@CENTREON_DIR_RRD@:/var/lib/%{d_name}:g' \
                              -e 's:@CENTREON_DIR_WWW@:%{_datadir}/%{d_name}/www:g' \
                              -e 's:@CENTSTORAGE_BINDIR@:%{_datadir}/%{d_name}/bin:g' \
                              -e 's:@CENTSTORAGE_LIB@::g' \
                              -e 's:@CENTSTORAGE_RRD@:/var/lib/centreon:g' \
                              -e 's:@INSTALL_DIR_CENTREON@:%{_datadir}/%{d_name}:g' \
                              -e 's:@INSTALL_DIR_NAGIOS@:/usr/share/centengine:g' \
                              -e 's:@NAGIOS_BINARY@:/usr/sbin/centengine:g' \
                              -e 's:@NAGIOS_ETC@:/etc/centreon-engine:g' \
                              -e 's:@NAGIOS_VAR@:/var/log/centreon-engine:g' \
                              -e 's:@NAGIOS_USER@:nagios:g' \
                              -e 's:@NAGIOS_GROUP@:nagcmd:g' \
                              -e 's:@NAGIOS_INIT_SCRIPT@:/etc/init.d/centengine:g' \
                              -e 's:@NAGIOSTATS_BINARY@:/usr/sbin/centenginestats:g' \
                              -e 's:@NAGIOS_PLUGIN@:/usr/lib/nagios/plugins:g' \
                              -e 's:@NAGIOS_PLUGINS@:/usr/lib/nagios/plugins:g' \
                              -e 's:@OREON_PATH@:%{_datadir}/%{d_name}:g' \
                              -e 's:@PEAR_PATH@:/usr/share/%{php_name}/PEAR:g' \
                              -e 's:@PERL_BIN@:/usr/bin/perl:g' \
                              -e 's:@PHP_BIN@:/usr/bin/php:g' \
                              -e 's:@RRD_PERL@:%perl_vendorarch:g' \
                              -e 's:@RRDTOOL_PERL_LIB@::g' \
                              -e 's:@SNMP_ETC@:/etc/snmp/:g' \
                              -e 's:@SNMPTT_BINDIR@:/usr/sbin:g' \
                              -e 's:@SNMPTT_INI_FILE@:/etc/snmp/snmptt.ini:g' \
                              -e 's:@VARLIB_CENTREON@:/var/lib/%{d_name}:g' \
                              -e 's:@DIR_APACHE@:/etc/apache2:g' \
                              -e 's:@DIR_APACHE_CONF@:/etc/apache2/conf.d:g' \
                              -e 's:@BROKER_ETC@:/etc/centreon-broker:g' \
                              -e 's:@BROKER_USER@:centreon-broker:g' \
                              -e 's:@BROKER_GROUP@:centreon-broker:g' \
                              -e 's:@BROKER_INIT_SCRIPT@:/etc/init.d/centreon-broker:g' \
                              -e 's:@MONITORINGENGINE_ETC@:/etc/centreon-engine:g' \
                              -e 's:@MONITORINGENGINE_INIT_SCRIPT@:/etc/init.d/centengine:g' \
                              -e 's:@MONITORINGENGINE_BINARY@:/usr/sbin/centengine:g' \
                              -e 's:@MONITORINGENGINE_STATS_BINARY@:%{_sbindir}/centenginestats:g' \
                              -e 's:@MONITORINGENGINE_LOG@:/var/log/centreon-engine:g' \
                              -e 's:@MONITORINGENGINE_PLUGIN@:/usr/lib/centreon/plugins:g' \
                              -e 's:@MONITORINGENGINE_USER@:centreon:g' \
                              -e 's:@MONITORINGENGINE_GROUP@:centreon:g' \
                              -e 's:@PLUGIN_DIR@:/usr/lib/nagios/plugins:g' \
                              -e 's:@SUDO_FILE@:/etc/sudoers:g' \
                              -e 's:@WEB_GROUP@:www:g' \
                              -e 's:@WEB_USER@:wwwrun:g' \
                              -e 's:@INIT_D@:/etc/init.d:g' \
                              -e 's:@CRON_D@:/etc/cron.d:g' \
                              -e 's:@CENTREONCONNECTOR_PATH@:%{_libdir}/centreon-connector:g' \
                              -e 's:@CENTREONTRAPD_INIT_SCRIPT@:/etc/init.d/centreontrapd:g' \
                              -e 's:@CENTREONTRAPD_SNMP_PATH_CONF@:/etc/snmp/centreon_traps:g'

# for nagios-broker
#                              -e 's:@BROKER_ETC@:/etc/nagios:g' \
#                              -e 's:@BROKER_USER@:nagios:g' \
#                              -e 's:@BROKER_GROUP@:nagios:g' \
#                              -e 's:@BROKER_INIT_SCRIPT@:/etc/init.d/ndo2db:g' \
# for nagios-engine
#                              -e 's:@P1_PL@:/usr/lib/nagios/p1.pl:g' \
#                              -e 's:@NAGIOS_P1_FILE@:/usr/lib/nagios/p1.pl:g' \
#                              -e 's:@NAGIOS_VAR@:/var/log/nagios:g' \
#                              -e 's:@NAGIOS_INIT_SCRIPT@:/etc/init.d/nagios:g' \
#                              -e 's:@NAGIOSTATS_BINARY@:/usr/sbin/nagiostats:g' \
#                              -e 's:@NAGIOS_BINARY@:/usr/sbin/nagios:g' \
#                              -e 's:@NAGIOS_IMG@:/usr/share/nagios/images:g' \
#                              -e 's:@NAGIOS_IMG@:/usr/share/nagios/images:g' \
#                              -e 's:@NAGIOS_ETC@:/etc/nagios:g' \
#                              -e 's:@NAGIOS_BIN@:/:g' \
#                              -e 's:@INSTALL_DIR_NAGIOS@:/usr/share/nagios:g' \
#                              -e 's:@MONITORINGENGINE_INIT_SCRIPT@:/etc/init.d/nagios:g' \
#                              -e 's:@MONITORINGENGINE_BINARY@:/usr/sbin/nagios:g' \
#                              -e 's:@MONITORINGENGINE_ETC@:/etc/nagios:g' \
#                              -e 's:@MONITORINGENGINE_LOG@:/var/log/nagios:g' \

                              
# for centreon-broker
#                              -e 's:@BROKER_ETC@:/etc/centreon-broker:g' \
#                              -e 's:@BROKER_USER@:centreon:g' \
#                              -e 's:@BROKER_GROUP@:centreon:g' \
#                              -e 's:@BROKER_INIT_SCRIPT@:/etc/init.d/centreon-broker:g' \

# is this realy needed from tmpl ?
#                              -e 's:@NDOMOD_BINARY@::g' \
#                              -e 's:@NDO2DB_BINARY@::g' \                      


# from src/www/install/var/brokers
find . -type f | xargs sed -i -e 's:@CENTREONBROKER_ETC@:/etc/centreon-broker:g' \
                              -e 's:@CENTREONBROKER_CBMOD@:%{_libdir}/cbmod.so:g' \
                              -e 's:@CENTREONBROKER_LOG@:/var/log/centreon-broker:g' \
                              -e 's:@CENTREONBROKER_VARLIB@:/var/lib/centreon-broker:g' \
                              -e 's:@CENTREONBROKER_LIB@:%{_libdir}/centreon-broker:g' \
                              -e 's:@CENTREONBROKER_MODULE_PATH@:%{_libdir}/centreon-broker:g' \
                              -e 's:@DB_HOST@:127.0.0.1:g' \
                              -e 's:@DB_PORT@:3306:g' \
                              -e 's:@DB_USER@:centreon:g' \
                              -e 's:@DB_PASS@::g' \
                              -e 's:@STORAGE_DB@:centreon_storage:g'

# from src/www/install/var/engines
find . -type f | xargs sed -i -e 's:@INSTALL_DIR_ENGINE@:/usr/share/centreon-engine:g' \
                              -e 's:@CENTREON_ENGINE_STATS_BINARY@:%{_sbindir}/centenginestats:g' \
                              -e 's:@MONITORING_VAR_LIB@:/var/lib/centreon-engine:g' \
                              -e 's:@CENTREON_ENGINE_LIB@:%{_libdir}/centreon-engine:g' \
                              -e 's:@MONITORING_VAR_LOG@:/var/log/centreon-engine:g' \
                              -e 's:@MONITORING_INIT_SCRIPT@:/etc/init.d/centengine:g' \
                              -e 's:@MONITORING_BINARY@:/usr/sbin/centengine:g' \
                              -e 's:@CENTREONPLUGINS@:/usr/lib/centreon/plugins/:g'


%build
# nothing to build

%install
# install mysql.conf and kernel.parameter.changes
%{__install} -d -m 0755 %{buildroot}/etc/my.cnf.d
%{__install} -m 0644 %{SOURCE6} %{buildroot}/etc/my.cnf.d/%{d_name}.my.cnf
%{__install} -d -m 0755 %{buildroot}/etc/sysctl.d
%{__install} -m 0644 %{SOURCE7} %{buildroot}/etc/sysctl.d/%{d_name}.sysctl.conf

# Install dir /var/run/centreon
%{__install} -d -m 0755 %{buildroot}/usr/lib/tmpfiles.d/
%{__install} -m 0644 %{SOURCE5} %{buildroot}/usr/lib/tmpfiles.d/%{d_name}.conf

# Install files configuration 
%{__install} -d -m 0755 %{buildroot}/etc/%{d_name}
%{__install} -m 0644 etc/instCentCore.conf %{buildroot}/etc/%{d_name}
%{__install} -m 0644 etc/instCentPlugins.conf %{buildroot}/etc/%{d_name}
%{__install} -m 0644 etc/instCentStorage.conf %{buildroot}/etc/%{d_name}
%{__install} -m 0644 etc/instCentWeb.conf %{buildroot}/etc/%{d_name}

# Install cron
%{__install} -d -m 0755 %{buildroot}/etc/cron.d
%{__cp} tmpl/install/centreon.cron %{buildroot}/etc/cron.d
%{__cp} tmpl/install/centstorage.cron %{buildroot}/etc/cron.d

# Install conf apache
%{__install} -d -m 0755 %{buildroot}/etc/apache2/conf.d
# This file is kept within .spec file, since it contains spec variables
cat << EOF >> %{buildroot}/etc/apache2/conf.d/centreon.conf
Alias /%{d_name} %{_datadir}/%{d_name}/www/
<Directory "%{_datadir}/%{d_name}/www">

	Options Indexes SymLinksIfOwnerMatch
	AllowOverride AuthConfig Options
	
	<IfModule mod_version.c>
	    <IfVersion < 2.4>
		Order allow,deny
		Allow from all
	    </IfVersion>
	    <IfVersion >= 2.4>
		Require all granted
	    </IfVersion>
	</IfModule>
	
	<IfModule mod_rewrite.c>
	    RewriteEngine On
	    RewriteRule ^index\.html$ - [L]
	    RewriteCond %{REQUEST_FILENAME} !-f
	    RewriteCond %{REQUEST_FILENAME} !-d
	    RewriteRule . /index.html [L]
	    Errordocument 404 /centreon/index.html
	</IfModule>
	
</Directory>
EOF

# Install logrotate
%{__install} -d -m 0755 %{buildroot}/var/log/%{d_name}
%{__install} -d -m 0755 %{buildroot}/etc/logrotate.d
%{__install} -D -m 0644 logrotate/centreontrapd %{buildroot}%{_sysconfdir}/logrotate.d/centreontrapd
%{__install} -D -m 0644 %{S:8} %{buildroot}%{_sysconfdir}/logrotate.d/centcore
%{__install} -D -m 0644 %{S:9} %{buildroot}%{_sysconfdir}/logrotate.d/centreon
%{__install} -D -m 0644 %{S:10} %{buildroot}%{_sysconfdir}/logrotate.d/centstorage

# Install sysconfig
%{__install} -d -m 755 %{buildroot}%{_fillupdir}/
%{__install} -m 0644 tmpl/install/suse/centcore.sysconfig %{buildroot}%{_fillupdir}/sysconfig.centcore
%{__install} -m 0644 tmpl/install/suse/centstorage.sysconfig %{buildroot}%{_fillupdir}/sysconfig.centstorage
%{__install} -m 0644 tmpl/install/suse/centreontrapd.sysconfig %{buildroot}%{_fillupdir}/sysconfig.centreontrapd

# Install systemd service
%{__install} -d -m 0755 %{buildroot}%{_sbindir}
%{__install} -D -m 0644 tmpl/install/redhat/centcore.systemd %{buildroot}%{_unitdir}/centcore.service
%{__install} -D -m 0644 tmpl/install/redhat/centreontrapd.systemd %{buildroot}%{_unitdir}/centreontrapd.service
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rccentcore
ln -s /usr/sbin/service %{buildroot}%{_sbindir}/rccentreontrapd

# Install file configuration snmptrapd and snmp
%{__install} -d -m 0755 %{buildroot}/etc/snmp
%{__cp} snmptrapd/snmptrapd.conf %{buildroot}/etc/snmp
%{__cp} snmptrapd/snmp.conf %{buildroot}/etc/snmp
#%%{__cp} plugins/src/traps/conf/snmptt.ini %%{buildroot}/etc/snmp

# Install centreon plugins and David perfdata
#%%{__install} -d -m 0775 %%{buildroot}/usr/lib/nagios/plugins
#%%{__install} -m 0775 plugins/src/centreon* %%{buildroot}/usr/lib/nagios/plugins
#%%{__install} -m 0775 plugins/src/check* %%{buildroot}/usr/lib/nagios/plugins
#%%{__install} -m 0775 plugins/src/process-service-perfdata %%{buildroot}/usr/lib/nagios/plugins
#%%{__install} -m 0775 plugins/src/submit_{host,service}_check_result %%{buildroot}/usr/lib/nagios/plugins
#%%{__install} -d -m 0775 %%{buildroot}/usr/lib/nagios/plugins/Centreon/SNMP
#%%{__install} -m 0775 plugins/src/Centreon/SNMP/Utils.pm %%{buildroot}/usr/lib/nagios/plugins/Centreon/SNMP
#%%{__install} -d -m 0775 %%{buildroot}/usr/lib/nagios/plugins/traps/conf
#%%{__install} -m 0775 plugins/src/traps/conf/* %%{buildroot}/usr/lib/nagios/plugins/traps/conf

# Install bindir centreon
%{__install} -d -m 0755 %{buildroot}%{_datadir}/%{d_name}/bin
%{__install} -m 0755 bin/* %{buildroot}%{_datadir}/%{d_name}/bin

# Install installDir centreon
%{__install} -d -m 0755 %{buildroot}%{_datadir}/%{d_name}/installDir

# Install backup dir centreon
%{__install} -d -m 0755 %{buildroot}/var/adm/backup/centreon

# Install cron
%{__install} -d -m 0755 %{buildroot}%{_datadir}/%{d_name}/cron
%{__install} -d -m 0755 %{buildroot}%{_datadir}/%{d_name}/cron/Misc
%{__install} -d -m 0755 %{buildroot}%{_datadir}/%{d_name}/cron/Modules
%{__install} -d -m 0755 %{buildroot}%{_datadir}/%{d_name}/cron/reporting
%{__install} -m 0775 cron/* %{buildroot}%{_datadir}/%{d_name}/cron/

# install perl Modules
%{__install} -d -m 0755 %{buildroot}%perl_vendorlib/centreon/centstorage
%{__install} -d -m 0755 %{buildroot}%perl_vendorlib/centreon/common
%{__install} -d -m 0755 %{buildroot}%perl_vendorlib/centreon/reporting
%{__install} -d -m 0755 %{buildroot}%perl_vendorlib/centreon/script
%{__install} -d -m 0755 %{buildroot}%perl_vendorlib/centreon/trapd
%{__install} -m 0644 lib/perl/centreon/*.pm %{buildroot}%perl_vendorlib/centreon
%{__install} -m 0644 lib/perl/centreon/centstorage/* %{buildroot}%perl_vendorlib/centreon/centstorage
%{__install} -m 0644 lib/perl/centreon/common/* %{buildroot}%perl_vendorlib/centreon/common
%{__install} -m 0644 lib/perl/centreon/reporting/* %{buildroot}%perl_vendorlib/centreon/reporting
%{__install} -m 0644 lib/perl/centreon/script/* %{buildroot}%perl_vendorlib/centreon/script
%{__install} -m 0644 lib/perl/centreon/trapd/* %{buildroot}%perl_vendorlib/centreon/trapd

# install permissions file
%{__install} -D -m 0644 %{S:3} %{buildroot}%{_sysconfdir}/permissions.d/%{d_name}

# install all other files
%{__mkdir_p} %{buildroot}%{_datadir}/%{d_name}
%{__cp} -r doc GPL_LIB config features filesGeneration lib src tests vendor www %{buildroot}%{_datadir}/%{d_name}
%{__cp} *.php *.xml *.json *.lock %{buildroot}%{_datadir}/%{d_name}
%{__install} -d -m 0775 %{buildroot}%{_sysconfdir}/snmp/centreon_traps
# copy config/centreon.config.php.template -> centreon.config.php
%{__cp} %{buildroot}%{_datadir}/%{d_name}/config/centreon.config.php.template %{buildroot}%{_datadir}/%{d_name}/config/centreon.config.php
# remove .htaccess in dir www, because now in apache.conf
rm -rf %{buildroot}%{_datadir}/%{d_name}/www/.htaccess

# install libdir centreon
%{__install} -d -m 0750 %{buildroot}%{_datadir}/%{d_name}/libinstall
%{__install} -m 0775 libinstall/cinstall %{buildroot}%{_datadir}/%{d_name}/libinstall
%{__install} -m 0775 libinstall/functions %{buildroot}%{_datadir}/%{d_name}/libinstall
%{__install} -m 0775 libinstall/gettext %{buildroot}%{_datadir}/%{d_name}/libinstall
%{__install} -m 0775 libinstall/*.php %{buildroot}%{_datadir}/%{d_name}/libinstall

# install rest
%{__install} -m 0664 install.conf.php %{buildroot}%{_datadir}/%{d_name}/www/install

# install missing tmp dir in centreon/www/install
%{__install} -d -m 0775 %{buildroot}%{_datadir}/%{d_name}/www/install/tmp
# install centreon own plugins dir
%{__install} -d -m 0775 %{buildroot}/usr/lib/%{d_name}/plugins
# install patitioning_backup_directory
%{__install} -d -m 0775 %{buildroot}/var/cache/%{d_name}/backup

# add empty data, generation, run and lib dirs
%{__mkdir_p} %{buildroot}%{_datadir}/%{d_name}/data
%{__mkdir_p} %{buildroot}%{_datadir}/%{d_name}/filesGeneration
%{__mkdir_p} %{buildroot}%{_datadir}/%{d_name}/filesGeneration/broker
%{__mkdir_p} %{buildroot}%{_datadir}/%{d_name}/filesGeneration/nagiosCFG
%{__mkdir_p} %{buildroot}%{_datadir}/%{d_name}/filesUpload
%{__mkdir_p} %{buildroot}%{_datadir}/%{d_name}/filesUpload/images
%{__mkdir_p} %{buildroot}%{_datadir}/%{d_name}/filesUpload/nagiosCFG
%{__mkdir_p} %{buildroot}%{_datadir}/%{d_name}/www/img/media
%{__mkdir_p} %{buildroot}%{_datadir}/%{d_name}/www/modules
%{__mkdir_p} %{buildroot}/var/lib/%{d_name}
%{__mkdir_p} %{buildroot}/var/lib/%{d_name}/centplugins
%{__mkdir_p} %{buildroot}/var/lib/%{d_name}/metrics
%{__mkdir_p} %{buildroot}/var/lib/%{d_name}/status
%{__mkdir_p} %{buildroot}/var/spool/centreontrapd

# fix permissions
%{__chmod} +x %{buildroot}%{_datadir}/centreon/cron/centstorage_purge.php
%{__chmod} +x %{buildroot}%{_datadir}/centreon/cron/nagiosPerfTrace
%{__chmod} +x %{buildroot}%{_datadir}/centreon/cron/nightly_tasks_manager

# fix rpmlint: script-without-shebang (generate through installs statements above
#%%{__chmod} -x %%{buildroot}/usr/lib/nagios/plugins/centreon.pm
#%%{__chmod} -x %%{buildroot}/usr/lib/nagios/plugins/Centreon/SNMP/Utils.pm
#%%{__chmod} -x %%{buildroot}/usr/lib/nagios/plugins/centreon.conf
#%%{__chmod} -x %%{buildroot}/usr/lib/nagios/plugins/traps/conf/snmp.conf
#%%{__chmod} -x %%{buildroot}/usr/lib/nagios/plugins/traps/conf/snmptt.ini
#%%{__chmod} -x %%{buildroot}/usr/lib/nagios/plugins/traps/conf/snmptrapd.conf
%{__chmod} -x %{buildroot}%{_datadir}/centreon/bin/centreon-partitioning.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/bin/migrateWikiPages.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/lib/perl/centreon/script/centcore.pm
#%%{__chmod} -x %%{buildroot}%%{_datadir}/centreon/www/include/views/graphs/javascript/cropper/cropper.uncompressed.js
#%%{__chmod} -x %%{buildroot}%%{_datadir}/centreon/www/include/views/graphs/javascript/cropper/cropper.css
#%%{__chmod} -x %%{buildroot}%%{_datadir}/centreon/www/include/common/javascript/scriptaculous/themes/test/theme.css
%{__chmod} -x %{buildroot}%{_datadir}/centreon/cron/centAcl-Func.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/cron/centAcl.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/cron/centreon-partitioning.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/cron/centKnowledgeSynchronizer.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/cron/centstorage_purge.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/class/centreonGraphVirtualMetric.class.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/include/configuration/configObject/host_template_model/formHostTemplateModel.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/include/configuration/configObject/host_template_model/listHostTemplateModel.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/include/configuration/configObject/host_template_model/listHostTemplateModel.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/include/common/javascript/charts/c3.min.css
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/include/views/graphs/graphs.html
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/include/monitoring/status/monitoringHostGroup.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/include/Administration/parameters/css/form.ihtml
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/include/monitoring/comments/listComment.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/include/configuration/configObject/command/command.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/include/configuration/configObject/command/formCommand.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/include/configuration/configObject/escalation/formEscalation.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/include/configuration/configObject/host_template_model/hostTemplateModel.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/include/configuration/configObject/command/listCommand.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/class/centreonUtils.class.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/class/centreonCommand.class.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/class/centreonGraphCurve.class.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/class/centreonHost.class.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/class/centreonLocale.class.php
%{__chmod} -x %{buildroot}%{_datadir}/centreon/www/class/centreonHook.class.php

%pre
# add systemd service
%service_add_pre centcore.service
#%%service_add_pre centstorage.service
%service_add_pre centreontrapd.service

# insert user and groups
if ! id centreon &>/dev/null; then
  %{_sbindir}/groupadd -r centreon &>/dev/null
  %{_sbindir}/useradd -m -g centreon -d %{_datadir}/centreon -r centreon &>/dev/null
  %{_sbindir}/usermod -a -G centreon nagios
  %{_sbindir}/usermod -a -G centreon wwwrun
  %{_sbindir}/usermod -a -G www centreon
#  %%{_sbindir}/usermod -a -G nagcmd centreon
fi

# add sudoers stuff
if [ -f /etc/sudoers ]; then
  if [ `%{__cat} /etc/sudoers | grep -q "^##\ BEGIN:\ CENTREON"; echo $? 2>/dev/null` -ne 0 ]; then
    %{__cat} >> /etc/sudoers << EOF
##
## BEGIN: CENTREON SUDO
##
# Add by CENTREON installation script
User_Alias      CENTREON=wwwrun,centreon
User_Alias      CHECK_ICMP=nagios,centreon,centreon-broker,centreon-engine
Defaults:CENTREON !requiretty
# Broker engine start
CENTREON   ALL = NOPASSWD: /etc/init.d/centbroker start
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentbroker start
CENTREON   ALL = NOPASSWD: /usr/sbin/service centbroker start
CENTREON   ALL = NOPASSWD: /sbin/service centbroker start
# Broker engine stop
CENTREON   ALL = NOPASSWD: /etc/init.d/centbroker stop
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentbroker stop
CENTREON   ALL = NOPASSWD: /usr/sbin/service centbroker stop
CENTREON   ALL = NOPASSWD: /sbin/service centbroker stop
# Broker engine restart
CENTREON   ALL = NOPASSWD: /etc/init.d/centbroker restart
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentbroker restart
CENTREON   ALL = NOPASSWD: /usr/sbin/service centbroker restart
CENTREON   ALL = NOPASSWD: /sbin/service centbroker restart
# Broker engine reload
CENTREON   ALL = NOPASSWD: /etc/init.d/centbroker reload
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentbroker reload
CENTREON   ALL = NOPASSWD: /usr/sbin/service centbroker reload
CENTREON   ALL = NOPASSWD: /sbin/service centbroker reload
# Broker engine status
CENTREON   ALL = NOPASSWD: /etc/init.d/centbroker status
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentbroker status
CENTREON   ALL = NOPASSWD: /usr/sbin/service centbroker status
CENTREON   ALL = NOPASSWD: /sbin/service centbroker status
# Centreon engine start 
CENTREON   ALL = NOPASSWD: /etc/init.d/centengine start
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentengine start
CENTREON   ALL = NOPASSWD: /usr/sbin/service centengine start
CENTREON   ALL = NOPASSWD: /sbin/service centengine start
# Centreon engine stop
CENTREON   ALL = NOPASSWD: /etc/init.d/centengine stop
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentengine stop
CENTREON   ALL = NOPASSWD: /usr/sbin/service centengine stop
CENTREON   ALL = NOPASSWD: /sbin/service centengine stop
# Centreon engine restart 
CENTREON   ALL = NOPASSWD: /etc/init.d/centengine restart
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentengine restart
CENTREON   ALL = NOPASSWD: /usr/sbin/service centengine restart
CENTREON   ALL = NOPASSWD: /sbin/service centengine restart
# Centreon engine reload 
CENTREON   ALL = NOPASSWD: /etc/init.d/centengine reload
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentengine reload
CENTREON   ALL = NOPASSWD: /usr/sbin/service centengine reload
CENTREON   ALL = NOPASSWD: /sbin/service centengine reload
# Centreon engine force reload 
CENTREON   ALL = NOPASSWD: /etc/init.d/centengine force-reload
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentengine force-reload
CENTREON   ALL = NOPASSWD: /usr/sbin/service centengine force-reload
CENTREON   ALL = NOPASSWD: /sbin/service centengine force-reload
# Centreon engine status
CENTREON   ALL = NOPASSWD: /etc/init.d/centengine status
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentengine status
CENTREON   ALL = NOPASSWD: /usr/sbin/service centengine status
CENTREON   ALL = NOPASSWD: /sbin/service centengine status
# Centreontrapd start
CENTREON   ALL = NOPASSWD: /etc/init.d/centreontrapd start
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentreontrapd start
CENTREON   ALL = NOPASSWD: /usr/sbin/service centreontrapd start
CENTREON   ALL = NOPASSWD: /sbin/service centreontrapd start
# Centreontrapd stop
CENTREON   ALL = NOPASSWD: /etc/init.d/centreontrapd stop
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentreontrapd stop
CENTREON   ALL = NOPASSWD: /usr/sbin/service centreontrapd stop
CENTREON   ALL = NOPASSWD: /sbin/service centreontrapd stop
# Centreontrapd status
CENTREON   ALL = NOPASSWD: /etc/init.d/centreontrapd status
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentreontrapd status
CENTREON   ALL = NOPASSWD: /usr/sbin/service centreontrapd status
CENTREON   ALL = NOPASSWD: /sbin/service centreontrapd status
# Centreontrapd reload
CENTREON   ALL = NOPASSWD: /etc/init.d/centreontrapd reload
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentreontrapd reload
CENTREON   ALL = NOPASSWD: /usr/sbin/service centreontrapd reload
CENTREON   ALL = NOPASSWD: /sbin/service centreontrapd reload
# Centreontrapd Restart
CENTREON   ALL = NOPASSWD: /etc/init.d/centreontrapd restart
CENTREON   ALL = NOPASSWD: /usr/sbin/rccentreontrapd restart
CENTREON   ALL = NOPASSWD: /usr/sbin/service centreontrapd restart
CENTREON   ALL = NOPASSWD: /sbin/service centreontrapd restart
# Snmptrapd Restart
CENTREON   ALL = NOPASSWD: /etc/init.d/snmptrapd restart
CENTREON   ALL = NOPASSWD: /usr/sbin/rcsnmptrapd restart
CENTREON   ALL = NOPASSWD: /usr/sbin/service snmptrapd restart
CENTREON   ALL = NOPASSWD: /sbin/service snmptrapd restart
# ntop stop
CENTREON   ALL = NOPASSWD: /etc/init.d/ntop stop
CENTREON   ALL = NOPASSWD: /usr/sbin/rcntop stop
CENTREON   ALL = NOPASSWD: /usr/sbin/service ntop stop
CENTREON   ALL = NOPASSWD: /sbin/service ntop stop
# ntop start
CENTREON   ALL = NOPASSWD: /etc/init.d/ntop start
CENTREON   ALL = NOPASSWD: /usr/sbin/rcntop start
CENTREON   ALL = NOPASSWD: /usr/sbin/service ntop start
CENTREON   ALL = NOPASSWD: /sbin/service ntop start
# ntop restart 
CENTREON   ALL = NOPASSWD: /etc/init.d/ntop restart
CENTREON   ALL = NOPASSWD: /usr/sbin/rcntop restart
CENTREON   ALL = NOPASSWD: /usr/sbin/service ntop restart
CENTREON   ALL = NOPASSWD: /sbin/service ntop restart
# check_icmp
CHECK_ICMP ALL = (root) NOPASSWD: /usr/lib/nagios/plugins/check_icmp
## END: CENTREON SUDO 
EOF
  fi
fi

%preun
%service_del_preun centcore.service
#%%service_del_preun centstorage.service
%service_del_preun centreontrapd.service
%stop_on_removal centcore
#%%stop_on_removal centstorage
%stop_on_removal centreontrapd


%post
# Services
%service_add_post centcore.service
%service_add_post centreontrapd.service
%service_add_post apache2.service
%restart_on_update centcore
%restart_on_update centreontrapd
%restart_on_update apache2

# create /var/run/centreon
%if 0%{?suse_version} <= 1320
systemd-tmpfiles --create /usr/lib/tmpfiles.d/%{d_name}.conf
%else
%tmpfiles_create /usr/lib/tmpfiles.d/%{d_name}.conf
%endif
# install sysconfigs
%{fillup_only -n centcore}
%{fillup_only -n centstorage}
%{fillup_only -n centreontrapd}
# Permissions Set nagios
%set_permissions /etc/nagios/
%set_permissions /etc/nagios/objects/
%set_permissions /etc/nagios/cgi.cfg
%set_permissions /etc/nagios/nagios.cfg
%set_permissions /etc/nagios/ndo2db.cfg
%set_permissions /etc/nagios/ndomod.cfg
%set_permissions /etc/nagios/resource.cfg
%set_permissions /var/lib/nagios/
%set_permissions /var/log/nagios/
%set_permissions /var/spool/nagios/
# Permissions Set centreon
%set_permissions /etc/centreon/
%set_permissions /var/log/centreon/
%set_permissions /var/lib/centreon/
%set_permissions /var/lib/centreon/centplugins/
%set_permissions /var/lib/centreon/metrics/
%set_permissions /var/lib/centreon/status/
%set_permissions /var/spool/centreontrapd/
%set_permissions /var/cache/centreon/
%set_permissions /var/cache/centreon/backup/
%set_permissions %{_datadir}/centreon/
%set_permissions %{_datadir}/centreon/filesGeneration/
%set_permissions %{_datadir}/centreon/filesGeneration/broker/
%set_permissions %{_datadir}/centreon/filesGeneration/nagiosCFG/
%set_permissions %{_datadir}/centreon/filesUpload/
%set_permissions %{_datadir}/centreon/filesUpload/images/
%set_permissions %{_datadir}/centreon/filesUpload/nagiosCFG/
%set_permissions %{_datadir}/centreon/www/
%set_permissions %{_datadir}/centreon/www/img/media/
%set_permissions %{_datadir}/centreon/installDir/
# Permissions Set several
%set_permissions %{_sysconfdir}/snmp/centreon_traps/
%verifyscript
# Permissions Verify nagios
%verify_permissions -e /etc/nagios/
%verify_permissions -e /etc/nagios/objects/
%verify_permissions /etc/nagios/cgi.cfg
%verify_permissions /etc/nagios/nagios.cfg
%verify_permissions /etc/nagios/ndo2db.cfg
%verify_permissions /etc/nagios/ndomod.cfg
%verify_permissions /etc/nagios/resource.cfg
%verify_permissions /var/lib/nagios/
%verify_permissions /var/log/nagios/
%verify_permissions /var/spool/nagios/
# Permissions Verify centreon
%verify_permissions -e /etc/centreon/
%verify_permissions -e /var/log/centreon/
%verify_permissions -e /var/lib/centreon/
%verify_permissions -e /var/lib/centreon/centplugins/
%verify_permissions -e /var/lib/centreon/metrics/
%verify_permissions -e /var/lib/centreon/status/
%verify_permissions -e /var/spool/centreontrapd/
%verify_permissions -e /var/cache/centreon/
%verify_permissions -e /var/cache/centreon/backup/
%verify_permissions %{_datadir}/centreon/
%verify_permissions %{_datadir}/centreon/filesGeneration/
%verify_permissions %{_datadir}/centreon/filesGeneration/broker/
%verify_permissions %{_datadir}/centreon/filesGeneration/nagiosCFG/
%verify_permissions %{_datadir}/centreon/filesUpload/
%verify_permissions %{_datadir}/centreon/filesUpload/images/
%verify_permissions %{_datadir}/centreon/filesUpload/nagiosCFG/
%verify_permissions %{_datadir}/centreon/www/
%verify_permissions %{_datadir}/centreon/www/img/media/
%verify_permissions %{_datadir}/centreon/installDir/
# Permissions Verify several
%verify_permissions %{_sysconfdir}/snmp/centreon_traps/

%postun
%service_del_postun centcore.service
#%%service_del_postun centstorage.service
%service_del_postun centreontrapd.service
%service_del_postun apache2.service
%restart_on_update centcore
#%%restart_on_update centstorage
%restart_on_update centreontrapd
%restart_on_update apache2
%insserv_cleanup


%files
%defattr(-,root,root,-)
%license LICENSE.md
%doc doc CHANGELOG README.md README.SUSE
#%%ghost %%attr(0770,centreon,centreon) /var/run/%%{d_name}/
%dir %attr(0775,centreon,centreon) %{_sysconfdir}/%{d_name}
%dir %attr(0775,centreon,centreon) %{_sysconfdir}/snmp/centreon_traps
%dir %attr(2775,centreon,centreon) /var/lib/%{d_name}
%dir %attr(2775,centreon,centreon) /var/lib/%{d_name}/centplugins
%dir %attr(2775,centreon,centreon) /var/lib/%{d_name}/metrics
%dir %attr(2775,centreon,centreon) /var/lib/%{d_name}/status
%dir %attr(2770,centreon,centreon) /var/log/centreon
%dir %attr(2770,centreon,centreon) /var/spool/centreontrapd
%dir %attr(2770,centreon,centreon) /var/cache/%{d_name}
%dir %attr(2770,centreon,centreon) /var/cache/%{d_name}/backup
%dir %attr(0775,centreon,centreon) %{_datadir}/centreon/filesGeneration/
%dir %attr(0775,centreon,centreon) %{_datadir}/centreon/filesGeneration/broker/
%dir %attr(0775,centreon,centreon) %{_datadir}/centreon/filesGeneration/nagiosCFG/
%dir %attr(0775,centreon,centreon) %{_datadir}/centreon/filesUpload/
%dir %attr(0775,centreon,centreon) %{_datadir}/centreon/filesUpload/images/
%dir %attr(0775,centreon,centreon) %{_datadir}/centreon/filesUpload/nagiosCFG/
%dir %attr(0775,centreon,centreon) %{_datadir}/centreon/www/img/media/
%dir %attr(0775,centreon,centreon) %{_datadir}/centreon/installDir/
%dir %attr(0775,centreon,centreon)  /usr/lib/centreon/
%dir %attr(0775,centreon,centreon)  /usr/lib/centreon/plugins/
%config(noreplace) %{_sysconfdir}/apache2/conf.d/centreon.conf
%config(noreplace) %{_sysconfdir}/%{d_name}/*.conf
%config(noreplace) %{_sysconfdir}/cron.d/*.cron
%config(noreplace) %{_sysconfdir}/logrotate.d/cent*
%config(noreplace) %{_sysconfdir}/permissions.d/%{d_name}
%config(noreplace) %{_sysconfdir}/snmp/snmp*
%config(noreplace) %{_sysconfdir}/my.cnf.d/%{d_name}.my.cnf
%config(noreplace) %{_sysconfdir}/sysctl.d/%{d_name}.sysctl.conf
%{_unitdir}/cent*.service
#/usr/lib/nagios/plugins/*
#/usr/lib/nagios/
#/usr/lib/nagios/plugins/
%perl_vendorlib
%{_sbindir}/rccent*
/usr/lib/tmpfiles.d/%{d_name}.conf
%{_fillupdir}/sysconfig.centcore
%{_fillupdir}/sysconfig.centstorage
%{_fillupdir}/sysconfig.centreontrapd
%{_unitdir}/centcore.service
%{_unitdir}/centreontrapd.service
#%%{_unitdir}/centstorage.service

# change defattr
%defattr(-,centreon,centreon,0775)
%dir %{_datadir}/centreon
%dir %{_datadir}/centreon/GPL_LIB
%dir %{_datadir}/centreon/bin
%dir %{_datadir}/centreon/config
%dir %{_datadir}/centreon/cron
%dir %{_datadir}/centreon/doc
%dir %{_datadir}/centreon/features
%dir %{_datadir}/centreon/filesGeneration
%dir %{_datadir}/centreon/lib
%dir %{_datadir}/centreon/libinstall
%dir %{_datadir}/centreon/src
%dir %{_datadir}/centreon/vendor
%dir %{_datadir}/centreon/www
%dir %{_datadir}/centreon/www/api
%dir %{_datadir}/centreon/www/Themes
%dir %{_datadir}/centreon/www/class
%dir %{_datadir}/centreon/www/img
%dir %{_datadir}/centreon/www/img/icones
%dir %{_datadir}/centreon/www/img/icons
%dir %{_datadir}/centreon/www/img/misc
%dir %{_datadir}/centreon/www/include
%dir %{_datadir}/centreon/www/install
%dir %{_datadir}/centreon/www/lib
%dir %{_datadir}/centreon/www/modules
%dir %{_datadir}/centreon/www/sounds
%dir %{_datadir}/centreon/www/widgets
%{_datadir}/centreon/*
%{_datadir}/centreon/GPL_LIB/*
%{_datadir}/centreon/bin/*
%{_datadir}/centreon/config/*
%{_datadir}/centreon/cron/*
%{_datadir}/centreon/doc/*
%{_datadir}/centreon/features/*
%{_datadir}/centreon/filesGeneration
%{_datadir}/centreon/lib/*
%{_datadir}/centreon/libinstall/*
%{_datadir}/centreon/src
%{_datadir}/centreon/vendor
%attr(0664,centreon,centreon) %{_datadir}/centreon/www/index.html
%{_datadir}/centreon/www/*.php
%{_datadir}/centreon/www/*.txt
%{_datadir}/centreon/www/api/*
%{_datadir}/centreon/www/template
%{_datadir}/centreon/www/locale
%{_datadir}/centreon/www/Themes/*
%{_datadir}/centreon/www/class/*
%{_datadir}/centreon/www/front_src
%{_datadir}/centreon/www/img/*.png
%{_datadir}/centreon/www/img/*.gif
%{_datadir}/centreon/www/img/*.ico
%{_datadir}/centreon/www/img/index.html
%{_datadir}/centreon/www/img/icones/*
%{_datadir}/centreon/www/img/icons/*
%{_datadir}/centreon/www/img/media/.keep 
%{_datadir}/centreon/www/img/misc/*
%{_datadir}/centreon/www/include/*
%{_datadir}/centreon/www/install/*
%{_datadir}/centreon/www/lib/*
%{_datadir}/centreon/www/modules/*
%{_datadir}/centreon/www/sounds/*
%{_datadir}/centreon/www/widgets/*


%changelog