Skip to content

Commit

Permalink
Add Python module for the icinga2.debug file
Browse files Browse the repository at this point in the history
refs #6702
  • Loading branch information
gunnarbeutner committed Aug 15, 2014
1 parent bfe7138 commit abf87ea
Show file tree
Hide file tree
Showing 7 changed files with 360 additions and 1 deletion.
34 changes: 33 additions & 1 deletion icinga2.spec
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
%endif
%endif

%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}

%define icinga_user icinga
%define icinga_group icinga
%define icingacmd_group icingacmd
Expand Down Expand Up @@ -75,6 +79,7 @@ Meta package for Icinga 2 Core, DB IDO and Web.
Summary: Icinga 2 binaries and libraries
Group: Applications/System

Requires: python-%{name} = %{version}
%if "%{_vendor}" == "suse"
PreReq: permissions
%endif
Expand Down Expand Up @@ -107,6 +112,9 @@ Provides binaries and libraries for Icinga 2 Core.
%package common
Summary: Common Icinga 2 configuration
Group: Applications/System
%if %{?suse_version: %{suse_version} > 1110} %{!?suse_version:1}
BuildArchitectures: noarch
%endif
%if "%{_vendor}" == "redhat"
Requires(pre): shadow-utils
Requires(post): shadow-utils
Expand All @@ -123,6 +131,9 @@ packages.
%package doc
Summary: Documentation for Icinga 2
Group: Applications/System
%if %{?suse_version: %{suse_version} > 1110} %{!?suse_version:1}
BuildArchitectures: noarch
%endif
Requires: %{name} = %{version}-%{release}

%description doc
Expand Down Expand Up @@ -168,6 +179,20 @@ Icinga 1.x Classic UI Standalone configuration with locations
for Icinga 2.


%package -n python-icinga2
Summary: Python module for Icinga 2
Group: Application/System
%if %{?suse_version: %{suse_version} > 1110} %{!?suse_version:1}
BuildArchitectures: noarch
%endif
BuildRequires: python
BuildRequires: python-devel
BuildRequires: python-setuptools
Requires: python-setuptools

%description -n python-icinga2
Python module for Icinga 2.

%prep
%setup -q -n %{name}-%{version}

Expand Down Expand Up @@ -207,7 +232,6 @@ cmake $CMAKE_OPTS .

make %{?_smp_mflags}

rm -f components/db_ido_*sql/schema/upgrade/.gitignore

%install
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
Expand All @@ -233,6 +257,10 @@ mkdir -p "%{buildroot}%{_localstatedir}/adm/fillup-templates/"
mv "%{buildroot}%{_sysconfdir}/sysconfig/%{name}" "%{buildroot}%{_localstatedir}/adm/fillup-templates/sysconfig.%{name}"
%endif

pushd python
%{__python2} setup.py install --prefix=%{_prefix} --root=%{buildroot}
popd


%clean
[ "%{buildroot}" != "/" ] && [ -d "%{buildroot}" ] && rm -rf %{buildroot}
Expand Down Expand Up @@ -448,6 +476,7 @@ exit 0
%{_bindir}/%{name}-build-ca
%{_bindir}/%{name}-build-key
%{_bindir}/%{name}-sign-key
%{_bindir}/%{name}-list-objects
%{_sbindir}/%{name}-enable-feature
%{_sbindir}/%{name}-disable-feature
%{_sbindir}/%{name}-prepare-dirs
Expand Down Expand Up @@ -506,5 +535,8 @@ exit 0
%config(noreplace) %{apacheconfdir}/icinga.conf
%config(noreplace) %attr(0640,root,%{apachegroup}) %{icingaclassicconfdir}/passwd

%files -n python-icinga2
%{python2_sitelib}/icinga2*


%changelog
Empty file added python/icinga2/__init__.py
Empty file.
Empty file.
2 changes: 2 additions & 0 deletions python/icinga2/commands/list_objects.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
def main():
print "Hello World!"
Empty file added python/icinga2/util/__init__.py
Empty file.
Loading

0 comments on commit abf87ea

Please sign in to comment.