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