2021-03-26 21:50:00 +01:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# Copy necessary tools for Cygwin/Windows version
|
|
|
|
# After, you must copy all files to /bin directory
|
2022-01-02 17:02:55 +01:00
|
|
|
mkdir -p ${HOME}/ks-tools/bin/
|
2021-03-26 21:50:00 +01:00
|
|
|
cd /usr/bin
|
|
|
|
|
|
|
|
# All executables
|
|
|
|
|
2022-01-02 19:10:35 +01:00
|
|
|
list_binary="bash cat clear cut cygwin-console-helper date echo expr ffmpeg ffprobe find grep head ls md5sum mkdir mv cp rm rsync scp sed sleep ssh-add ssh-agent ssh-keygen ssh-keyscan ssh sshpass tail tr wc pwd mintty file ldd touch nano"
|
2021-03-26 21:50:00 +01:00
|
|
|
|
2022-01-02 19:10:35 +01:00
|
|
|
echo "* Copying script bashbug"
|
|
|
|
cp -rfv /usr/bin/bashbug ${HOME}/ks-tools/bin/
|
2022-01-02 17:02:55 +01:00
|
|
|
for binary in ${list_binary} ; do
|
|
|
|
echo "* Copying binary ${binary}"
|
|
|
|
cp -rfv /usr/bin/${binary}.exe ${HOME}/ks-tools/bin/
|
|
|
|
echo "* Searching dependencies for ${binary}"
|
|
|
|
ldd /usr/bin/${binary}.exe | grep "/bin/" | cut -d ">" -f 2 | cut -d "(" -f 1 | tr -s " " > /tmp/deps.txt
|
|
|
|
file_size=$(cat /tmp/deps.txt | wc -l)
|
|
|
|
file_scan=1
|
|
|
|
echo "* Copying dependencies for ${binary}"
|
|
|
|
while [ ${file_scan} -le ${file_size} ] ; do
|
|
|
|
library=$(cat /tmp/deps.txt | head -${file_scan} | tail -1)
|
|
|
|
cp -rfv ${library} ${HOME}/ks-tools/bin/
|
|
|
|
file_scan=$(expr ${file_scan} + 1)
|
|
|
|
done
|
|
|
|
done
|
|
|
|
strip --strip-all ${HOME}/ks-tools/bin/*
|
|
|
|
cp -rfv /usr/bin/cyggcc_s-*.dll ${HOME}/ks-tools/bin/
|
|
|
|
cp -rfv /usr/bin/cygwin1.dll ${HOME}/ks-tools/bin/
|
|
|
|
cp -rfv /usr/bin/cygz.dll ${HOME}/ks-tools/bin/
|
2021-03-26 21:50:00 +01:00
|
|
|
|
|
|
|
|
|
|
|
# Finally, copy ks-tools scripts here.
|