Browse Source

OpenIPMI-2.0.27-1

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@12090 ec354946-7b23-47d6-9f5a-488ba84defc7
tomop 4 years ago
parent
commit
79dde265a2
1 changed files with 68 additions and 7 deletions
  1. 68 7
      O/OpenIPMI/OpenIPMI-vl.spec

+ 68 - 7
O/OpenIPMI/OpenIPMI-vl.spec

@@ -1,10 +1,11 @@
 # TODO: uses private copy of libedit, should be modified to use system one
+%bcond_without python3
 
 %{!?python_sitearch: %define python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
 Summary: IPMI (Intelligent Platform Management Interface) library and tools
 Summary(ja): IPMI (Intelligent Platform Management Interface) ライブラリおよびツール
 Name: OpenIPMI
-Version: 2.0.25
+Version: 2.0.27
 Release: 1%{?_dist_release}
 License: LGPLv2+ and GPLv2+ or BSD
 Group: System Environment/Base
@@ -14,25 +15,34 @@ Source1: openipmi.sysconf
 Source2: openipmi.initscript
 Source3: openipmigui.desktop
 Source4: README.initscript
+#Patch3: 0003-Python3.patch
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
 BuildRequires: desktop-file-utils
 BuildRequires: gdbm-devel
 BuildRequires: glib2-devel
 BuildRequires: libedit-devel
+BuildRequires: libxcrypt-devel
 BuildRequires: ncurses-devel
 BuildRequires: net-snmp-devel
 BuildRequires: openssl-devel
 BuildRequires: perl
 BuildRequires: popt-devel
-BuildRequires: python-devel
 BuildRequires: swig
 BuildRequires: tcl
+
+%if %{with python3}
+BuildRequires: python3-devel
+BuildRequires: python3-rpm-macros
+BuildRequires: python3-tkinter
+%else
+BuildRequires: python-devel
+BuildRequires: python-rpm-macros
 BuildRequires: tkinter
+%endif
+
 Requires(post): chkconfig
 Requires(preun): chkconfig
 
-Patch2: 0002-nobundle.patch
-
 Vendor: Project Vine
 Distribution: Vine Linux
 
@@ -59,6 +69,19 @@ Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
 %description perl
 The OpenIPMI-perl package contains the Perl language bindings for OpenIPMI.
 
+%if %{with python3}
+%package -n python3-openipmi
+Group: Development/Libraries
+Summary: IPMI Python3 language bindings
+Summary(ja): IPMI Python3 言語バインディング
+Requires: python3
+Obsoletes: %{name}-python < %{version}-%{release}
+Provides: %{name}-python = %{version}-%{release}
+
+%description -n python3-openipmi
+The OpenIPMI-python3 package contains the Python3 language bindings for OpenIPMI.
+
+%else
 %package python
 Group: Development/Libraries
 Summary: IPMI Python language bindings
@@ -68,6 +91,8 @@ Requires: python
 %description python
 The OpenIPMI-python package contains the Python language bindings for OpenIPMI.
 
+%endif
+
 %package devel
 Summary: The development environment for the OpenIPMI project
 Summary(ja): OpenIPMI の開発キット
@@ -85,7 +110,11 @@ Summary(ja): IPMI GUI ツール
 Group: System Environment/Base
 Requires: tix
 Requires: tkinter
+%if %{with python3}
+Requires: python3-openipmi = %{version}-%{release}
+%else
 Requires: %{name}-python = %{version}-%{release}
+%endif
 
 %description gui
 The OpenIPMI-gui package contains the graphical user interface to monitor
@@ -94,7 +123,7 @@ and control IPMI-enabled devices.
 
 %prep
 %setup -q
-%patch2 -p1
+#%patch3 -p1
 rm -rf ./libedit
 
 %build
@@ -103,19 +132,34 @@ export EDIT_LIBS=`pkg-config --libs libedit`
 
 export CFLAGS="-fPIC $RPM_OPT_FLAGS"
 
+perl -pi -e 's|readline/readline\.h|editline/readline.h|' cmdlang/ipmish.c
+perl -pi -e 's|-lreadline|-ledit|' cmdlang/Makefile.am
+perl -pi -e 's|-lreadline|-ledit|' sample/Makefile.am
+%if %{with python3}
+perl -pi -e 's|python conftest|%{__python3} conftest|' configure.ac
+%endif
+
+
 autoreconf -vif
 
 %configure \
   CFLAGS="-fPIC %{optflags} -z now -fno-strict-aliasing" \
   LDFLAGS="%{?__global_ldflags} -Wl,--as-needed" \
-  --with-pythoninstall=%{python_sitearch} \
   --disable-dependency-tracking \
+%if %{with python3}
+  --with-python=%{__python3} \
+  --with-pythoninstall=%{python3_sitearch} \
+%else
+  --with-pythoninstall=%{python_sitearch} \
+%endif
+  --with-tkinter=yes \
   --with-tcl=no \
   --with-glib12=no \
   --disable-static
 # get rid of rpath
 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
 
 make   # not %{?_smp_mflags} safe
 
@@ -157,7 +201,8 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root)
-%doc CONFIGURING_FOR_LAN COPYING COPYING.BSD COPYING.LIB FAQ README README.Force README.MotorolaMXP README.initscript
+%license COPYING COPYING.BSD COPYING.LIB
+%doc CONFIGURING_FOR_LAN FAQ README README.Force README.MotorolaMXP README.initscript
 %config(noreplace) %{_sysconfdir}/ipmi/ipmisim1.emu
 %config(noreplace) %{_sysconfdir}/ipmi/lan.conf
 %config(noreplace) %{_sysconfdir}/sysconfig/ipmi
@@ -189,9 +234,15 @@ rm -rf $RPM_BUILD_ROOT
 %attr(644,root,root) %{perl_vendorarch}/OpenIPMI.pm
 %{perl_vendorarch}/auto/OpenIPMI/
 
+%if %{with python3}
+%files -n python3-openipmi
+%defattr(-,root,root)
+%{python3_sitearch}/*OpenIPMI*
+%else
 %files python
 %defattr(-,root,root)
 %{python_sitearch}/*OpenIPMI*
+%endif
 
 %files libs
 %defattr(-,root,root)
@@ -207,10 +258,20 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(-,root,root)
 %{_bindir}/openipmigui
 %{_mandir}/man1/openipmigui*
+%if %{with python3}
+%{python3_sitearch}/openipmigui
+%else
 %{python_sitearch}/openipmigui
+%endif
 %{_datadir}/applications/fedora-openipmigui.desktop
 
 %changelog
+* Mon May 13 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.27-1
+- updated to 2.0.27.
+- dropped Patch2 (fixed in upstream).
+- added BR:libxcrypt-devel.
+- switched to python3.
+
 * Wed Nov 07 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.0.25-1
 - updated to 2.0.25.
 - dropped Patch1 (fixed in upstream).