Conditional Perl & Python module build

By default disabled - seem to be unused. Debian has them disabled too.

Related: rhbz#2245793
This commit is contained in:
Pavel Cahyna 2024-02-12 11:23:56 +01:00
parent c88325940a
commit a2170f0b38

View File

@ -1,5 +1,8 @@
%global _hardened_build 1
%bcond_with python
%bcond_with perl
Summary: IPMI (Intelligent Platform Management Interface) library and tools
Name: OpenIPMI
@ -17,8 +20,17 @@ Patch4: OpenIPMI-c99.patch
Patch5: OpenIPMI-py313compat.patch
BuildRequires: make
BuildRequires: gdbm-devel swig glib2-devel net-snmp-devel ncurses-devel
BuildRequires: openssl-devel python3-devel perl-devel perl-generators
BuildRequires: gdbm-devel glib2-devel net-snmp-devel ncurses-devel
%if %{with python} || %{with perl}
BuildRequires: swig
%endif
BuildRequires: openssl-devel
%if %{with python}
BuildRequires: python3-devel
%endif
%if %{with perl}
BuildRequires: perl-devel perl-generators
%endif
BuildRequires: pkgconfig
BuildRequires: readline-devel
BuildRequires: automake
@ -44,13 +56,16 @@ Summary: The OpenIPMI runtime libraries
The OpenIPMI-libs package contains the runtime libraries for shared binaries
and applications.
%if %{with perl}
%package perl
Summary: IPMI Perl language bindings
Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description perl
The OpenIPMI-perl package contains the Perl language bindings for OpenIPMI.
%endif
%if %{with python}
%package -n python3-openipmi
%{?python_provide:%python_provide python3-openipmi}
%{?python_provide:%python_provide python3-OpenIPMI}
@ -63,6 +78,7 @@ Requires: %{name}-libs%{?_isa} = %{version}-%{release}
%description -n python3-openipmi
The OpenIPMI-python package contains the Python language bindings for OpenIPMI.
%endif
%package devel
Summary: The development environment for the OpenIPMI project
@ -94,8 +110,15 @@ This package contains a network IPMI listener.
LDFLAGS="%{__global_ldflags} -Wl,--as-needed" \
--disable-dependency-tracking \
--disable-static \
%if %{with python}
--with-pythoninstall=%{python3_sitearch} \
--with-python=%{__python3} \
%else
--with-python=no \
%endif
%if %{without perl}
--with-perl=no \
%endif
--with-tcl=no \
--with-tkinter=no
@ -172,13 +195,17 @@ echo ".so man1/openipmish.1" > %{buildroot}%{_mandir}/man1/ipmish.1
%{_mandir}/man7/ipmi_cmdlang*
%{_mandir}/man7/openipmi_conparms*
%if %{with perl}
%files perl
%attr(644,root,root) %{perl_vendorarch}/OpenIPMI.pm
%{perl_vendorarch}/auto/OpenIPMI
%endif
%if %{with python}
%files -n python3-openipmi
%{python3_sitearch}/*OpenIPMI*
%{python3_sitearch}/__pycache__/OpenIPMI.*.pyc
%endif
%files libs
%{_libdir}/libOpenIPMI*.so.*