Provide packages for icinga-studio on Fedora

Moves libraries to separate subpackage

fixes #10952

Signed-off-by: Gunnar Beutner <gunnar@beutner.name>
This commit is contained in:
Dirk Goetz 2016-01-11 16:17:01 +01:00 committed by Gunnar Beutner
parent de11ef704a
commit 882495952a
1 changed files with 63 additions and 6 deletions

View File

@ -105,6 +105,9 @@ BuildRequires: cmake
BuildRequires: flex >= 2.5.35
BuildRequires: bison
BuildRequires: make
%if 0%{?fedora}
BuildRequires: wxGTK3-devel
%endif
%if 0%{?build_icinga_org} && "%{_vendor}" == "redhat" && (0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6")
# el5 and el6 require packages.icinga.org
@ -123,11 +126,11 @@ BuildRequires: systemd
Requires: systemd
%endif
Requires: %{name}-common = %{version}-%{release}
Requires: %{name}-libs = %{version}-%{release}
%description bin
Icinga 2 is a general-purpose network monitoring application.
Provides binaries and libraries for Icinga 2 Core.
Provides binaries for Icinga 2 Core.
%package common
Summary: Common Icinga 2 configuration
@ -154,6 +157,15 @@ Requires: %{name} = %{version}-%{release}
Provides documentation for Icinga 2.
%package libs
Summary: Libraries for Icinga 2
Group: Applications/System
Requires: %{name}-common = %{version}-%{release}
%description libs
Provides internal libraries for the daemon or studio.
%package ido-mysql
Summary: IDO MySQL database backend for Icinga 2
Group: Applications/System
@ -222,6 +234,18 @@ SELinux policy module supporting icinga2
%endif
%if 0%{?fedora}
%package studio
Summary: Studio for Icinga 2
Group: Applications/System
Requires: %{name}-libs = %{version}-%{release}
Requires: wxGTK3
%description studio
Provides a GUI for the Icinga 2 API.
%endif
%prep
%setup -q -n %{name}-%{version}
@ -236,6 +260,9 @@ CMAKE_OPTS="-DCMAKE_INSTALL_PREFIX=/usr \
-DICINGA2_USER=%{icinga_user} \
-DICINGA2_GROUP=%{icinga_group} \
-DICINGA2_COMMAND_GROUP=%{icingacmd_group}"
%if 0%{?fedora}
CMAKE_OPTS="$CMAKE_OPTS -DICINGA2_WITH_STUDIO=true"
%endif
%if "%{_vendor}" == "redhat"
%if 0%{?el5} || 0%{?rhel} == 5 || "%{?dist}" == ".el5" || 0%{?el6} || 0%{?rhel} == 6 || "%{?dist}" == ".el6"
# Boost_VERSION 1.41.0 vs 101400 - disable build tests
@ -321,6 +348,24 @@ cd -
/usr/sbin/hardlink -cv %{buildroot}%{_datadir}/selinux
%endif
%if 0%{?fedora}
mkdir -p "%{buildroot}%{_datadir}/icinga2-studio"
install -p -m 644 icinga-studio/icinga.ico %{buildroot}%{_datadir}/icinga2-studio
mkdir -p "%{buildroot}%{_datadir}/applications"
echo "[Desktop Entry]
Name=Icinga 2 Studio
Comment=API viewer for Icinga 2
TryExec=icinga-studio
Exec=icinga-studio
Icon=/usr/share/icinga2-studio/icinga.ico
StartupNotify=true
Terminal=false
Type=Application
Categories=GTK;Utility;
Keywords=Monitoring;" > %{buildroot}%{_datadir}/applications/icinga2-studio.desktop
%endif
%clean
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
@ -537,10 +582,6 @@ fi
%defattr(-,root,root,-)
%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
%{_sbindir}/%{name}
%exclude %{_libdir}/%{name}/libdb_ido_mysql*
%exclude %{_libdir}/%{name}/libdb_ido_pgsql*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/*.so*
%dir %{_libdir}/%{name}/sbin
%{_libdir}/%{name}/sbin/%{name}
%{_datadir}/%{name}
@ -557,6 +598,14 @@ fi
%attr(0750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}
%attr(2750,%{icinga_user},%{icingacmd_group}) %ghost %{_rundir}/%{name}/cmd
%files libs
%defattr(-,root,root,-)
%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog
%exclude %{_libdir}/%{name}/libdb_ido_mysql*
%exclude %{_libdir}/%{name}/libdb_ido_pgsql*
%dir %{_libdir}/%{name}
%{_libdir}/%{name}/*.so*
%files common
%defattr(-,root,root,-)
%doc COPYING COPYING.Exceptions README.md NEWS AUTHORS ChangeLog tools/syntax
@ -634,4 +683,12 @@ fi
%{_datadir}/selinux/*/%{modulename}.pp
%endif
%if 0%{?fedora}
%files studio
%defattr(-,root,root,-)
%{_bindir}/icinga-studio
%{_datadir}/icinga2-studio
%{_datadir}/applications/icinga2-studio.desktop
%endif
%changelog