xbps-src: multiple changes to improve infrastructure.

- Remove buildvars_funcs.sh, its code has been moved into set_tmpl_common_vars().
- Move stripping code into its own file, and don't run it via fakeroot.
- Remove unnecesary reset_tmpl_vars() call in install_pkg().
- Misc changes.
This commit is contained in:
Juan RP 2010-05-26 15:41:26 +02:00
parent 90a9ea320b
commit c34e13336b
7 changed files with 146 additions and 117 deletions

View file

@ -40,28 +40,6 @@ set_defvars
. $XBPS_SHUTILSDIR/common_funcs.sh
. $XBPS_SHUTILSDIR/builddep_funcs.sh
strip_files()
{
local lver="$1"
if [ ! -x /usr/bin/strip ]; then
return 0
fi
[ -n "$nostrip" ] && return 0
msg_normal "Package '$pkgname ($lver)': stripping files, please wait..."
for f in $(find ${DESTDIR} -type f); do
case "$(file -biz $f)" in
application/x-executable*)
/usr/bin/strip $f && \
echo " Stripped executable: $(basename $f)";;
application/x-sharedlib*|application/x-archive*)
/usr/bin/strip -S $f && \
echo " Stripped library: $(basename $f)";;
esac
done
}
install_src_phase()
{
local f i subpkg lver spkgrev saved_wrksrc
@ -160,11 +138,6 @@ install_src_phase()
msg_normal "Package '$pkgname ($lver)': removing empty dirs..."
find ${DESTDIR} -depth -type d -exec rmdir 2>/dev/null {} \;
fi
# Strip bins/libs.
if [ -z "$noarch" ]; then
strip_files "$lver"
fi
msg_normal "Package '$pkgname ($lver)': installed into destdir."
if [ "$build_style" != "custom-install" -a -z "$distfiles" ]; then
@ -216,7 +189,6 @@ install_src_phase()
#
# Installs a package via 'make install ...'.
#
make_install()
{
local lver="$1"
@ -224,10 +196,7 @@ make_install()
if [ -z "$make_install_target" ]; then
make_install_target="DESTDIR=${DESTDIR} install"
fi
[ -z "$make_cmd" ] && make_cmd=make
. $XBPS_SHUTILSDIR/buildvars_funcs.sh
#
# Install package via make.
#