Commit 21e22c4b authored by Natanael Copa's avatar Natanael Copa

main/abuild: implement -dbg subpackages

Simply create a -dbg subpackage and abuild will automatically add
symbols there.

Patch from Andrew Manison

fixes #626
parent 18458d2a
From 9cb1ad3cffdb2664205645e2dad0600d6eaa2e1f Mon Sep 17 00:00:00 2001
From: Natanael Copa <ncopa@alpinelinux.org>
Date: Thu, 16 Jan 2014 14:33:45 +0100
Subject: [PATCH] abuild: implement -dbg subpackages
Patch from Andrew Manison.
ref #626
---
abuild.in | 35 ++++++++++++++++++++++++++++++++++-
1 file changed, 34 insertions(+), 1 deletion(-)
diff --git a/abuild.in b/abuild.in
index c37af4d..0876380 100755
--- a/abuild.in
+++ b/abuild.in
@@ -1245,6 +1245,31 @@ doc() {
default_doc
}
+# predefined splitfunc doc
+default_dbg() {
+ local f
+ binfiles=$(scanelf -R "$pkgdir" | grep ET_DYN | sed "s:$pkgdir\/::g" | sed "s:ET_DYN ::g")
+ for f in $binfiles; do
+ srcdir=$(dirname $pkgdir/$f)
+ srcfile=$(basename $pkgdir/$f)
+ dstdir=$(dirname $subpkgdir/usr/lib/debug/$f.debug)
+ dstfile=$(basename $subpkgdir/usr/lib/debug/$f.debug)
+ if [ ! -d $dstdir ] ; then
+ mkdir -p $dstdir
+ fi
+ cd $srcdir
+ objcopy --only-keep-debug $srcfile $dstfile
+ objcopy --add-gnu-debuglink=$dstfile $srcdir/$srcfile
+ mv $dstfile $dstdir
+ strip $srcfile
+ done
+ return 0
+}
+
+dbg() {
+ default_dbg
+}
+
# predefined splitfunc dev
default_dev() {
local i= j=
@@ -1675,6 +1700,14 @@ subpackages_has() {
return 1
}
+subpackage_types_has() {
+ local i
+ for i in $subpackages; do
+ [ "$1" = "${i##*-}" ] && return 0
+ done
+ return 1
+}
+
list_has() {
local needle="$1"
local i
@@ -1946,7 +1979,7 @@ else
fi
# if we want build debug package
-if [ -n "$DEBUG" ]; then
+if [ -n "$DEBUG" ] || subpackage_types_has "dbg"; then
CFLAGS="$CFLAGS -g"
options="$options !strip"
fi
--
1.8.5.2
......@@ -2,7 +2,7 @@
pkgname=abuild
pkgver=2.19.1
_ver=${pkgver%_git*}
pkgrel=1
pkgrel=2
pkgdesc="Script to build Alpine Packages"
url="http://git.alpinelinux.org/cgit/abuild/"
arch="all"
......@@ -19,6 +19,7 @@ subpackages="apkbuild-cpan:cpan"
pkggroups="abuild"
source="http://dev.alpinelinux.org/archive/abuild/abuild-$pkgver.tar.xz
0001-abuild-exit-with-error-if-pkgrel-is-unset.patch
0001-abuild-implement-dbg-subpackages.patch
"
_builddir="$srcdir/$pkgname-$_ver"
......@@ -56,8 +57,11 @@ cpan() {
}
md5sums="8888d0fd3fcc620c8b815c473e51652d abuild-2.19.1.tar.xz
b29c403c214fe62983c9a039ce8c113f 0001-abuild-exit-with-error-if-pkgrel-is-unset.patch"
b29c403c214fe62983c9a039ce8c113f 0001-abuild-exit-with-error-if-pkgrel-is-unset.patch
90dcfc68d5677726824d62a1fe05e9af 0001-abuild-implement-dbg-subpackages.patch"
sha256sums="5e583d53eced10bdc39301c2cb9a74a644033e98daff636533859a929e27ca63 abuild-2.19.1.tar.xz
9f63efc778e67c45403af87b7174355cb03690db51c2605c7d29f818cc24caba 0001-abuild-exit-with-error-if-pkgrel-is-unset.patch"
9f63efc778e67c45403af87b7174355cb03690db51c2605c7d29f818cc24caba 0001-abuild-exit-with-error-if-pkgrel-is-unset.patch
2d2554b508e5ebd02b4bd16db7805e6c5898b06d6bab093e30bf8ab0ba68b18f 0001-abuild-implement-dbg-subpackages.patch"
sha512sums="b2e78b4d23d49477b27283cdc569d9b7bac5745024b50670251682dba26fc24d7d7b5d90d4e252af13ac3109252450169595215650713314f96bbacf485084c6 abuild-2.19.1.tar.xz
9bc14785134b0db7855471ea2dd7da4bb7cb6c5f91b1030a3e23d21c662175248f6455343bfeb0af1d34c046701d977b56c768b435a72051fe270eb56dbc534c 0001-abuild-exit-with-error-if-pkgrel-is-unset.patch"
9bc14785134b0db7855471ea2dd7da4bb7cb6c5f91b1030a3e23d21c662175248f6455343bfeb0af1d34c046701d977b56c768b435a72051fe270eb56dbc534c 0001-abuild-exit-with-error-if-pkgrel-is-unset.patch
826da7f05fc7cf74220b51f11b6db1943ea2481098b4860b11a2cbc419ae248dae62f9e8849e452097a6d2cd784a3f2b3e999a426bbb3e9745ee3309d765cdb1 0001-abuild-implement-dbg-subpackages.patch"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment