1
0
mirror of https://github.com/moparisthebest/pacman synced 2024-12-23 00:08:50 -05:00

Make strip paths configurable

This patch introduces a new STRIP_DIRS makepkg.conf option
to change makepkg's search path when stripping binaries.

Original work by: Thomas Bächler <thomas@archlinux.org>
Signed-off-by: Allan McRae <allan@archlinux.org>
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Allan McRae 2008-07-20 15:57:03 +10:00 committed by Dan McGee
parent b4f2cb53ef
commit ae9e33ed88
3 changed files with 15 additions and 3 deletions

View File

@ -134,6 +134,13 @@ Options
that are located in opt/, you may need to add the directory to this that are located in opt/, you may need to add the directory to this
array. *NOTE:* Do not add the leading slash to the directory name. array. *NOTE:* Do not add the leading slash to the directory name.
**STRIP_DIRS=(**bin lib sbin usr/{bin,lib} ...**)**::
If "strip" is specified in the OPTIONS array, this variable will
instruct makepkg where to look to for files to strip. If you build
packages that are located in opt/, you may need to add the directory
to this array. *NOTE:* Do not add the leading slash to the directory
name.
**PKGDEST=**"/path/to/folder":: **PKGDEST=**"/path/to/folder"::
If this value is not set, packages will by default be placed in the If this value is not set, packages will by default be placed in the
current directory (location of the linkman:PKGBUILD[5]). Many people current directory (location of the linkman:PKGBUILD[5]). Many people

View File

@ -73,6 +73,8 @@ OPTIONS=(strip docs libtool emptydirs zipman)
INTEGRITY_CHECK=(md5) INTEGRITY_CHECK=(md5)
#-- Info and doc directories to remove (if option set correctly above) #-- Info and doc directories to remove (if option set correctly above)
DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/*/{info,doc,gtk-doc}) DOC_DIRS=(usr/{,share/}{info,doc,gtk-doc} opt/*/{info,doc,gtk-doc})
#-- Directories to be searched for the strip option (if option set correctly above)
STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin})
######################################################################### #########################################################################
# PACKAGE OUTPUT # PACKAGE OUTPUT

View File

@ -731,9 +731,12 @@ tidy_install() {
if [ "$(check_option strip)" = "y" ]; then if [ "$(check_option strip)" = "y" ]; then
msg2 "$(gettext "Stripping debugging symbols from binaries and libraries...")" msg2 "$(gettext "Stripping debugging symbols from binaries and libraries...")"
local binary bindirs local binary
bindirs="bin lib sbin usr/bin usr/lib usr/sbin usr/local/bin usr/local/lib usr/local/sbin opt/*/bin opt/*/lib opt/*/sbin" if [ -z "${STRIP_DIRS[@]}" ]; then
find ${bindirs} -type f 2>/dev/null | while read binary ; do # fall back to default value
STRIP_DIRS=(bin lib sbin usr/{bin,lib,sbin,local/{bin,lib,sbin}} opt/*/{bin,lib,sbin})
fi
find ${STRIP_DIRS[@]} -type f 2>/dev/null | while read binary ; do
case "$(file -biz "$binary")" in case "$(file -biz "$binary")" in
*application/x-sharedlib*) # Libraries (.so) *application/x-sharedlib*) # Libraries (.so)
/usr/bin/strip --strip-debug "$binary";; /usr/bin/strip --strip-debug "$binary";;