Name:           pmix
Version:        4.2.6
Release:        2
Summary:        Process Management Interface Exascale (PMIx)
License:        BSD
URL:            https://pmix.org
Source0:        https://github.com/openpmix/openpmix/releases/download/v%{version}/pmix-%{version}.tar.bz2
BuildRequires:  autoconf automake flex hwloc-devel libevent-devel libtool munge-devel perl-interpreter
Obsoletes:      pmix-pmi < 4.1.2  pmix-pmi-devel < 4.1.2

%description
PMI has been used for quite some time as a means of exchanging wireup information needed
for interprocess communication.

%package        devel
Summary:        Development files for pmix
Requires:       pmix = %{version}-%{release}
%description    devel
Libraries and header files for developing with pmix.

%package        tools
Summary:        Pmix tools
Requires:       pmix = %{version}-%{release}
%description    tools
Contains for use with PMIx-based RMs and language-based starters (e.g., mpirun).

%prep
%autosetup -n pmix-%{version} -p1
find src -name \*.l -print -exec touch --no-create {} \;

%build
%{_builddir}/pmix-%{version}/autogen.pl
%configure --prefix=%{_prefix} --sysconfdir=%{_sysconfdir}/pmix --disable-static \
  --disable-silent-rules --enable-shared --enable-pmi-backward-compatibility --with-munge

%make_build

%check
%make_build check

%install
%make_install
%delete_la

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post devel -p /sbin/ldconfig
%postun devel -p /sbin/ldconfig

%files
%doc LICENSE README.md
%dir %{_datadir}/pmix
%dir %{_libdir}/pmix
%dir %{_sysconfdir}/pmix
%config(noreplace) %{_sysconfdir}/pmix/*.conf
%{_datadir}/pmix/*.txt
%{_datadir}/doc/pmix/html/
%{_libdir}/{libmca_common_dstore.so.1*,libpmix.so.2*,pmix/*.so}
%{_mandir}/man1/*.1*
%{_mandir}/man3/*.3*
%{_mandir}/man5/*.5*

%files devel
%{_datadir}/pmix/*.supp
%{_includedir}/pmix*.h
%{_includedir}/pmix/src/*
%{_libdir}/{libmca_common_dstore.so,libpmix.so}
%{_libdir}/pkgconfig/*.pc

%files tools
%{_bindir}/*

%changelog
* Thu Sep 21 2023 liyanan <thistleslyn@163.com> - 4.2.6-2
- Add Obsoletes pmix-pmi pmix-pmi-devel 

* Mon Sep 18 2023 yaoxin <yao_xin001@hoperun.com> - 4.2.6-1
- Update to 4.2.6 for fix CVE-2023-41915

* Sat Sep 18 2021 caodongxia <caodongxia@huawei.com> - 3.1.4-3
- Correct the help information

* Wed Mar 4 2020 Ling Yang <lingyang2@huawei.com> - 3.1.4-2
- Package Init
