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

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