From e50221fde80a88fff79b215712d7489e40d8bba6 Mon Sep 17 00:00:00 2001 From: Michael Friedrich Date: Sat, 13 Sep 2014 00:02:55 +0200 Subject: [PATCH] spec: Use application name in install path refs #6401 --- icingaweb2.spec | 33 ++++++++++--------- packages/rpm/README.md | 16 ++++----- packages/rpm/etc/httpd/conf.d/icingaweb.conf | 6 ++-- .../authentication.ini | 0 .../modules/monitoring/backends.ini | 0 .../modules/monitoring/instances.ini | 0 .../{icingaweb => icingaweb2}/resources.ini | 2 +- packages/rpm/usr/bin/icingacli | 2 +- 8 files changed, 31 insertions(+), 28 deletions(-) rename packages/rpm/etc/{icingaweb => icingaweb2}/authentication.ini (100%) rename packages/rpm/etc/{icingaweb => icingaweb2}/modules/monitoring/backends.ini (100%) rename packages/rpm/etc/{icingaweb => icingaweb2}/modules/monitoring/instances.ini (100%) rename packages/rpm/etc/{icingaweb => icingaweb2}/resources.ini (92%) diff --git a/icingaweb2.spec b/icingaweb2.spec index 5d5b9ec9c..db0929f7b 100644 --- a/icingaweb2.spec +++ b/icingaweb2.spec @@ -26,12 +26,12 @@ %define revision 1 -%define configdir %{_sysconfdir}/icingaweb -%define sharedir %{_datadir}/icingaweb -%define prefixdir %{_datadir}/icingaweb -%define logdir %{sharedir}/log +%define configdir %{_sysconfdir}/%{name} +%define sharedir %{_datadir}/%{name} +%define prefixdir %{_datadir}/%{name} %define usermodparam -a -G -%define logdir %{_localstatedir}/log/icingaweb +%define logdir %{_localstatedir}/log/%{name} +%define docdir %{sharedir}/log %if "%{_vendor}" == "suse" %define phpname php5 @@ -172,25 +172,26 @@ install -D -m0644 packages/rpm/etc/httpd/conf.d/icingaweb.conf %{buildroot}/%{ap # install public, library, modules %{__mkdir} -p %{buildroot}/%{sharedir} %{__mkdir} -p %{buildroot}/%{logdir} -%{__mkdir} -p %{buildroot}/%{_sysconfdir}/icingaweb +%{__mkdir} -p %{buildroot}/%{docdir} +%{__mkdir} -p %{buildroot}/%{_sysconfdir}/%{name} %{__mkdir} -p %{buildroot}/%{_sysconfdir}/dashboard -%{__mkdir} -p %{buildroot}/%{_sysconfdir}/icingaweb/modules -%{__mkdir} -p %{buildroot}/%{_sysconfdir}/icingaweb/modules/monitoring -%{__mkdir} -p %{buildroot}/%{_sysconfdir}/icingaweb/enabledModules +%{__mkdir} -p %{buildroot}/%{_sysconfdir}/%{name}/modules +%{__mkdir} -p %{buildroot}/%{_sysconfdir}/%{name}/modules/monitoring +%{__mkdir} -p %{buildroot}/%{_sysconfdir}/%{name}/enabledModules -%{__cp} -r application library modules public %{buildroot}/%{sharedir}/ +%{__cp} -r application doc library modules public %{buildroot}/%{sharedir}/ ## config # authentication is db only -install -D -m0644 packages/rpm/etc/icingaweb/authentication.ini %{buildroot}/%{_sysconfdir}/icingaweb/authentication.ini +install -D -m0644 packages/rpm/etc/%{name}/authentication.ini %{buildroot}/%{_sysconfdir}/%{name}/authentication.ini # custom resource paths -install -D -m0644 packages/rpm/etc/icingaweb/resources.ini %{buildroot}/%{_sysconfdir}/icingaweb/resources.ini +install -D -m0644 packages/rpm/etc/%{name}/resources.ini %{buildroot}/%{_sysconfdir}/%{name}/resources.ini # monitoring module (icinga2) -install -D -m0644 packages/rpm/etc/icingaweb/modules/monitoring/backends.ini %{buildroot}/%{_sysconfdir}/icingaweb/modules/monitoring/backends.ini -install -D -m0644 packages/rpm/etc/icingaweb/modules/monitoring/instances.ini %{buildroot}/%{_sysconfdir}/icingaweb/modules/monitoring/instances.ini +install -D -m0644 packages/rpm/etc/%{name}/modules/monitoring/backends.ini %{buildroot}/%{_sysconfdir}/%{name}/modules/monitoring/backends.ini +install -D -m0644 packages/rpm/etc/%{name}/modules/monitoring/instances.ini %{buildroot}/%{_sysconfdir}/%{name}/modules/monitoring/instances.ini # enable the monitoring module by default -ln -s %{sharedir}/modules/monitoring %{buildroot}/%{_sysconfdir}/icingaweb/enabledModules/monitoring +ln -s %{sharedir}/modules/monitoring %{buildroot}/%{_sysconfdir}/%{name}/enabledModules/monitoring ## config # install icingacli @@ -228,6 +229,8 @@ fi %config(noreplace) %attr(-,%{apacheuser},%{apachegroup}) %{configdir} # logs %attr(2775,%{apacheuser},%{apachegroup}) %dir %{logdir} +# shipped docs +%attr(755,%{apacheuser},%{apachegroup}) %{sharedir}/doc %files -n php-Icinga %attr(755,%{apacheuser},%{apachegroup}) %{sharedir}/application diff --git a/packages/rpm/README.md b/packages/rpm/README.md index d218a51eb..5dd1006c5 100644 --- a/packages/rpm/README.md +++ b/packages/rpm/README.md @@ -42,8 +42,8 @@ Decide whether to use MySQL or PostgreSQL. FLUSH PRIVILEGES; quit - mysql -u root -p icingaweb < /usr/share/doc/icingaweb2-*/schema/accounts.mysql.sql - mysql -u root -p icingaweb < /usr/share/doc/icingaweb2-*/schema/preferences.mysql.sql + mysql -u root -p icingaweb < /usr/share/doc/icingaweb2*/schema/accounts.mysql.sql + mysql -u root -p icingaweb < /usr/share/doc/icingaweb2*/schema/preferences.mysql.sql ### PostgreSQL @@ -62,8 +62,8 @@ in `/var/lib/pgsql/data/pg_hba.conf` and restart the PostgreSQL server. Now install the `icingaweb` schema - bash$ psql -U icingaweb -a -f /usr/share/doc/icingaweb2-*/schema/accounts.pgsql.sql - bash$ psql -U icingaweb -a -f /usr/share/doc/icingaweb2-*/schema/preferences.pgsql.sql + bash$ psql -U icingaweb -a -f /usr/share/doc/icingaweb2*/schema/accounts.pgsql.sql + bash$ psql -U icingaweb -a -f /usr/share/doc/icingaweb2*/schema/preferences.pgsql.sql ## Configuration @@ -74,16 +74,16 @@ The monitoring module is enabled by default. ### Backend configuration -`/etc/icingaweb/resources.ini` contains the database backend information. +`/etc/icingaweb2/resources.ini` contains the database backend information. By default the Icinga 2 DB IDO is used by the monitoring module in -`/etc/icingaweb/modules/monitoring/backends.ini` +`/etc/icingaweb2/modules/monitoring/backends.ini` The external command pipe is required for sending commands and configured for Icinga 2 in -`/etc/icingaweb/modules/monitoring/instances.ini` +`/etc/icingaweb2/modules/monitoring/instances.ini` ### Authentication configuration -The `/etc/icingaweb/authentication.ini` file uses the internal database as +The `/etc/icingaweb2/authentication.ini` file uses the internal database as default. This requires the database being installed properly before allowing users to login via web console. diff --git a/packages/rpm/etc/httpd/conf.d/icingaweb.conf b/packages/rpm/etc/httpd/conf.d/icingaweb.conf index cf2fd82a4..1db9f20f2 100644 --- a/packages/rpm/etc/httpd/conf.d/icingaweb.conf +++ b/packages/rpm/etc/httpd/conf.d/icingaweb.conf @@ -1,6 +1,6 @@ -Alias /icingaweb "/usr/share/icingaweb/public" +Alias /icingaweb "/usr/share/icingaweb2/public" - + Options SymLinksIfOwnerMatch AllowOverride None @@ -17,7 +17,7 @@ Alias /icingaweb "/usr/share/icingaweb/public" Allow from all - SetEnv ICINGAWEB_CONFIGDIR /etc/icingaweb + SetEnv ICINGAWEB_CONFIGDIR /etc/icingaweb2 EnableSendfile Off diff --git a/packages/rpm/etc/icingaweb/authentication.ini b/packages/rpm/etc/icingaweb2/authentication.ini similarity index 100% rename from packages/rpm/etc/icingaweb/authentication.ini rename to packages/rpm/etc/icingaweb2/authentication.ini diff --git a/packages/rpm/etc/icingaweb/modules/monitoring/backends.ini b/packages/rpm/etc/icingaweb2/modules/monitoring/backends.ini similarity index 100% rename from packages/rpm/etc/icingaweb/modules/monitoring/backends.ini rename to packages/rpm/etc/icingaweb2/modules/monitoring/backends.ini diff --git a/packages/rpm/etc/icingaweb/modules/monitoring/instances.ini b/packages/rpm/etc/icingaweb2/modules/monitoring/instances.ini similarity index 100% rename from packages/rpm/etc/icingaweb/modules/monitoring/instances.ini rename to packages/rpm/etc/icingaweb2/modules/monitoring/instances.ini diff --git a/packages/rpm/etc/icingaweb/resources.ini b/packages/rpm/etc/icingaweb2/resources.ini similarity index 92% rename from packages/rpm/etc/icingaweb/resources.ini rename to packages/rpm/etc/icingaweb2/resources.ini index 1c1e62eb1..833f84ba8 100644 --- a/packages/rpm/etc/icingaweb/resources.ini +++ b/packages/rpm/etc/icingaweb2/resources.ini @@ -22,7 +22,7 @@ socket = /var/run/icinga2/cmd/livestatus [logfile] type = file -filename = "/var/log/icingaweb/icingaweb.log" +filename = "/var/log/icingaweb2/icingaweb2.log" fields = "/^(?[0-9]{4}(-[0-9]{2}){2}T[0-9]{2}(:[0-9]{2}){2}(\\+[0-9]{2}:[0-9]{2})?) - (?[A-Za-z]+) - (?.*)$/" ; format: PCRE ; diff --git a/packages/rpm/usr/bin/icingacli b/packages/rpm/usr/bin/icingacli index 03ed43116..d6c4010b6 100755 --- a/packages/rpm/usr/bin/icingacli +++ b/packages/rpm/usr/bin/icingacli @@ -2,5 +2,5 @@ dispatch();