Add --strip-option option
authorSoonKyu Park <sk7.park@samsung.com>
Wed, 25 Nov 2015 05:30:04 +0000 (14:30 +0900)
committerSoonKyu Park <sk7.park@samsung.com>
Wed, 25 Nov 2015 05:30:04 +0000 (14:30 +0900)
Change-Id: Ia37c3cd230f5bd459bb6778efe0ddac1bd6edbb1

macros.in
scripts/find-debuginfo.sh

index fdb6d99..a7cab87 100644 (file)
--- a/macros.in
+++ b/macros.in
 #
 
 %_find_debuginfo_opts %{?_rpm_strip_disable:--strip-disable}
+%_find_debuginfo_strip_opts %{?_rpm_strip_option:\'--strip-option=%{_rpm_strip_option}\'}
 
 %__debug_install_post   \
-   %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} "%{_builddir}/%{?buildsubdir}"\
+   %{_rpmconfigdir}/find-debuginfo.sh %{?_missing_build_ids_terminate_build:--strict-build-id} %{?_find_debuginfo_opts} %{?_find_debuginfo_strip_opts} "%{_builddir}/%{?buildsubdir}"\
 %{nil}
 
 #      Template for debug information sub-package.
index 480e63f..fd69616 100644 (file)
@@ -2,7 +2,7 @@
 #find-debuginfo.sh - automagically generate debug info and file list
 #for inclusion in an rpm spec file.
 #
-# Usage: find-debuginfo.sh [--strict-build-id] [--strip-disable] [-g] [-r]
+# Usage: find-debuginfo.sh [--strict-build-id] [--strip-disable] [--strip-option] [-g] [-r]
 #                         [-o debugfiles.list]
 #                         [[-l filelist]... [-p 'pattern'] -o debuginfo.list]
 #                         [builddir]
@@ -35,6 +35,9 @@ strict=false
 # With --strip-disable arg, no strip
 strip_disable=false
 
+# With --strip-option arg, this will be used as arg. of eu-strip
+strip_option=
+
 BUILDDIR=.
 out=debugfiles.list
 nout=0
@@ -46,6 +49,9 @@ while [ $# -gt 0 ]; do
   --strip-disable)
     strip_disable=true
     ;;
+  *--strip-option*)
+    strip_option=$(echo $1 | sed 's/--strip-option=//')
+    ;;
   -g)
     strip_g=true
     ;;
@@ -118,10 +124,10 @@ strip_to_debug()
           # don't attempt to create a minimal backtrace binary for
           # kernel modules as this just causes the stripping process
           # to be skipped entirely
-          eu-strip --remove-comment $r -f "$1" "$2" || exit
+          eu-strip --remove-comment $r $strip_option -f "$1" "$2" || exit
           ;;
       *)
-          eu-strip --remove-comment $g -f "$1" "$2" || exit
+          eu-strip --remove-comment $g $strip_option -f "$1" "$2" || exit
   esac
   chmod 444 "$1" || exit
 }