Blame SOURCES/0005-Various-fixes-in-Provides-and-Requires-of-scl-packag.patch

39593f
From b603a0b745fe01b410bb826422ad48b1df9d1da9 Mon Sep 17 00:00:00 2001
39593f
From: Jan Zeleny <jzeleny@redhat.com>
39593f
Date: Mon, 27 Jan 2014 10:23:36 +0100
39593f
Subject: [PATCH] Various fixes in Provides and Requires of scl packages
39593f
39593f
- add new Requires: %scl_runtime, to all scl packages
39593f
  (every scl package requires the runtime to be installed anyway)
39593f
- add new Provides: scl-package(%scl) for metapackage and build subpackage
39593f
- exclude both from the main metapackage
39593f
- move the _root_path conditional in macros.scl: when BuildArch is
39593f
  specified in spec file, rpm recursively parses spec file again. That's
39593f
  the reason why the conditional is there. However, when the wrong
39593f
  pieces of code are included in in, it brings some problems. This
39593f
  change keep only the path definition inside the conditional, the rest
39593f
  can be easily redefined again.
39593f
---
39593f
 macros.scl | 8 ++++++--
39593f
 scl.attr   | 3 ++-
39593f
 scldeps.sh | 3 +++
39593f
 3 files changed, 11 insertions(+), 3 deletions(-)
39593f
39593f
diff --git a/macros.scl b/macros.scl
39593f
index 8b6377ee00fd26c89db1748c96e703e30214e9d9..d344b5e80f4fa6d97c7243df2f40847303eb26df 100644
39593f
--- a/macros.scl
39593f
+++ b/macros.scl
39593f
@@ -40,6 +40,7 @@
39593f
 %global _mandir			%{_datadir}/man
39593f
 %global _docdir			%{_datadir}/doc
39593f
 %global _defaultdocdir		%{_docdir}
39593f
+}
39593f
 %global scl_pkg_name		%{scl}-%{pkg_name}
39593f
 %global __os_install_post %{expand:
39593f
     /usr/lib/rpm/brp-scl-compress %{_scl_root}
39593f
@@ -58,6 +59,7 @@
39593f
 Summary: Debug information for package %{name}
39593f
 Group: Development/Debug
39593f
 AutoReqProv: 0
39593f
+Requires: %scl_runtime
39593f
 Provides: scl-package(%scl)
39593f
 %description debuginfo
39593f
 This package provides debug information for package %{name}.
39593f
@@ -68,10 +70,12 @@ package or when debugging this package.
39593f
 %endif
39593f
 %{nil}}
39593f
 BuildRequires: scl-utils-build
39593f
-}
39593f
+%if "%{?scl}%{!?scl:0}" == "%{pkg_name}"
39593f
+Requires: %{scl_runtime}
39593f
+Provides: scl-package(%{scl})
39593f
+%endif
39593f
 %{?scl_package_override:%scl_package_override}
39593f
 }
39593f
 
39593f
 %scl_require()	%{_scl_prefix}/%1/enable, %1
39593f
 %scl_require_package() %1-%2
39593f
-
39593f
diff --git a/scl.attr b/scl.attr
39593f
index 3e546568261b996e065be3bfaed648d785466c36..068fc4a995443340428fd75b017affed069188d3 100644
39593f
--- a/scl.attr
39593f
+++ b/scl.attr
39593f
@@ -1,2 +1,3 @@
39593f
 %__scl_provides	%{_rpmconfigdir}/scldeps.sh --provides %{scl}
39593f
-%__scl_path	%{?scl:^%{_scl_prefix}/.*$}
39593f
+%__scl_requires %{_rpmconfigdir}/scldeps.sh --requires %{scl_runtime}
39593f
+%__scl_path	%{?scl:^%{_scl_prefix}/.*$ || %{_root_sysconfdir}/rpm/macros.%{scl}-config$}
39593f
diff --git a/scldeps.sh b/scldeps.sh
39593f
index 268d6bb5109f34d0e8da8c7d01816dcecffb6888..df8ddb3bb35b291de839bff0754c479958704030 100755
39593f
--- a/scldeps.sh
39593f
+++ b/scldeps.sh
39593f
@@ -9,5 +9,8 @@ case $1 in
39593f
 -P|--provides)
39593f
     echo -n "scl-package($2)"
39593f
     ;;
39593f
+-R|--requires)
39593f
+    echo -n "$2"
39593f
+    ;;
39593f
 esac
39593f
 exit 0
39593f
-- 
39593f
1.9.3
39593f