fix every single shellcheck error
This commit is contained in:
50
build.sh
50
build.sh
@ -1,15 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ -z $I2P_VERSION ]; then
|
if [ -z "$I2P_VERSION" ]; then
|
||||||
I2P_VERSION=2.1.0
|
I2P_VERSION=2.1.0
|
||||||
fi
|
fi
|
||||||
if [ -z $I2P_BUILD_NUMBER ]; then
|
if [ -z "$I2P_BUILD_NUMBER" ]; then
|
||||||
I2P_BUILD_NUMBER=1
|
I2P_BUILD_NUMBER=1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f config.sh ]; then
|
if [ -f config.sh ]; then
|
||||||
. config.sh
|
. "config.sh"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# old javas output version to stderr and don't support --version
|
# old javas output version to stderr and don't support --version
|
||||||
@ -26,7 +26,7 @@ if [ "$JAVA" -lt "16" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z ${JAVA_HOME} ]; then
|
if [ -z "${JAVA_HOME}" ]; then
|
||||||
JAVA_HOME=$(/usr/libexec/java_home)
|
JAVA_HOME=$(/usr/libexec/java_home)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ cd "$HERE"
|
|||||||
mkdir build
|
mkdir build
|
||||||
|
|
||||||
echo "compiling custom launcher and update processor"
|
echo "compiling custom launcher and update processor"
|
||||||
cp $I2P_JARS/*.jar build
|
cp "$I2P_JARS"/*.jar build
|
||||||
cd java
|
cd java
|
||||||
javac -d ../build -classpath ../build/i2p.jar:../build/router.jar net/i2p/router/MacLauncher.java net/i2p/update/*.java
|
javac -d ../build -classpath ../build/i2p.jar:../build/router.jar net/i2p/router/MacLauncher.java net/i2p/update/*.java
|
||||||
cd "$HERE"
|
cd "$HERE"
|
||||||
@ -104,18 +104,18 @@ cd ..
|
|||||||
echo "compiling native lib"
|
echo "compiling native lib"
|
||||||
cc -v -Wl,-lobjc -mmacosx-version-min=10.9 -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/darwin" -Ic -o build/libMacLauncher.jnilib -shared c/net_i2p_router_MacLauncher.c
|
cc -v -Wl,-lobjc -mmacosx-version-min=10.9 -I"$JAVA_HOME/include" -I"$JAVA_HOME/include/darwin" -Ic -o build/libMacLauncher.jnilib -shared c/net_i2p_router_MacLauncher.c
|
||||||
|
|
||||||
if [ -z $I2P_SIGNER ]; then
|
if [ -z "$I2P_SIGNER" ]; then
|
||||||
echo "I2P_SIGNER is unset, not proceeding to sign jbigi libs"
|
echo "I2P_SIGNER is unset, not proceeding to sign jbigi libs"
|
||||||
cp $I2P_JARS/jbigi.jar build
|
cp "$I2P_JARS"/jbigi.jar build
|
||||||
else
|
else
|
||||||
echo "signing jbigi libs"
|
echo "signing jbigi libs"
|
||||||
mkdir jbigi
|
mkdir jbigi
|
||||||
cp $I2P_JARS/jbigi.jar jbigi
|
cp "$I2P_JARS"/jbigi.jar jbigi
|
||||||
cd jbigi
|
cd jbigi
|
||||||
unzip jbigi.jar
|
unzip jbigi.jar
|
||||||
for lib in *.jnilib; do
|
for lib in *.jnilib; do
|
||||||
codesign --force -s $I2P_SIGNER -v $lib
|
codesign --force -s "$I2P_SIGNER" -v "$lib"
|
||||||
jar uf jbigi.jar $lib
|
jar uf jbigi.jar "$lib"
|
||||||
done
|
done
|
||||||
cp jbigi.jar ../build
|
cp jbigi.jar ../build
|
||||||
cd ..
|
cd ..
|
||||||
@ -125,7 +125,7 @@ echo "preparing to invoke jpackage for I2P version $I2P_VERSION build $I2P_BUILD
|
|||||||
|
|
||||||
cp "$I2P_PKG/Start I2P Router.app/Contents/Resources/i2p.icns" build/I2P.icns
|
cp "$I2P_PKG/Start I2P Router.app/Contents/Resources/i2p.icns" build/I2P.icns
|
||||||
cp "$I2P_PKG/Start I2P Router.app/Contents/Resources/i2p.icns" build/I2P-volume.icns
|
cp "$I2P_PKG/Start I2P Router.app/Contents/Resources/i2p.icns" build/I2P-volume.icns
|
||||||
cp $I2P_PKG/LICENSE.txt build
|
cp "$I2P_PKG/LICENSE.txt" build
|
||||||
cat resources/License-JRE-snippet.txt >> build/LICENSE.txt
|
cat resources/License-JRE-snippet.txt >> build/LICENSE.txt
|
||||||
cp resources/I2P-background.tiff build
|
cp resources/I2P-background.tiff build
|
||||||
|
|
||||||
@ -149,44 +149,44 @@ jpackage --name I2P \
|
|||||||
--input build --main-jar launcher.jar --main-class net.i2p.router.MacLauncher
|
--input build --main-jar launcher.jar --main-class net.i2p.router.MacLauncher
|
||||||
|
|
||||||
echo "adding pkg-temp to resources"
|
echo "adding pkg-temp to resources"
|
||||||
cp -R $I2P_PKG/* I2P.app/Contents/Resources
|
cp -R "$I2P_PKG"/* I2P.app/Contents/Resources
|
||||||
for i in i2prouter lib locale man wrapper.config eepget runplain.sh postinstall.sh osid; do
|
for i in i2prouter lib locale man wrapper.config eepget runplain.sh postinstall.sh osid; do
|
||||||
rm -rf I2P.app/Contents/Resources/$i
|
rm -rf I2P.app/Contents/Resources/$i
|
||||||
done
|
done
|
||||||
cp $HERE/resources/GPLv2+CE.txt I2P.app/Contents/Resources/licenses/LICENSE-JRE.txt
|
cp "$HERE"/resources/GPLv2+CE.txt I2P.app/Contents/Resources/licenses/LICENSE-JRE.txt
|
||||||
cp $I2P_PKG/licenses/* I2P.app/Contents/Resources/licenses/
|
cp "$I2P_PKG"/licenses/* I2P.app/Contents/Resources/licenses/
|
||||||
cp $HERE/build/libMacLauncher.jnilib I2P.app/Contents/Resources
|
cp "$HERE"/build/libMacLauncher.jnilib I2P.app/Contents/Resources
|
||||||
if [ $ARCH == "arm64" ]; then
|
if [ "$ARCH" == "arm64" ]; then
|
||||||
cp $HERE/resources/router.config.arm64 I2P.app/Contents/Resources/router.config
|
cp "$HERE/resources/router.config.arm64" I2P.app/Contents/Resources/router.config
|
||||||
else
|
else
|
||||||
cp $HERE/resources/router.config I2P.app/Contents/Resources
|
cp "$HERE/resources/router.config" I2P.app/Contents/Resources
|
||||||
fi
|
fi
|
||||||
cp $HERE/resources/*.crt I2P.app/Contents/Resources/certificates/router
|
cp "$HERE"/resources/*.crt I2P.app/Contents/Resources/certificates/router
|
||||||
|
|
||||||
if [ -z $I2P_SIGNER ]; then
|
if [ -z "$I2P_SIGNER" ]; then
|
||||||
echo "I2P_SIGNER is unset, not proceeding to signing phase"
|
echo "I2P_SIGNER is unset, not proceeding to signing phase"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z $I2P_CODE_SIGNER ]; then
|
if [ -z "$I2P_CODE_SIGNER" ]; then
|
||||||
echo "I2P_CODE_SIGNER is unset, not proceeding to signing phase"
|
echo "I2P_CODE_SIGNER is unset, not proceeding to signing phase"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "signing the runtime libraries"
|
echo "signing the runtime libraries"
|
||||||
|
|
||||||
find I2P.app -name *.dylib -exec codesign --force -s $I2P_SIGNER -v '{}' \;
|
find I2P.app -name "*.dylib" -exec codesign --force -s "$I2P_SIGNER" -v '{}' \;
|
||||||
find I2P.app -name *.jnilib -exec codesign --force -s $I2P_CODE_SIGNER -v '{}' \;
|
find I2P.app -name "*.jnilib" -exec codesign --force -s "$I2P_CODE_SIGNER" -v '{}' \;
|
||||||
|
|
||||||
echo "signing the bundle"
|
echo "signing the bundle"
|
||||||
codesign --force -d --deep -f \
|
codesign --force -d --deep -f \
|
||||||
--options=runtime \
|
--options=runtime \
|
||||||
--entitlements resources/entitlements.xml \
|
--entitlements resources/entitlements.xml \
|
||||||
-s $I2P_SIGNER \
|
-s "$I2P_SIGNER" \
|
||||||
--verbose=4 \
|
--verbose=4 \
|
||||||
I2P.app
|
I2P.app
|
||||||
|
|
||||||
jpackage --name I2P --app-image I2P.app --app-version $I2P_VERSION \
|
jpackage --name I2P --app-image I2P.app --app-version "$I2P_VERSION" \
|
||||||
--verbose --temp tmp \
|
--verbose --temp tmp \
|
||||||
--license-file build/LICENSE.txt \
|
--license-file build/LICENSE.txt \
|
||||||
--mac-sign \
|
--mac-sign \
|
||||||
|
6
clean.sh
6
clean.sh
@ -15,6 +15,6 @@ rm -rfv \
|
|||||||
prngseed.rnd \
|
prngseed.rnd \
|
||||||
router.config \
|
router.config \
|
||||||
wrapper.log \
|
wrapper.log \
|
||||||
*.jar \
|
./*.jar \
|
||||||
*.exe \
|
./*.exe \
|
||||||
*.dmg
|
./*.dmg
|
||||||
|
@ -13,21 +13,19 @@
|
|||||||
# Uncomment/Edit this line to include the build number in the config file
|
# Uncomment/Edit this line to include the build number in the config file
|
||||||
# I2P_BUILD_NUMBER=1
|
# I2P_BUILD_NUMBER=1
|
||||||
|
|
||||||
if [ -z $I2P_SIGNER ]; then
|
if [ -z "$I2P_SIGNER" ]; then
|
||||||
# This is the team ID of the Apple account associated with the app. It is used to sign the DMG.
|
# This is the team ID of the Apple account associated with the app. It is used to sign the DMG.
|
||||||
# it is a unique ID which is a short, random-looking string.
|
# it is a unique ID which is a short, random-looking string.
|
||||||
# OR
|
# OR
|
||||||
# the sha256 fingerprint of the cert(recommended)
|
# the sha256 fingerprint of the cert(recommended)
|
||||||
echo "I2P_SIGNER not set, signing will not work"
|
echo "I2P_SIGNER not set, signing will not work"
|
||||||
I2P_SIGNER=$(security find-identity -v -p codesigning | cut -d ' ' -f 3)
|
|
||||||
fi
|
fi
|
||||||
if [ -z $I2P_CODE_SIGNER ]; then
|
if [ -z "$I2P_CODE_SIGNER" ]; then
|
||||||
# This is the code signing ID of the team associated with the Apple Account. it is used to sign the libraries.
|
# This is the code signing ID of the team associated with the Apple Account. it is used to sign the libraries.
|
||||||
# it is a unique ID which is a short, random-looking string.
|
# it is a unique ID which is a short, random-looking string.
|
||||||
# OR
|
# OR
|
||||||
# the sha256 fingerprint of the cert(recommended)
|
# the sha256 fingerprint of the cert(recommended)
|
||||||
echo "I2P_CODE_SIGNER not set, signing will not work"
|
echo "I2P_CODE_SIGNER not set, signing will not work"
|
||||||
I2P_CODE_SIGNER_USERPHRASE=$(security find-identity -v -p codesigning | cut -d ' ' -f 3)
|
|
||||||
fi
|
fi
|
||||||
if [ -z "$I2P_SIGNER_USERPHRASE" ]; then
|
if [ -z "$I2P_SIGNER_USERPHRASE" ]; then
|
||||||
# This is an the phrase identifying the third party developer(I2P) in the following form:
|
# This is an the phrase identifying the third party developer(I2P) in the following form:
|
||||||
@ -35,6 +33,5 @@ if [ -z "$I2P_SIGNER_USERPHRASE" ]; then
|
|||||||
# OR
|
# OR
|
||||||
# the sha256 fingerprint of the cert(recommended)
|
# the sha256 fingerprint of the cert(recommended)
|
||||||
echo "I2P_SIGNER_USERPHRASE not set, signing will not work"
|
echo "I2P_SIGNER_USERPHRASE not set, signing will not work"
|
||||||
I2P_SIGNER_USERPHRASE=$(security find-identity -v -p codesigning | cut -d ' ' -f 3)
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
10
release.sh
10
release.sh
@ -1,19 +1,19 @@
|
|||||||
#! /usr/bin/env sh
|
#! /usr/bin/env sh
|
||||||
|
|
||||||
I2P_DATE=`date +%Y-%m-%d`
|
I2P_DATE=$(date +%Y-%m-%d)
|
||||||
|
|
||||||
if [ -z ${I2P_OS} ]; then
|
if [ -z "${I2P_OS}" ]; then
|
||||||
I2P_OS=mac
|
I2P_OS=mac
|
||||||
fi
|
fi
|
||||||
if [ -z ${I2P_BRANCH} ]; then
|
if [ -z "${I2P_BRANCH}" ]; then
|
||||||
I2P_BRANCH=beta
|
I2P_BRANCH=beta
|
||||||
fi
|
fi
|
||||||
if [ -z ${I2P_DOWNLOAD} ]; then
|
if [ -z "${I2P_DOWNLOAD}" ]; then
|
||||||
echo "\$I2P_DOWNLOAD is not set, an HTTP download will not be added to releases.json"
|
echo "\$I2P_DOWNLOAD is not set, an HTTP download will not be added to releases.json"
|
||||||
sleep 5s
|
sleep 5s
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z ${I2P_VERSION} ]; then
|
if [ -z "${I2P_VERSION}" ]; then
|
||||||
echo "\$I2P_VERSION not set, aborting"
|
echo "\$I2P_VERSION not set, aborting"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
Reference in New Issue
Block a user