From 1a45efd94a71c9dee1fc82affaaabfd312d110a8 Mon Sep 17 00:00:00 2001 From: "Tom G. Christensen" Date: Fri, 31 Dec 2004 10:45:32 +0000 Subject: [PATCH] Add "autonuke" function to automatically cleanout unwanted files from the stagedir after install --- buildpkg.functions | 43 +++++++++++++++++++++++++++++++++++++++++++ subsys.conf | 1 + 2 files changed, 44 insertions(+) diff --git a/buildpkg.functions b/buildpkg.functions index 26407d3..c1d32de 100644 --- a/buildpkg.functions +++ b/buildpkg.functions @@ -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 diff --git a/subsys.conf b/subsys.conf index 3ba5598..7df26f1 100644 --- a/subsys.conf +++ b/subsys.conf @@ -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