From 0b84822175a354e1442059bb9ad46a828cf73731 Mon Sep 17 00:00:00 2001 From: andoni Date: Mon, 5 Mar 2018 16:48:24 +0100 Subject: [PATCH] remove fpm dependency. --- .gitignore | 2 ++ README.md | 14 ++-------- package | 82 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ turtl_deb | 68 -------------------------------------------- 4 files changed, 87 insertions(+), 79 deletions(-) create mode 100644 .gitignore create mode 100755 package delete mode 100755 turtl_deb diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4afcf19 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +.idea +build \ No newline at end of file diff --git a/README.md b/README.md index d79370c..c9fca14 100644 --- a/README.md +++ b/README.md @@ -12,21 +12,13 @@ For more information about Turtl, please visit www.turtlapp.com ## How to build -1. Install "Effing Package Management" - ``` - sudo gem install fpm - ``` - This [wiki](https://github.com/jordansissel/fpm/wiki) provides all necessary information about FPM. - -2. Run the shell script - - Download the script turtl_deb and run it localy. + Download the script ```package``` and run it locally. ``` wget https://raw.githubusercontent.com/adelolmo/turtl-debian/master/turtl_deb - /bin/sh turtl_deb 64|32 [version] + /bin/sh package 64|32 [version] ``` The first parameter is the system architecture, it must be 32 or 64. The second parameter is the version of Turtl, if it's not given it will use the latest version available in https://turtlapp.com - The debian package will be created under /tmp/turtldeb + The debian package will be created under build/releases. ## Oficial Turtl server URL diff --git a/package b/package new file mode 100755 index 0000000..8a357f9 --- /dev/null +++ b/package @@ -0,0 +1,82 @@ +#!/bin/sh -e + +TMP=build/tmp +RELEASE=build/releases + +rm -fr build +mkdir -p ${TMP} ${RELEASE} + +arch=64 +if [ -n "$1" ]; then + arch=$1 +fi + +version=$( wget https://turtlapp.com -O build/turtlhome > /dev/null 2>&1 && cat build/turtlhome | grep -oE "turtl-linux${arch}-[0-9].[0-9].[0-9]" | uniq | grep -Eo "[0-9].[0-9].[0-9]*$" ) +if [ -n "$2" ]; then + version=$2 +fi + +echo "* Retrieve artifact ${arch} ${version} ..." +[ -f /tmp/turtl-linux${arch}.tar.bz2 ] || wget -O /tmp/turtl-linux${arch}.tar.bz2 https://turtlapp.com/releases/desktop/turtl-linux${arch}-${version}.tar.bz2 + +echo "* Extract tar ..." +tar xf /tmp/turtl-linux${arch}.tar.bz2 -C build + +echo "* Prepare package directory ..." +mkdir -p ${TMP}/usr/share/turtl +cp -R build/turtl-linux${arch}/turtl/* ${TMP}/usr/share/turtl + +echo "* Create icon ..." +mkdir -p ${TMP}/usr/share/pixmaps +mv build/turtl-linux${arch}/turtl/icon.png ${TMP}/usr/share/pixmaps/turtl.png + +echo "* Create menu entry ..." +mkdir -p ${TMP}/usr/share/applications +cat > ${TMP}/usr/share/applications/turtl.desktop < ${TMP}/DEBIAN/control </dev/null 2>&1 || { echo >&2 "Install fpm first. https://github.com/jordansissel/fpm/wiki"; exit 1; } - -TMP=/tmp/turtldeb -TMP_DEB=$TMP/deb - -rm -fr $TMP -mkdir -p $TMP_DEB - -cd /tmp - -arch=64 -if [ -n "$1" ]; then - arch=$1 -fi - -version=$( wget https://turtlapp.com -O turtlhome > /dev/null 2>&1 && cat turtlhome | grep -oE "turtl-linux64-[0-9].[0-9].[0-9]" | uniq | grep -Eo "[0-9].[0-9].[0-9]*$" ) -if [ -n "$2" ]; then - version=$2 -fi - -echo Retrieving artifact $arch $version ... -[ -f /tmp/turtl-linux$arch-version.tar.bz2 ] || wget https://turtlapp.com/releases/desktop/turtl-linux$arch-$version.tar.bz2 - -echo Extracting tar ... -tar xvf /tmp/turtl-linux$arch-$version.tar.bz2 -C $TMP > /dev/null 2>&1 - -echo Preparing package directory ... -mkdir -p $TMP_DEB/usr/share/turtl -cp -R $TMP/turtl-linux$arch/turtl/* $TMP_DEB/usr/share/turtl - -echo Moving icon ... -mkdir -p $TMP_DEB/usr/share/pixmaps -mv $TMP_DEB/usr/share/turtl/icon.png $TMP_DEB/usr/share/pixmaps/turtl.png - -echo Fix files permisions ... -chmod 0644 $TMP_DEB/usr/share/turtl/* -chmod 0755 $TMP_DEB/usr/share/turtl/turtl $TMP_DEB/usr/share/turtl/turtl-bin $TMP_DEB/usr/share/turtl/chromedriver $TMP_DEB/usr/share/turtl/nacl* $TMP_DEB/usr/share/turtl/nwjc $TMP_DEB/usr/share/turtl/payload -chmod 0755 $TMP_DEB/usr/share/turtl/locales $TMP_DEB/usr/share/turtl/lib $TMP_DEB/usr/share/turtl/pnacl -chmod 0644 $TMP_DEB/usr/share/turtl/locales/* $TMP_DEB/usr/share/turtl/pnacl/* -chmod 0755 $TMP_DEB/usr/share/turtl/lib/* - -echo Creating menu entry ... -mkdir -p $TMP_DEB/usr/share/applications -cat > $TMP_DEB/usr/share/applications/turtl.desktop <