From bb00a1dfa75f1a9a0a9ff55afc0da3d6510ab613 Mon Sep 17 00:00:00 2001 From: Kali Kaneko Date: Thu, 15 Feb 2018 20:30:59 +0100 Subject: [pkg] life is better among hunter-gatherers aka, get *all* of the dynamic libraries into the bundle. This probably won't work like this, but I think it's more comfortable to strip libraries from the list rather than hunting for them one by one. --- pkg/hunter/gatherer | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 pkg/hunter/gatherer (limited to 'pkg/hunter') diff --git a/pkg/hunter/gatherer b/pkg/hunter/gatherer new file mode 100755 index 00000000..5412748e --- /dev/null +++ b/pkg/hunter/gatherer @@ -0,0 +1,36 @@ +#!/bin/bash +# Author : Hemanth.HM +# Email : hemanth[dot]hm[at]gmail[dot]com +# License : GNU GPLv3 +# + +function useage() +{ + cat << EOU +Useage: bash $0 +EOU +exit 1 +} + +#Validate the inputs +[[ $# < 2 ]] && useage + +#Check if the paths are vaild +[[ ! -e $1 ]] && echo "Not a vaild input $1" && exit 1 +[[ -d $2 ]] || echo "No such directory $2 creating..."&& mkdir -p "$2" + +#Get the library dependencies +echo "Collecting the shared library dependencies for $1..." +deps=$(ldd $1 | awk 'BEGIN{ORS=" "}$1\ +~/^\//{print $1}$3~/^\//{print $3}'\ + | sed 's/,$/\n/') +echo "Copying the dependencies to $2" + +#Copy the deps +for dep in $deps +do + echo "Copying $dep to $2" + cp "$dep" "$2" +done + +echo "Done!" -- cgit v1.2.3