From 08d50ddfc5c35df0559fd1b04ca69b365a828ec6 Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Wed, 6 Jul 2016 14:58:06 -0400 Subject: [PATCH] bundle lbrycrdd bins instead of downloading them --- packaging/ubuntu/lbry | 15 ++------------- packaging/ubuntu/ubuntu_package_setup.sh | 12 +++++++++++- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/packaging/ubuntu/lbry b/packaging/ubuntu/lbry index 9d5eafa3f..b22309c45 100755 --- a/packaging/ubuntu/lbry +++ b/packaging/ubuntu/lbry @@ -4,25 +4,14 @@ set -euo pipefail LBRYCRDDPATHCONF="$HOME/.lbrycrddpath.conf" LBRYCRDDIR="$HOME/.lbrycrd" -LBRYCRDDBIN="$LBRYCRDDIR/lbrycrdd" LBRYCRDCONF="$LBRYCRDDIR/lbrycrd.conf" -if [ ! -f "$LBRYCRDDBIN" ]; then - mkdir -p "$LBRYCRDDIR" - ( - cd "$LBRYCRDDIR" - echo "Downloading lbrycrd binaries" - wget http://s3.amazonaws.com/files.lbry.io/bins.zip - unzip -o bins.zip - rm bins.zip - ) -fi - if [ ! -f "$LBRYCRDDPATHCONF" ]; then - echo "$LBRYCRDDBIN" > "$LBRYCRDDPATHCONF" + echo "/usr/local/bin/lbrycrdd" > "$LBRYCRDDPATHCONF" fi if [ ! -f "$LBRYCRDCONF" ]; then + mkdir -p "$LBRYCRDDIR" echo -e "rpcuser=lbryrpc\nrpcpassword=$(env LC_CTYPE=C LC_ALL=C tr -dc A-Za-z0-9 < /dev/urandom | head -c 16 | xargs)" > "$LBRYCRDCONF" fi diff --git a/packaging/ubuntu/ubuntu_package_setup.sh b/packaging/ubuntu/ubuntu_package_setup.sh index 340e7998f..d7b564d0a 100755 --- a/packaging/ubuntu/ubuntu_package_setup.sh +++ b/packaging/ubuntu/ubuntu_package_setup.sh @@ -152,7 +152,7 @@ function addfile() { echo "$(md5sum "data/$TARGET" | cut -d' ' -f1) $TARGET" >> control/md5sums } - +# add icons addfile "$PACKAGING_DIR/icons/lbry32.png" usr/share/icons/hicolor/32x32/apps/lbry.png addfile "$PACKAGING_DIR/icons/lbry48.png" usr/share/icons/hicolor/48x48/apps/lbry.png addfile "$PACKAGING_DIR/icons/lbry96.png" usr/share/icons/hicolor/96x96/apps/lbry.png @@ -160,12 +160,22 @@ addfile "$PACKAGING_DIR/icons/lbry128.png" usr/share/icons/hicolor/128x128/apps/ addfile "$PACKAGING_DIR/icons/lbry256.png" usr/share/icons/hicolor/256x256/apps/lbry.png addfile "$PACKAGING_DIR/lbry.desktop" usr/share/applications/lbry.desktop +# add lbry executable script BINPATH=usr/share/python/lbrynet/bin addfile "$PACKAGING_DIR/lbry" "$BINPATH/lbry" +# symlink script into /usr/local/bin ln -s "/$BINPATH/lbry" "$PACKAGING_DIR/lbry-temp-symlink" addfile "$PACKAGING_DIR/lbry-temp-symlink" usr/local/bin/lbry +# add lbrycrdd and lbrycrd-cli +mkdir -p "$PACKAGING_DIR/bins" +wget http://s3.amazonaws.com/files.lbry.io/bins.zip --output-file "$PACKAGING_DIR/bins.zip" +unzip -o "$PACKAGING_DIR/bins/zip" -d "$PACKAGING_DIR/bins/" +addfile "$PACKAGING_DIR/bins/lbrycrdd" usr/local/bin/lbrycrdd +addfile "$PACKAGING_DIR/bins/lbrycrd-cli" usr/local/bin/lbrycrd-cli + +# add postinstall script cat "$PACKAGING_DIR/postinst_append" >> control/postinst # repackage .deb