+# TODO
+# - bad BR (version mismatch):
+# File "_mc_user.py", line 240, in ?
+# class MCUsers(gui_treelist.TreeList): AttributeError: 'module' object has no attribute 'TreeList'
+# make[4]: *** [_entity.pyc] Error 1
+#
+# Conditional build:
+%bcond_without gui # don't build tkinter-based GUI
+#
Summary: IPMI abstraction layer
Summary(pl): Warstwa abstrakcji IPMI
Name: OpenIPMI
-Version: 1.4.12
-Release: 1
+Version: 2.0.10
+Release: 2
License: LGPL (library), GPL (ipmicmd)
Group: Libraries
Source0: http://dl.sourceforge.net/openipmi/%{name}-%{version}.tar.gz
-# Source0-md5: 5df8e7ba28f020eafc175b1624c8d837
+# Source0-md5: 8f5c200c5f25c33250567eaeb685e8c0
Patch0: %{name}-link.patch
+Patch1: %{name}-python.patch
URL: http://openipmi.sourceforge.net/
BuildRequires: autoconf
BuildRequires: automake
+BuildRequires: gcc >= 5:3.2
BuildRequires: gdbm-devel
BuildRequires: glib2-devel >= 2.0
BuildRequires: libtool >= 1:1.4.2-9
BuildRequires: perl-devel
BuildRequires: pkgconfig
BuildRequires: popt-devel
+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
%description -n perl-%{name} -l pl
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}
+%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]/*
%{perl_vendorarch}/OpenIPMI.pm
%dir %{perl_vendorarch}/auto/OpenIPMI
%attr(755,root,root) %{perl_vendorarch}/auto/OpenIPMI/OpenIPMI.so
+
+%files -n python-%{name}
+%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