diff --git a/packelf-appimage-copylibs.sh b/packelf-appimage-copylibs.sh new file mode 100755 index 0000000..942d78d --- /dev/null +++ b/packelf-appimage-copylibs.sh @@ -0,0 +1,22 @@ +#!/usr/bin/env sh + +# Author: q3aql@duck.com +# Pack elf binary and it's dependencies into standalone executable using appimagetool +# License: GPLv2.0 +# Require: https://github.com/AppImage/appimagetool/releases + +if [ -z "${1}" ] ; then + echo "$0 " + exit 0 +else + if [ -z "${2}" ] ; then + echo "$0 " + exit 0 + else + libs="$(ldd "${1}" | grep -F '/' | sed -E 's|[^/]*/([^ ]+).*?|/\1|')" + for library in ${libs} ; do + cp -L ${library} ${2} + echo "Copied ${library} to ${2}" + done + fi +fi