Accepting request 535289 from science:HPC

- Fix master package macro to handle sub-packages with a
  different basename correctly. (forwarded request 535288 from eeich)

OBS-URL: https://build.opensuse.org/request/show/535289
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/suse-hpc?expand=0&rev=5
This commit is contained in:
Dominique Leuenberger 2017-10-20 12:47:16 +00:00 committed by Git OBS Bridge
commit 94db74ac5d
2 changed files with 39 additions and 24 deletions

View File

@ -337,7 +337,7 @@ cat << EOF > %{buildroot}%{hpc_module_dep_base}%{version}
# this package pulls in a new version of the dependent library, because # this package pulls in a new version of the dependent library, because
# these libraries also carry the version number of their names and # these libraries also carry the version number of their names and
# don't conflict with an earlier version. # don't conflict with an earlier version.
# %hpc_master_package [-n <full_package_name>][-g <group>][-s <.so-version>][-l][-L][-q] <package_ext> # %hpc_master_package [-n <full_package_name>][-g <group>][-s# <.so-version>][-l][-L][-N <pname>][-q] <package_ext>
# -n <full_package_name>: specify the full package name. This may not be used in conjunction with # -n <full_package_name>: specify the full package name. This may not be used in conjunction with
# the package name extension <package_ext>. # the package name extension <package_ext>.
# -g <group>: Specify the group to use. # -g <group>: Specify the group to use.
@ -349,26 +349,35 @@ cat << EOF > %{buildroot}%{hpc_module_dep_base}%{version}
# -L: Create a link from the .version.<version_no> file to the .version file # -L: Create a link from the .version.<version_no> file to the .version file
# to mark the default version. # to mark the default version.
# -a: Use native arch even if no library package. # -a: Use native arch even if no library package.
# -N <pname>: Specify if a sub-package has different basename (pname)
# -q: For internal use only! # -q: For internal use only!
# #
%hpc_master_package(n:g:s:lLaq) \ %hpc_master_package(n:g:s:lLaqN:) \
%define _mylib %{-s:lib}%{!-s:%{-l:lib}} \ %define _mylib %{-s:lib}%{!-s:%{-l:lib}} \
%define _p_ext %(test -n "%{*}" && echo -%{*}) \ %define _p_ext %(test -n "%{*}" && echo -%{*}) \
%{-n:%define _pname %{-n*}} \ %{!-N:\
%define _pname %{pname} \
%define _name %{name} \
} \
%{-N:\
%define _pname %{-N*} \
%define _name %(echo %{name} | sed -e "s/%{pname}/%{_pname}/") \
} \
%{-n:%define _lname %{-n*}} \
%{!-n:\ %{!-n:\
%define _pname_cf %{?compiler_family:-%{compiler_family}%{?hpc_cf_pack_version}} \ %define _lname_cf %{?compiler_family:-%{compiler_family}%{?hpc_cf_pack_version}} \
%define _pname_mpi %{!?_hpc_build_mpi:%{?hpc_mpi_family:-%{hpc_mpi_family}%{?hpc_mpi_pack_version}}} \ %define _lname_mpi %{!?_hpc_build_mpi:%{?hpc_mpi_family:-%{hpc_mpi_family}%{?hpc_mpi_pack_version}}} \
%define _pname_build_mpi_name %{?_hpc_build_mpi:%{hpc_mpi_family}%{?hpc_ext}%{?hpc_mpi_pack_version}} \ %define _lname_build_mpi_name %{?_hpc_build_mpi:%{hpc_mpi_family}%{?hpc_ext}%{?hpc_mpi_pack_version}} \
%define _pname_name %{!?_hpc_build_mpi:%{pname}%{?hpc_ext}%{-s*}} \ %define _lname_name %{!?_hpc_build_mpi:%{_pname}%{?hpc_ext}%{-s*}} \
%define _pname_header %{_mylib}%{_pname_build_mpi_name}%{_pname_name} \ %define _lname_header %{_mylib}%{_lname_build_mpi_name}%{_lname_name} \
%define _pname %{_pname_header}%{_pname_cf}%{_pname_mpi}-hpc%{_p_ext} \ %define _lname %{_lname_header}%{_lname_cf}%{_lname_mpi}-hpc%{_p_ext} \
}\ }\
%{-q:%(echo -n %{_pname}; true %{_mylib} %{_p_ext})} \ %{-q:%(echo -n %{_lname}; true %{_mylib} %{_p_ext})} \
%{!-q:\ %{!-q:\
%{-g:%define _group %{-g*}} \ %{-g:%define _group %{-g*}} \
%{!-g: \ %{!-g: \
%define _group %(pname=%_pname; \ %define _group %(lname=%_lname; \
case $pname in \ case $lname in \
(*-devel|*-devel-static) \ (*-devel|*-devel-static) \
echo -n "Development/Libraries/%{?hpc_mpi_family:Parallel}%{!?hpc_mpi_family:C and C++}" ;; \ echo -n "Development/Libraries/%{?hpc_mpi_family:Parallel}%{!?hpc_mpi_family:C and C++}" ;; \
(*) \ (*) \
@ -379,23 +388,23 @@ cat << EOF > %{buildroot}%{hpc_module_dep_base}%{version}
echo -n Productivity/Scientific/Other \ echo -n Productivity/Scientific/Other \
fi ;; esac)\ fi ;; esac)\
} \ } \
%{!-s:%define n_name %name} \ %{!-s:%define n_name %_name} \
%{-s:%define n_name %(a=%{name};echo -n ${a/%{pname}/%{pname}%{s*}})} \ %{-s:%define n_name %(a=%{_name};echo -n ${a/%{_pname}/%{_pname}%{-s*}})} \
%package -n %_pname \ %package -n %_lname \
Summary: Dependency package for %{n_name}%{_p_ext} \ Summary: Dependency package for %{n_name}%{_p_ext} \
Group: %_group \ Group: %_group \
Obsoletes: %_pname < %version \ Obsoletes: %_lname < %version \
%{!-s:Requires: %{_mylib}%{name}%{_p_ext} = %version} \ %{!-s:Requires: %{_mylib}%{_name}%{_p_ext} = %version} \
%{-s:Requires: %(echo -n %{_mylib}%{name}%{_p_ext} | sed -e "s/\\(.*%{pname}\\)\\(.*\\)/\\\\1%{-s*}\\\\2/") = %version} \ %{-s:Requires: %(echo -n %{_mylib}%{_name}%{_p_ext} | sed -e "s/\\(.*%{_pname}\\)\\(.*\\)/\\\\1%{-s*}\\\\2/") = %version} \
%{!-l:%{!-s:%{!-a:BuildArch: noarch}}} \ %{!-l:%{!-s:%{!-a:BuildArch: noarch}}} \
%description -n %_pname \ %description -n %_lname \
The package %{n_name}%{_p_ext} provides the dependency to get the latest version of %pname \ The package %{n_name}%{_p_ext} provides the dependency to get the latest version of %_pname \
%{-L:%post -n %_pname \ %{-L:%post -n %_lname \
ln -sf %{hpc_module_dep_base}.version.%{version} %{hpc_module_dep_base}.version} \ ln -sf %{hpc_module_dep_base}.version.%{version} %{hpc_module_dep_base}.version} \
%files -n %{_pname} \ %files -n %{_lname} \
%defattr(-,root,root)\ %defattr(-,root,root)\
%define _msg '%summary: Provide the dependency to get the latest version of %pname' \ %define _msg '%summary: Provide the dependency to get the latest version of %_pname' \
%define _readme README.%{_mylib}%{name}%{_p_ext} \ %define _readme README.%{_mylib}%{_name}%{_p_ext} \
%define _tmpexec %(tmp=$(mktemp /tmp/scr-XXXXXX); \ %define _tmpexec %(tmp=$(mktemp /tmp/scr-XXXXXX); \
readme=%{_readme} \ readme=%{_readme} \
echo "#!/bin/bash" > $tmp; \ echo "#!/bin/bash" > $tmp; \

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Thu Oct 19 11:44:50 UTC 2017 - eich@suse.com
- Fix master package macro to handle sub-packages with a
different basename correctly.
------------------------------------------------------------------- -------------------------------------------------------------------
Fri Oct 6 08:09:44 UTC 2017 - nmoreychaisemartin@suse.com Fri Oct 6 08:09:44 UTC 2017 - nmoreychaisemartin@suse.com