2008-04-09 18:18:03 +02:00
|
|
|
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.
|
|
|
|
|
2011-05-18 17:08:31 +02:00
|
|
|
--- ./macros.in.orig 2011-05-11 15:01:39.000000000 +0000
|
|
|
|
+++ ./macros.in 2011-05-11 15:36:05.000000000 +0000
|
|
|
|
@@ -190,6 +190,18 @@ Debug information is useful when develop
|
2008-04-09 18:18:03 +02:00
|
|
|
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}
|
|
|
|
|
2009-08-28 15:54:03 +02:00
|
|
|
%_defaultdocdir %{_datadir}/doc/packages
|
2011-05-18 17:08:31 +02:00
|
|
|
--- ./scripts/find-debuginfo.sh.orig 2011-05-11 14:46:18.000000000 +0000
|
|
|
|
+++ ./scripts/find-debuginfo.sh 2011-05-11 15:36:05.000000000 +0000
|
|
|
|
@@ -187,8 +187,8 @@ set -o pipefail
|
2008-09-12 20:37:28 +02:00
|
|
|
strict_error=ERROR
|
|
|
|
$strict || strict_error=WARNING
|
2008-04-09 18:18:03 +02:00
|
|
|
|
2008-04-19 23:47:59 +02:00
|
|
|
-# Strip ELF binaries
|
2009-02-16 17:11:16 +01:00
|
|
|
-find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) -print 0 | sort -z |
|
2008-09-12 20:37:28 +02:00
|
|
|
+# Strip ELF binaries (and no static libraries)
|
2009-02-16 17:11:16 +01:00
|
|
|
+find $RPM_BUILD_ROOT ! -path "${debugdir}/*.debug" -type f \( -perm +111 -or -name "*.so*" -or -name "*.ko" \) ! -name "*.a" -print0 | sort -z |
|
2008-09-16 01:28:45 +02:00
|
|
|
xargs --no-run-if-empty -0 stat -c '%h %D_%i %n' |
|
2008-09-12 20:37:28 +02:00
|
|
|
while read nlinks inum f; do
|
|
|
|
case $(objdump -h $f 2>/dev/null | egrep -o '(debug[\.a-z_]*|gnu.version)') in
|
2011-05-18 17:08:31 +02:00
|
|
|
@@ -300,10 +300,16 @@ if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o -
|
2008-04-09 18:18:03 +02:00
|
|
|
|
2008-09-12 20:37:28 +02:00
|
|
|
(cd "${RPM_BUILD_ROOT}/usr"
|
|
|
|
test ! -d lib/debug || find lib/debug ! -type d
|
|
|
|
- test ! -d src/debug || find src/debug -mindepth 1 -maxdepth 1
|
|
|
|
) | sed 's,^,/usr/,' >> "$LISTFILE"
|
|
|
|
fi
|
2008-04-09 18:18:03 +02:00
|
|
|
|
2008-09-12 20:37:28 +02:00
|
|
|
+: > "$SOURCEFILE"
|
|
|
|
+if [ -d "${RPM_BUILD_ROOT}/usr/src" ]; then
|
|
|
|
+ (cd "${RPM_BUILD_ROOT}/usr"
|
|
|
|
+ test ! -d src/debug || find src/debug -mindepth 1 -maxdepth 1
|
|
|
|
+ ) | sed 's,^,/usr/,' >> "$SOURCEFILE"
|
2008-04-09 18:18:03 +02:00
|
|
|
+fi
|
2008-09-12 20:37:28 +02:00
|
|
|
+
|
|
|
|
# Append to $1 only the lines from stdin not already in the file.
|
|
|
|
append_uniq()
|
|
|
|
{
|