From 271125487ad463b1be37ace80e00130ca02206d5 Mon Sep 17 00:00:00 2001 From: Dimitris Zlatanidis Date: Sat, 30 Aug 2014 04:17:11 +0300 Subject: [PATCH] added install.sh --- CHANGELOG | 3 ++- INSTALL | 14 ++++++++----- install.sh | 41 +++++++++++++++++++++++++++++++++++++ slackbuild/slpkg.SlackBuild | 6 +++++- 4 files changed, 57 insertions(+), 7 deletions(-) create mode 100755 install.sh diff --git a/CHANGELOG b/CHANGELOG index f6b6a90d..608fff26 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,8 +1,9 @@ Version 1.7.9 -29-08-2014 +30-08-2014 [Feature] - Added extra and pasture packages from official Slackware tree. + - Added install.sh script. [Updated] - Remove destination file after copy to sbo script directory. Version 1.7.8 diff --git a/INSTALL b/INSTALL index 16f9adad..a283eb84 100644 --- a/INSTALL +++ b/INSTALL @@ -15,7 +15,11 @@ Install slpkg There are mainly four ways: -1) Using the SlackBuild script in the directory slpkg-?.?.?/slackbuild. +1) Download latest slpkg version from https://github.com/dslackw/slpkg/releases + Untar or unzip the archive, cd in slpkg-?.?.? directory. + Run install.sh in this directory `./install.sh` and slpkg auto-installed. + +2) Using the SlackBuild script in the directory slpkg-?.?.?/slackbuild. Untar the archive `tar xvf slpkg-?.?.?.tar.gz` @@ -27,16 +31,16 @@ There are mainly four ways: SlackBuild package created so install package with `upgradepkg --install-new /tmp/slpkg-?.?.?-x86_64-1_dsw.tgz` (x86_64 for Slackware64). -2) Using pip: +3) Using pip: `pip install slpkg` or upgrade `pip install --upgrade slpkg` -3) Download slpkg package from slackbuilds.org and run the first procedure described above. +4) Download slpkg package from slackbuilds.org and run the first procedure described above. -4) Download binary package from sourceforge: +5) Download binary package from sourceforge: https://sourceforge.net/projects/slpkg/ -Proposed mode if you want to have installed the most updated version is 1 and 2 +Proposed mode if you want to have installed the most updated version is 1 or 2 and 3 process. diff --git a/install.sh b/install.sh new file mode 100755 index 00000000..6b4b4a4b --- /dev/null +++ b/install.sh @@ -0,0 +1,41 @@ +#!/bin/sh + +# Copyright 2014 Dimitris Zlatanidis Greece-Orestiada +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=slpkg +VERSION=${VERSION:-1.7.8} +TAG=${TAG:-_dsw} + +cd .. +# select archive to copy in slackbuild directory +if [ -f $PRGNAM-$VERSION.zip ]; then + cp $PRGNAM-$VERSION.zip $PRGNAM-$VERSION/slackbuild + cd $PRGNAM-$VERSION/slackbuild + chmod +x $PRGNAM.SlackBuild + ./$PRGNAM.SlackBuild +else + cp $PRGNAM-$VERSION.tar.gz $PRGNAM-$VERSION/slackbuild + cd $PRGNAM-$VERSION/slackbuild + chmod +x $PRGNAM.SlackBuild + ./$PRGNAM.SlackBuild +fi +# install or upgrade with new version +upgradepkg --install-new /tmp/$PRGNAM-$VERSION-*$TAG.tgz diff --git a/slackbuild/slpkg.SlackBuild b/slackbuild/slpkg.SlackBuild index 6b129aa1..195f6198 100755 --- a/slackbuild/slpkg.SlackBuild +++ b/slackbuild/slpkg.SlackBuild @@ -60,7 +60,11 @@ rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || tar xvf $CWD/v$VERSION.tar.gz +if [ -f $CWD/$PRGNAM-$VERSION.tar.gz ]; then + tar xvf $CWD/$PRGNAM-$VERSION.tar.gz || tar xvf $CWD/v$VERSION.tar.gz +else + unzip $CWD/$PRGNAM-$VERSION.zip +fi cd $PRGNAM-$VERSION chown -R root:root . find -L . \