-# - check python package
-# what about /usr/share/python2.4/site-packages/OpenIPMI.py ?
-
+#
+# Conditional build:
+%bcond_without gui # don't build tkinter-based GUI
+#
Summary: IPMI abstraction layer
Summary(pl): Warstwa abstrakcji IPMI
Name: OpenIPMI
-Version: 2.0.1
-Release: 0.99
+Version: 2.0.8
+Release: 1
License: LGPL (library), GPL (ipmicmd)
Group: Libraries
Source0: http://dl.sourceforge.net/openipmi/%{name}-%{version}.tar.gz
-# Source0-md5: b5474114ff84a872c5075744201bc4f0
+# Source0-md5: 3bfc9c232ef0d4ccc3c4355e17ba79d5
Patch0: %{name}-link.patch
+Patch1: %{name}-python.patch
URL: http://openipmi.sourceforge.net/
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: perl-devel
BuildRequires: pkgconfig
BuildRequires: popt-devel
-BuildRequires: swig
+BuildRequires: python-devel
+%{?with_gui:BuildRequires: python-tkinter}
+BuildRequires: tcl-devel
+BuildRequires: rpm-pythonprov
+BuildRequires: swig-perl >= 1.3.25
+BuildRequires: swig-python >= 1.3.25
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Perlowy interfejs do OpenIPMI.
%package -n python-%{name}
-Summary: Python interface to OpenIPMI
-Summary(pl): Pythonowy interfejs do OpenIPMI
-Group: Development/Languages/Python
-Requires: %{name} = %{version}-%{release}
+Summary: Python interface to OpenIPMI
+Summary(pl): Pythonowy interfejs do OpenIPMI
+Group: Development/Languages/Python
+Requires: %{name} = %{version}-%{release}
+%pyrequires_eq python-libs
%description -n python-%{name}
Python interface to OpenIPMI.
%description -n perl-%{name} -l pl
Pythonowy interfejs do OpenIPMI.
+%package gui
+Summary: OpenIPMI GUI
+Summary(pl): Graficzny interfejs u¿ytkownika do OpenIPMI
+Group: X11/Applications
+Requires: python-%{name} = %{version}-%{release}
+Requires: python-tkinter
+
+%description gui
+OpenIPMI GUI.
+
+%description gui -l pl
+Graficzny interfejs u¿ytkownika do OpenIPMI.
+
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
%build
%{__libtoolize}
%{__autoconf}
%{__automake}
CPPFLAGS="-I/usr/include/ncurses"
-%configure
-%{__make}
+%configure \
+ --without-glib12 \
+ %{!?with_gui:--without-tkinter}
+%{__make} \
+ PYTHON_INSTALL_DIR=%{py_sitedir}
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} install \
- DESTDIR=$RPM_BUILD_ROOT
+%{__make} install -j1 \
+ DESTDIR=$RPM_BUILD_ROOT \
+ PYTHON_INSTALL_DIR=%{py_sitedir}
+
+rm -f $RPM_BUILD_ROOT%{py_sitedir}/*.{py,la,a} \
+ $RPM_BUILD_ROOT%{py_sitedir}/openipmigui/*.py
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc ChangeLog FAQ README* TODO
-%attr(755,root,root) %{_bindir}/*
+%attr(755,root,root) %{_bindir}/ipmi*
+%attr(755,root,root) %{_bindir}/openipmicmd
+%attr(755,root,root) %{_bindir}/openipmish
+%attr(755,root,root) %{_bindir}/rmcp_ping
+%attr(755,root,root) %{_bindir}/solterm
%attr(755,root,root) %{_libdir}/lib*.so.*.*.*
%{_mandir}/man[178]/*
%attr(755,root,root) %{perl_vendorarch}/auto/OpenIPMI/OpenIPMI.so
%files -n python-%{name}
-%attr(755,root,root) %{py_sitescriptdir}/*.so
-%{py_sitescriptdir}/*.py[oc]
+%defattr(644,root,root,755)
+%attr(755,root,root) %{py_sitedir}/_OpenIPMI.so
+%{py_sitedir}/OpenIPMI.py[co]
+
+%if %{with gui}
+%files gui
+%defattr(644,root,root,755)
+%doc swig/python/openipmigui/TODO
+%attr(755,root,root) %{_bindir}/openipmigui
+%dir %{py_sitedir}/openipmigui
+%{py_sitedir}/openipmigui/*.py[co]
+%endif