Add "autonuke" function to automatically cleanout unwanted files from the
stagedir after install
This commit is contained in:
parent
5e5291c3fc
commit
1a45efd94a
@ -123,6 +123,8 @@ dostrip_elf=1 # default to stripping binaries during the install stage
|
||||
dostrip_shared=1 # default to stripping shared objects during the install stage
|
||||
dostrip_static=1 # default to stripping static archives during the install stage
|
||||
shortroot=0 # Deep or shallow stagedir?
|
||||
autonuke=1 # Automatically attempt to cleanout unwanted files after make install?
|
||||
# eg. info/dir, lib/*.la
|
||||
|
||||
# This is meant to aid custom install functions that wants
|
||||
# to skip the clean stage & make install parts of generic_install
|
||||
@ -354,6 +356,44 @@ do_strip()
|
||||
do_strip_static
|
||||
fi
|
||||
}
|
||||
|
||||
# do_autonuke(): Kill unwanted files after make install
|
||||
# params: none
|
||||
# Automatically switches to $stagedir/$prefix
|
||||
# On exit cwd is $stagedir/$prefix
|
||||
do_autonuke()
|
||||
{
|
||||
local i
|
||||
local didnuke=0
|
||||
echo "Autonuking..."
|
||||
|
||||
setdir ${stagedir}${prefix}
|
||||
if [ -d "${_infodir}" ]; then
|
||||
if [ -r ${_infodir}/dir ]; then
|
||||
echo "Nuking ${_infodir}/dir"
|
||||
${RM} -f ${_infodir}/dir
|
||||
didnuke=1
|
||||
fi
|
||||
fi
|
||||
if [ -d "${_libdir}" ]; then
|
||||
if [ -r ${_libdir}/charset.alias ]; then
|
||||
echo "Nuking ${_libdir}/charset.alias"
|
||||
${RM} -f ${_libdir}/charset.alias
|
||||
didnuke=1
|
||||
fi
|
||||
fi
|
||||
if [ -d "${_libdir}" -a ! -z "$($LS ${_libdir}/*.la)" ]; then
|
||||
for i in ${_libdir}/*.la
|
||||
do
|
||||
echo "Nuking $i"
|
||||
${RM} -f "$i"
|
||||
done
|
||||
didnuke=1
|
||||
fi
|
||||
if [ $didnuke -eq 0 ]; then
|
||||
echo "Found nothing to nuke"
|
||||
fi
|
||||
}
|
||||
|
||||
# fix_man(): create compressed pre-formatted manpages from raw ones
|
||||
# params: none
|
||||
@ -591,6 +631,9 @@ generic_install()
|
||||
if [ $dostrip -eq 1 ]; then
|
||||
do_strip
|
||||
fi
|
||||
if [ $autonuke -eq 1 ]; then
|
||||
do_autonuke
|
||||
fi
|
||||
}
|
||||
|
||||
# generic_pack(): Build package using files from 'install' stage
|
||||
|
@ -4,6 +4,7 @@ sw.dev nodefault development files
|
||||
man.doc default other documentation
|
||||
man.man default man pages
|
||||
man.info default info pages
|
||||
man.dev nodefault development man pages
|
||||
opt.relnotes default release notes
|
||||
opt.src nodefault source, patches etc.
|
||||
opt.dist nodefault distribution files
|
||||
|
Loading…
x
Reference in New Issue
Block a user