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

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