ezpp-oppai-ap/release
2021-06-25 20:26:13 +02:00

50 lines
871 B
Bash
Executable File

#!/bin/sh
dir=$(dirname $0)
olddir=$(pwd)
cd $dir
echo""
echo "compiling and stripping"
CC=musl-gcc ./build -static -no-pie || exit $?
CC=gcc ./libbuild || exit $?
echo""
echo "packaging"
folder="oppai-$(./oppai -version)-"
folder="${folder}$(gcc -dumpmachine)"
mkdir -p "$folder" || exit $?
mv ./oppai $folder/oppai || exit $?
mv ./liboppai.so $folder/liboppai.so || exit $?
git archive HEAD --prefix=src/ -o "$folder"/src.tar ||
exit $?
cd "$folder" || exit $?
tar xf src.tar || exit $?
cd .. || exit $?
rm "$folder".tar.xz
tar -cvJf "$folder".tar.xz \
"$folder"/oppai \
"$folder"/liboppai.so \
"$folder"/src \
|| exit $?
echo ""
file "$folder".tar.xz
tar tf "$folder".tar.xz
echo ""
file "$folder"/oppai
readelf --dynamic "$folder"/oppai
ldd "$folder"/oppai
echo ""
file "$folder"/liboppai.so
ldd "$folder"/liboppai.so
rm -rf "$folder"
cd $olddir