OBS User unknown 2008-04-09 16:18:03 +00:00 committed by Git OBS Bridge
parent 8fbfaaf411
commit 007fcda01c
6 changed files with 143 additions and 23 deletions

107
debugsource-package.diff Normal file
View File

@ -0,0 +1,107 @@
Subject: Split sources for debugging into separate -debugsource package
At the moment the -debuginfo package also include the sources where used to
build the binary. The patches moves them into a separate package -debugsource.
---
macros.in | 12 ++++++++++++
scripts/find-debuginfo.sh | 39 ++++++++++++++++++++++++---------------
2 files changed, 36 insertions(+), 15 deletions(-)
Index: b/macros.in
===================================================================
--- a/macros.in
+++ b/macros.in
@@ -179,6 +179,18 @@ Debug information is useful when develop
package or when debugging this package.\
%files debuginfo -f debugfiles.list\
%defattr(-,root,root)\
+\
+%package debugsource\
+Summary: Debug sources for package %{name}\
+Group: Development/Debug\
+AutoReqProv: 0\
+Requires: %{name}-debuginfo = %{version}-%{release}\
+%description debugsource\
+This package provides debug sources for package %{name}.\
+Debug sources are useful when developing applications that use this\
+package or when debugging this package.\
+%files debugsource -f debugsources.list\
+%defattr(-,root,root)\
%{nil}
%_defaultdocdir %{_usr}/doc/packages
Index: b/scripts/find-debuginfo.sh
===================================================================
--- a/scripts/find-debuginfo.sh
+++ b/scripts/find-debuginfo.sh
@@ -7,11 +7,13 @@ else BUILDDIR=$1
fi
LISTFILE=$BUILDDIR/debugfiles.list
-SOURCEFILE=$BUILDDIR/debugsources.list
+LISTSOURCE=$BUILDDIR/debugsources.list
debugdir="${RPM_BUILD_ROOT}/usr/lib/debug"
+debugsrcdir="${RPM_BUILD_ROOT}/usr/src/debug"
-echo -n > $SOURCEFILE
+[ -d "$TMPDIR" ] || TMPDIR="/tmp"
+SOURCES_TMP=`mktemp $TMPDIR/rpmXXXXXX`
# Strip ELF binaries
for f in `find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) `
@@ -36,7 +38,8 @@ do
echo extracting debug info from $f
mode=$(stat -c %a $f)
chmod +w $f
- /usr/lib/rpm/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug -l "$SOURCEFILE" "$f"
+ /usr/lib/rpm/debugedit -b "$RPM_BUILD_DIR" -d $(echo ${debugsrcdir} | \
+ sed -n -e "s#^$RPM_BUILD_ROOT##p") -l "$SOURCES_TMP" "$f"
# A binary already copied into /usr/lib/debug doesn't get stripped,
# just has its file names collected and adjusted.
@@ -75,12 +78,25 @@ done
# mv "$f" "${debugdn}"
#done
+# fixup paths, just in case ?!
+find ${debugdir} -type d -print0 | xargs -0 -r chmod 0755
+find ${debugdir} -type f -print0 | xargs -0 -r chmod 0644
+
+find ${debugdir} -mindepth 1 -maxdepth 1 | \
+ sed -n -e "s#^$RPM_BUILD_ROOT##p" > $LISTFILE
-mkdir -p ${RPM_BUILD_ROOT}/usr/src/debug
-(cd $RPM_BUILD_DIR; LANG=C sort -z -u | cpio -pd0m ${RPM_BUILD_ROOT}/usr/src/debug) < $SOURCEFILE
+
+if [ -s "$SOURCES_TMP" ] ; then
+ # strip GCC built-in code from sources list
+ (cd $RPM_BUILD_DIR && LANG=C sort -z -u | grep -z -v "<built-in>" | \
+ cpio -pd0m ${debugsrcdir} ) < $SOURCES_TMP
+ # stupid cpio creates new directories in mode 0700, fixup
+ find ${debugsrcdir} -type d -print0 | xargs -0 -r chmod 0755
+ find ${debugsrcdir} -type f -print0 | xargs -0 -r chmod 0644
+fi
# trying to replace dangling and/or absolute symlink
-DBASE=${RPM_BUILD_ROOT}/usr/src/debug
+DBASE=${debugsrcdir}
for link in `find $DBASE -type l -printf "%P\n"` ; do
link_file=`readlink $RPM_BUILD_DIR/$link`
case $link_file in
@@ -93,12 +109,5 @@ for link in `find $DBASE -type l -printf
fi
done
-{
- test -d ${RPM_BUILD_ROOT}/usr/lib/debug && echo /usr/lib/debug
- echo /usr/src/debug
-} > $LISTFILE
-
-for p in $(<$LISTFILE); do
- find $RPM_BUILD_ROOT/$p -type f -print0 | xargs -0 -r chmod 0644
- find $RPM_BUILD_ROOT/$p -type d -print0 | xargs -0 -r chmod 0755
-done
+find ${debugsrcdir} -mindepth 1 -maxdepth 1 | \
+ sed -n -e "s#^$RPM_BUILD_ROOT##p" > $LISTSOURCE

View File

@ -1,6 +1,12 @@
--- scripts/find-debuginfo.sh
---
scripts/find-debuginfo.sh | 78 ++++++++++++++++++++++++++++++++++++++--------
1 file changed, 65 insertions(+), 13 deletions(-)
Index: scripts/find-debuginfo.sh
===================================================================
--- scripts/find-debuginfo.sh.orig
+++ scripts/find-debuginfo.sh
@@ -14,9 +14,18 @@
@@ -14,9 +14,18 @@ debugdir="${RPM_BUILD_ROOT}/usr/lib/debu
echo -n > $SOURCEFILE
# Strip ELF binaries
@ -21,7 +27,7 @@
dn=$(dirname $f | sed -n -e "s#^$RPM_BUILD_ROOT##p")
bn=$(basename $f .debug).debug
@@ -25,6 +34,8 @@
@@ -25,6 +34,8 @@ do
[ -f "${debugfn}" ] && continue
echo extracting debug info from $f
@ -30,7 +36,7 @@
/usr/lib/rpm/debugedit -b "$RPM_BUILD_DIR" -d /usr/src/debug -l "$SOURCEFILE" "$f"
# A binary already copied into /usr/lib/debug doesn't get stripped,
@@ -34,19 +45,60 @@
@@ -34,19 +45,60 @@ do
esac
mkdir -p "${debugdn}"
@ -43,7 +49,7 @@
+ objcopy --only-keep-debug $f $debugfn || :
+ strip_option="--strip-all"
+ case "$f" in
+ *.ko|*.a)
+ *.ko)
+ strip_option="--strip-debug"
+ ;;
+ *$STRIP_KEEP_SYMTAB*)
@ -76,7 +82,9 @@
-# stupid cpio creates new directories in mode 0700, fixup
-find ${RPM_BUILD_ROOT}/usr/src/debug -type d -print0 | xargs -0 chmod a+rx
+(cd $RPM_BUILD_DIR; LANG=C sort -z -u | cpio -pd0m ${RPM_BUILD_ROOT}/usr/src/debug) < $SOURCEFILE
+
-find ${RPM_BUILD_ROOT}/usr/lib/debug -type f | sed -n -e "s#^$RPM_BUILD_ROOT##p" > $LISTFILE
-find ${RPM_BUILD_ROOT}/usr/src/debug -mindepth 1 -maxdepth 1 | sed -n -e "s#^$RPM_BUILD_ROOT##p" >> $LISTFILE
+# trying to replace dangling and/or absolute symlink
+DBASE=${RPM_BUILD_ROOT}/usr/src/debug
+for link in `find $DBASE -type l -printf "%P\n"` ; do
@ -90,9 +98,7 @@
+ cp "`readlink -f $RPM_BUILD_DIR/$link`" "$DBASE/$link"
+ fi
+done
-find ${RPM_BUILD_ROOT}/usr/lib/debug -type f | sed -n -e "s#^$RPM_BUILD_ROOT##p" > $LISTFILE
-find ${RPM_BUILD_ROOT}/usr/src/debug -mindepth 1 -maxdepth 1 | sed -n -e "s#^$RPM_BUILD_ROOT##p" >> $LISTFILE
+
+{
+ test -d ${RPM_BUILD_ROOT}/usr/lib/debug && echo /usr/lib/debug
+ echo /usr/src/debug

View File

@ -17,7 +17,7 @@ License: GPL v2 or later
Group: System/Packages
Summary: Python Bindings for Manipulating RPM Packages
Version: 4.4.2
Release: 222
Release: 226
Requires: rpm = %{version}
%py_requires
Source99: rpm.spec

View File

@ -15,8 +15,6 @@
# package build macros
%makeinstall make DESTDIR=%{?buildroot:%{buildroot}} install
%tcl_version %(echo 'puts [package require Tcl]' | tclsh)
%tclscriptdir %_datadir/tcl
%rb_arch %(echo %{_host_cpu}-linux | sed -e "s/i686/i586/" -e "s/armv5tel/armv4l/" -e "s/hppa2.0/hppa/")
%rb_ver %(/usr/bin/ruby -e 'puts VERSION.sub(/\\\.\\\d$/, "")')
%insserv_prereq insserv sed

View File

@ -1,3 +1,8 @@
-------------------------------------------------------------------
Wed Apr 9 12:56:57 CEST 2008 - jblunck@suse.de
- Put debug sources into separate -debugsource package.
-------------------------------------------------------------------
Fri Mar 28 14:54:04 CET 2008 - coolo@suse.de

View File

@ -21,7 +21,7 @@ PreReq: %insserv_prereq %fillup_prereq permissions
AutoReqProv: on
Summary: The RPM Package Manager
Version: 4.4.2
Release: 181
Release: 184
Source: rpm-%{version}.tar.bz2
Source1: RPM-HOWTO.tar.bz2
Source2: RPM-Tips.html.tar.bz2
@ -132,6 +132,7 @@ Patch102: rpm-shorten-changelog.diff
Patch103: noautoreloc.diff
Patch104: lzma-payload.diff
Patch105: lzma-payload-2.diff
Patch106: debugsource-package.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build
#
# avoid bootstrapping problem
@ -206,6 +207,7 @@ rm -f rpmdb/db.h
%patch -P 90 -P 91 -P 92 -P 93 -P 94 -P 95 -P 96 -P 97 -P 98 -P 99
%patch -P 100 -P 101 -P 102 -P 103
%patch -P 104 -P 105 -b .lzma
%patch106 -p1
chmod 755 scripts/find-supplements{,.ksyms}
chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms
tar -xjvf %{SOURCE1}
@ -350,7 +352,7 @@ Summary: A C library for parsing command line parameters
License: LGPL v2.1 or later
Group: System/Libraries
Version: 1.7
Release: 409
Release: 412
#
%description -n popt
@ -373,7 +375,7 @@ Summary: C Library for Parsing Command Line Parameters
License: LGPL v2.1 or later
Group: System/Libraries
Version: 1.7
Release: 409
Release: 412
Requires: popt = 1.7
Requires: glibc-devel
@ -408,6 +410,8 @@ Authors:
%doc %{_mandir}/man3/popt.3*
%changelog
* Wed Apr 09 2008 jblunck@suse.de
- Put debug sources into separate -debugsource package.
* Fri Mar 28 2008 coolo@suse.de
- leave the rpm package itself with bzip payload to
avoid blocking updates from within running system
@ -549,7 +553,7 @@ Authors:
%%kernel_module_package_buildreq, %%kernel_module_package, and
inside %%kernel_module_package, the macros %%flavors_to_build and
%%kernel_source.
* Wed Oct 18 2006 mls@suse.de
* Thu Oct 19 2006 mls@suse.de
- split up jumbo patch in 78 small patches
- fix lua directory handling [#201518]
- add /etc/rpm directory to filelist [#208762]
@ -671,7 +675,7 @@ Authors:
* Tue Jan 31 2006 agruen@suse.de
- rpm-suse-kernel-module-subpackage: Add version to additional
Provides tag. We may need this for future Obsoletes.
* Fri Jan 27 2006 mls@suse.de
* Sat Jan 28 2006 mls@suse.de
- added support for EssentialFor and Supports
- enabled support for lua scripts
* Fri Jan 27 2006 agruen@suse.de
@ -697,7 +701,7 @@ Authors:
- don't ignore getcwd return value in build.c
* Mon Dec 19 2005 mls@suse.de
- fix find-lang.sh script
* Sun Dec 18 2005 mls@suse.de
* Mon Dec 19 2005 mls@suse.de
- fix find-debuginfo script
* Sun Dec 18 2005 mls@suse.de
- don't assume root:root defattr
@ -748,7 +752,7 @@ Authors:
- Fix ppc assembly syntax.
* Wed Jun 08 2005 matz@suse.de
- add STRIP_KEEP_SYMTAB to find-debuginfo.sh
* Sat May 21 2005 schwab@suse.de
* Sun May 22 2005 schwab@suse.de
- find-debuginfo.sh: make writable before extracting debug info, simplify.
* Thu May 19 2005 schwab@suse.de
- Replace absolute symlinks when copying sources for debuginfo package.
@ -1050,7 +1054,7 @@ Authors:
- the official arch_canon value for ppc64 is 16, not 5
* Thu Jan 16 2003 ma@suse.de
- update subpackage popt to 1.6.4
* Thu Dec 19 2002 schwab@suse.de
* Fri Dec 20 2002 schwab@suse.de
- Update autogen patch.
* Mon Nov 18 2002 stepan@suse.de
- add m68k as chanonical architecture to configure.in
@ -1202,7 +1206,7 @@ Authors:
- added requires for suse-build-key
* Tue Feb 12 2002 ro@suse.de
- tar option for bz2 is now "j" (re-added)
* Mon Feb 11 2002 ma@suse.de
* Tue Feb 12 2002 ma@suse.de
- unk_ugname_cached.diff: Upon building a package, unpacking sources
by calling tar from the spec file, may lead to files with unknown
user/group names. If those files are to be included in the final
@ -1215,7 +1219,7 @@ Authors:
which may cause a segmentation fault on cache lookup. This has been fixed.
* Sat Jan 26 2002 ro@suse.de
- apply configure-diff also on s390x
* Mon Jan 21 2002 bk@suse.de
* Tue Jan 22 2002 bk@suse.de
- use RPM_OPT_FLAGS for compilation
- add lib64 support for s390x
- update srcdir-supplied rpm-suse_macros file to newest version
@ -1352,7 +1356,7 @@ Authors:
- Fix in config.diff (use Makefile.am not Makefile.in)
* Mon Apr 10 2000 schwab@suse.de
- Fix config patch.
* Thu Apr 06 2000 bk@suse.de
* Fri Apr 07 2000 bk@suse.de
- added /lib/libpopt.so* to filelist on s390
* Wed Apr 05 2000 bk@suse.de
- uses autoconf and automake now