summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSoonKyu Park <sk7.park@samsung.com>2015-11-26 20:10:16 +0900
committerSoonKyu Park <sk7.park@samsung.com>2015-11-26 20:10:16 +0900
commitdc338f74bbe69185d09a419ecda8e5fa35bb4acb (patch)
treefddfc7d5e4b7bf5144678765c5a1f61a35bf535c
parenta49d2f1bcf1d8a683ecf35216d510768a91039fb (diff)
downloadrpm-dc338f74bbe69185d09a419ecda8e5fa35bb4acb.tar.gz
rpm-dc338f74bbe69185d09a419ecda8e5fa35bb4acb.tar.bz2
rpm-dc338f74bbe69185d09a419ecda8e5fa35bb4acb.zip
Modify eu-strip option to perform strip in post script of rpm package & add option add '_rpm_strip_disable' option and '_rpm_strip_option' to project config.submit/tizen/20151127.031713accepted/tizen/wearable/20151127.070351accepted/tizen/tv/20151127.070348accepted/tizen/mobile/20151127.070342
Change-Id: I939ca673d8dd06ebd0cb414d5471bdf962d8f5e1
-rw-r--r--macros.in6
-rw-r--r--packaging/rpm-tizen_macros25
-rw-r--r--packaging/rpm.spec4
-rw-r--r--scripts/find-debuginfo.sh39
4 files changed, 60 insertions, 14 deletions
diff --git a/macros.in b/macros.in
index e285ce16a..a7cab871d 100644
--- a/macros.in
+++ b/macros.in
@@ -179,8 +179,12 @@
# A spec file can %%define _find_debuginfo_opts to pass options to
# the script. See the script for details.
#
+
+%_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.
diff --git a/packaging/rpm-tizen_macros b/packaging/rpm-tizen_macros
index c52767397..18613ad3e 100644
--- a/packaging/rpm-tizen_macros
+++ b/packaging/rpm-tizen_macros
@@ -22,10 +22,27 @@
%kernel_name %(/bin/rpm -q --queryformat '%{RPMTAG_NAME}' $(/bin/rpm -q --whatprovides kernel))
# this script calls all scripts in /usr/lib/rpm/brp-tizen.d
-%__os_install_post \
- /usr/lib/rpm/brp-compress \
- /usr/lib/rpm/brp-tizen \
- %{!?disable_docs_package:/usr/lib/rpm/tizen/find-docs.sh %{buildroot}} \
+%__arch_install_post /usr/lib/rpm/check-buildroot
+
+%__strip_install_post \
+ %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} \
+ /usr/lib/rpm/brp-strip-static-archive %{__strip} \
+ /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \
+%{nil}
+
+%__os_install_post \
+ /usr/lib/rpm//brp-compress \
+ %{!?_rpm_strip_disable:%{__strip_install_post}}\
+ /usr/lib/rpm/brp-python-hardlink \
+ %{!?disable_docs_package:/usr/lib/rpm/tizen/find-docs.sh %{buildroot}} \
+%{nil}
+
+# /usr/lib/rpm/tizen/brp-implant-ident-static
+
+%__spec_install_post\
+ %{?__debug_package:%{__debug_install_post}}\
+ %{__arch_install_post}\
+ %{__os_install_post}\
%{nil}
# macro: %configure_kernel_source
diff --git a/packaging/rpm.spec b/packaging/rpm.spec
index 9555fca7d..80c82c993 100644
--- a/packaging/rpm.spec
+++ b/packaging/rpm.spec
@@ -195,8 +195,8 @@ mkdir -p %{buildroot}%{rpmhome}/macros.d
# remove some nonsense or non-working scripts
for f in rpm2cpio.sh rpm.daily rpmdiff* rpm.log rpm.xinetd freshen.sh u_pkg.sh \
magic magic.mgc magic.mime* rpmfile *.pl javadeps brp-redhat \
- brp-strip-static-archive vpkg-provides*.sh http.req sql.req tcl.req \
- rpmdb_* brp-sparc64-linux brp-strip-comment-note brp-java-gcjcompile
+ vpkg-provides*.sh http.req sql.req tcl.req \
+ rpmdb_* brp-sparc64-linux brp-java-gcjcompile
do
rm -f %{buildroot}%{rpmhome}/$f
done
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh
index efcc72ed2..fd69616b0 100644
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -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] [-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]
@@ -32,6 +32,12 @@ strip_r=false
# Barf on missing build IDs.
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
@@ -40,6 +46,12 @@ while [ $# -gt 0 ]; do
--strict-build-id)
strict=true
;;
+ --strip-disable)
+ strip_disable=true
+ ;;
+ *--strip-option*)
+ strip_option=$(echo $1 | sed 's/--strip-option=//')
+ ;;
-g)
strip_g=true
;;
@@ -95,17 +107,27 @@ debugdir="${RPM_BUILD_ROOT}/usr/lib/debug"
strip_to_debug()
{
+ local g=
local r=
+
+ if test "$strip_disable" = true ; then
+ exit
+ fi
+
$strip_r && r=--reloc-debug-sections
+ $strip_g && case "$(file -bi "$2")" in
+ application/x-sharedlib*) g=-g ;;
+ esac
+
case $2 in
*.ko)
- # 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
- ;;
+ # 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 $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
}
@@ -313,6 +335,9 @@ while read nlinks inum f; do
if test "$NO_DEBUGINFO_STRIP_DEBUG" = true ; then
strip_option=
fi
+ if test "$strip_disable" = true ; then
+ strip_option=
+ fi
objcopy --add-gnu-debuglink=$debugfn -R .comment -R .GCC.command.line $strip_option $f
chmod $mode $f
) || :