Blame SOURCES/0006-Modified-the-behavior-of-debuginfo-generation-proces.patch

1e4a06
From a2aefc2276e124b1c329a722ed43cf7fcf7f473f Mon Sep 17 00:00:00 2001
1e4a06
From: Jan Zeleny <jzeleny@redhat.com>
1e4a06
Date: Wed, 30 Jul 2014 10:00:26 +0200
1e4a06
Subject: [PATCH] Modified the behavior of debuginfo generation process
1e4a06
1e4a06
* add correct dependencies to debuginfo packages.
1e4a06
* add conditional definition of __debug_package macro
1e4a06
  (allow turning debuginfor packages off)
1e4a06
* remove automatic creation of debuginfo for metapackage
1e4a06
---
1e4a06
 macros.scl | 51 ++++++++++++++++++++++++++++++++++-----------------
1e4a06
 1 file changed, 34 insertions(+), 17 deletions(-)
1e4a06
1e4a06
diff --git a/macros.scl b/macros.scl
1e4a06
index d344b5e80f4fa6d97c7243df2f40847303eb26df..db85a5002f831e5e319152db8eba6e9e92efec82 100644
1e4a06
--- a/macros.scl
1e4a06
+++ b/macros.scl
1e4a06
@@ -3,6 +3,39 @@
1e4a06
 # Copyright (C) 2012 Red Hat, Inc.
1e4a06
 #   Written by Jindrich Novy <jnovy@redhat.com>.
1e4a06
 
1e4a06
+%scl_debug() %{expand:
1e4a06
+%define old_debug %{lua:print(rpm.expand("%{debug_package}"):len())}
1e4a06
+%global debug_package %{expand:
1e4a06
+%if "%{?old_debug}" == "0"
1e4a06
+       %{expand: %{nil}}
1e4a06
+%else
1e4a06
+%if "%{?scl}%{!?scl:0}" == "%{pkg_name}"
1e4a06
+        %{expand: %{nil}}
1e4a06
+%else
1e4a06
+%ifnarch noarch
1e4a06
+%package debuginfo
1e4a06
+Summary: Debug information for package %{name}
1e4a06
+Group: Development/Debug
1e4a06
+AutoReqProv: 0
1e4a06
+Requires: %scl_runtime
1e4a06
+Provides: scl-package(%scl)
1e4a06
+%{lua:
1e4a06
+        debuginfo=tonumber(rpm.expand("%{old_debug}"))
1e4a06
+        if debuginfo > 0 then
1e4a06
+                rpm.define("__debug_package 1")
1e4a06
+        end
1e4a06
+}
1e4a06
+%description debuginfo
1e4a06
+This package provides debug information for package %{name}.
1e4a06
+Debug information is useful when developing applications that use this
1e4a06
+package or when debugging this package.
1e4a06
+%files debuginfo -f debugfiles.list
1e4a06
+%defattr(-,root,root)
1e4a06
+%endif
1e4a06
+%endif
1e4a06
+%endif
1e4a06
+%{nil}}}
1e4a06
+
1e4a06
 %scl_package() %{expand:%{!?_root_prefix:
1e4a06
 %global pkg_name		%1
1e4a06
 %global scl_name		%{scl}
1e4a06
@@ -42,6 +75,7 @@
1e4a06
 %global _defaultdocdir		%{_docdir}
1e4a06
 }
1e4a06
 %global scl_pkg_name		%{scl}-%{pkg_name}
1e4a06
+%scl_debug
1e4a06
 %global __os_install_post %{expand:
1e4a06
     /usr/lib/rpm/brp-scl-compress %{_scl_root}
1e4a06
     %{!?__debug_package:/usr/lib/rpm/redhat/brp-strip %{__strip}
1e4a06
@@ -52,23 +86,6 @@
1e4a06
     /usr/lib/rpm/redhat/brp-python-hardlink
1e4a06
     %{!?__jar_repack:/usr/lib/rpm/redhat/brp-java-repack-jars}
1e4a06
 %{nil}}
1e4a06
-%global debug_package %{expand:
1e4a06
-%ifnarch noarch
1e4a06
-%global __debug_package 1
1e4a06
-%package debuginfo
1e4a06
-Summary: Debug information for package %{name}
1e4a06
-Group: Development/Debug
1e4a06
-AutoReqProv: 0
1e4a06
-Requires: %scl_runtime
1e4a06
-Provides: scl-package(%scl)
1e4a06
-%description debuginfo
1e4a06
-This package provides debug information for package %{name}.
1e4a06
-Debug information is useful when developing applications that use this
1e4a06
-package or when debugging this package.
1e4a06
-%files debuginfo -f debugfiles.list
1e4a06
-%defattr(-,root,root)
1e4a06
-%endif
1e4a06
-%{nil}}
1e4a06
 BuildRequires: scl-utils-build
1e4a06
 %if "%{?scl}%{!?scl:0}" == "%{pkg_name}"
1e4a06
 Requires: %{scl_runtime}
1e4a06
-- 
1e4a06
1.9.3
1e4a06