From edee775227d9bab5c3bbf3d9fd8f74c26a372d345861c64efdb07fcb19a3572e Mon Sep 17 00:00:00 2001 From: Egbert Eich Date: Mon, 27 Apr 2020 13:41:38 +0000 Subject: [PATCH] Accepting request 798280 from home:eeich:branches:science:HPC - Add 'Obsolete:' option to master package. This way, a removed master package may be declared obsolte. - Allow 'Empty' package - without a 'Requires:' to keep master package for backward compatibility. OBS-URL: https://build.opensuse.org/request/show/798280 OBS-URL: https://build.opensuse.org/package/show/science:HPC/suse-hpc?expand=0&rev=46 --- _service | 2 +- macros.hpc | 19 +++++++++++++++++-- suse-hpc.changes | 8 ++++++++ suse-hpc.spec | 6 +++--- 4 files changed, 29 insertions(+), 6 deletions(-) diff --git a/_service b/_service index 84c2fd6..9d340dd 100644 --- a/_service +++ b/_service @@ -6,7 +6,7 @@ .git suse-hpc 0.4.%h - ec20e912f5395e091bede4849ecc5476581c1871 + d55686f0e90750122e3a56f4a38e3cb05a02381c general/dlinfo.c general/macros.hpc general/hpc_elf.pl diff --git a/macros.hpc b/macros.hpc index 5eb4ad3..b3465c8 100644 --- a/macros.hpc +++ b/macros.hpc @@ -32,9 +32,12 @@ %hpc_libexecdir %{hpc_prefix}/lib %hpc_localstatedir %{_localstatedir} %hpc_sharedstatedir %{_sharedstatedir} +# MANPATH %hpc_mandir %{hpc_datadir}/man %hpc_docdir %{hpc_datadir}/doc/packages +# INFOPATH %hpc_infodir %{hpc_datadir}/info +# PKG_CONFIG_PATH %hpc_pkgconfigdir %{hpc_libdir}/pkgconfig %hpc_cmake_dir %{hpc_datadir}/cmake %hpc_cmake_moddir %{hpc_cmake_dir}/Modules @@ -369,8 +372,13 @@ cat << EOF > %{buildroot}%{hpc_module_dep_base}%{version} # -N : Specify if a sub-package has different basename (pname) # -q: For internal use only! # -M: use specified name in place of %%name +# -O: Obsoleted package with version %version, multiple obsoletes may be +# separated by ":" +# -E: create an 'empty' master package with no requires. This allows to +# keep the macro package around for compatibility even if the underlying +# package has been removed. # -%hpc_master_package(n:g:s:lLaqN:M:) \ +%hpc_master_package(n:g:s:lLaqN:M:O:E) \ %define _mylib %{-s:lib}%{!-s:%{-l:lib}} \ %define _p_ext %(test -n "%{*}" && echo -%{*}) \ %{-M: \ %define name %{-M*}} \ @@ -415,7 +423,14 @@ cat << EOF > %{buildroot}%{hpc_module_dep_base}%{version} Summary: Dependency package for %{s_name} \ Group: %_group \ Obsoletes: %_lname < %version \ -Requires: %{s_name} = %version \ +%{-O:%(\ + v=%{-O*}; \ + for i in ${v//:/ }; \ + do echo "Obsoletes: $i < %version"; \ + echo "Provides: %i = %version"; \ + done)\ +} \ +%{!-E:Requires: %{s_name} = %version} \ %{!-l:%{!-s:%{!-a:BuildArch: noarch}}} \ %description -n %_lname \ %{pname}: %{SUMMARY} \ diff --git a/suse-hpc.changes b/suse-hpc.changes index 0d992b8..ce1dec7 100644 --- a/suse-hpc.changes +++ b/suse-hpc.changes @@ -1,3 +1,11 @@ +------------------------------------------------------------------- +Mon Apr 27 06:58:20 UTC 2020 - Egbert Eich + +- Add 'Obsolete:' option to master package. This way, a removed + master package may be declared obsolte. +- Allow 'Empty' package - without a 'Requires:' to keep master + package for backward compatibility. + ------------------------------------------------------------------- Wed Feb 6 07:08:30 UTC 2019 - eich@suse.com diff --git a/suse-hpc.spec b/suse-hpc.spec index 1456b4b..d41cae4 100644 --- a/suse-hpc.spec +++ b/suse-hpc.spec @@ -1,7 +1,7 @@ # # spec file for package suse-hpc # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -20,7 +20,7 @@ Summary: SUSE HPC Environment License: BSD-3-Clause Group: Productivity/Clustering/Computing Name: suse-hpc -Version: 0.4 +Version: 0.5 Release: 0 Source0: macros.hpc Source1: dlinfo.c @@ -28,7 +28,7 @@ Source2: hpc_elf.pl Source3: hpc_elf.attr Source4: hpc_elflib.attr Source5: LICENSE -Url: http://www.suse.com/hpc +URL: http://www.suse.com/hpc %description Provide rpm macros for building and installing SUSE HPC