mirror of
https://github.com/PurpleI2P/i2pd-android.git
synced 2025-01-08 22:07:57 +00:00
add binary pack script
Signed-off-by: R4SAS <r4sas@i2pmail.org>
This commit is contained in:
parent
9b4ee8447a
commit
0ead601868
2
contrib/binary_pack/.gitignore
vendored
Normal file
2
contrib/binary_pack/.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
archive
|
||||
i2pd_*_android_binary.zip
|
53
contrib/binary_pack/build-archive
Normal file
53
contrib/binary_pack/build-archive
Normal file
@ -0,0 +1,53 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2013-2022, The PurpleI2P Project
|
||||
#
|
||||
# This file is part of Purple i2pd project and licensed under BSD3
|
||||
#
|
||||
# See full license text in LICENSE file at top of project tree
|
||||
|
||||
GITDESC=$(git describe --tags)
|
||||
|
||||
declare -A ABILIST=(
|
||||
["armeabi-v7a"]="armv7l"
|
||||
["arm64-v8a"]="aarch64"
|
||||
["x86"]="x86"
|
||||
["x86_64"]="x86_64"
|
||||
)
|
||||
|
||||
# Remove old files and archives
|
||||
if [ -d "archive" ]; then
|
||||
rm -r archive
|
||||
fi
|
||||
|
||||
if [ -f "../i2pd_*_android_binary.zip" ]; then
|
||||
rm i2pd_*_android_binary.zip
|
||||
fi
|
||||
|
||||
# Prepare files for package
|
||||
mkdir archive
|
||||
|
||||
if [ ! -d "../binary/libs/" ]; then
|
||||
echo "Prebuilt binaries folder is not found. Have you built them?"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
for ABI in "${!ABILIST[@]}"; do
|
||||
if [ -f "../binary/libs/${ABI}/i2pd" ]; then
|
||||
cp ../binary/libs/${ABI}/i2pd archive/i2pd-${ABILIST[$ABI]}
|
||||
fi
|
||||
done
|
||||
|
||||
cp i2pd archive/i2pd
|
||||
cp -rH ../app/src/main/assets/certificates archive/
|
||||
cp -rH ../app/src/main/assets/tunnels.conf.d archive/
|
||||
cp -H ../app/src/main/assets/i2pd.conf archive/
|
||||
cp -H ../app/src/main/assets/tunnels.conf archive/
|
||||
|
||||
# Compress files
|
||||
cd archive
|
||||
zip -r6 ../i2pd_${GITDESC}_android_binary.zip .
|
||||
|
||||
# Remove temporary folder
|
||||
cd ..
|
||||
rm -r archive
|
33
contrib/binary_pack/i2pd
Normal file
33
contrib/binary_pack/i2pd
Normal file
@ -0,0 +1,33 @@
|
||||
#!/bin/sh
|
||||
|
||||
# Copyright (c) 2013-2020, The PurpleI2P Project
|
||||
#
|
||||
# This file is part of Purple i2pd project and licensed under BSD3
|
||||
#
|
||||
# See full license text in LICENSE file at top of project tree
|
||||
#
|
||||
# That script written for use with Termux.
|
||||
|
||||
# https://stackoverflow.com/a/246128
|
||||
SOURCE="${0}"
|
||||
while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
|
||||
SOURCE="$(readlink "$SOURCE")"
|
||||
[[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
|
||||
done
|
||||
DIR="$( cd -P "$( dirname "$SOURCE" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
arch=$(uname -m)
|
||||
|
||||
screenfind=$(which screen)
|
||||
if [ -z $screenfind ]; then
|
||||
echo "Can't find 'screen' installed. That script needs it!";
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
if [ -z i2pd-$arch ]; then
|
||||
echo "Can't find i2pd binary for your architecture.";
|
||||
exit 1;
|
||||
fi
|
||||
|
||||
screen -AmdS i2pd ./i2pd-$arch --datadir=$DIR
|
Loading…
Reference in New Issue
Block a user