diff options
author | Giuseppe Di Terlizzi <giuseppe.diterlizzi@gmail.com> | 2017-07-11 20:59:48 +0700 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-07-12 22:47:52 +0700 |
commit | b88d2f57f08ea61104dfcf05ef6456031b2d41ef (patch) | |
tree | 11dcb1bc6179e843fd367f7e965a358e8fe4cd07 /development/shc | |
parent | df40e05546f5f72c73c812dbb27c330bf651661f (diff) | |
download | slackbuilds-b88d2f57f08ea61104dfcf05ef6456031b2d41ef.tar.gz |
development/shc: Updated for version 3.9.6, new maintainer.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'development/shc')
-rw-r--r-- | development/shc/README | 19 | ||||
-rw-r--r-- | development/shc/shc.SlackBuild | 70 | ||||
-rw-r--r-- | development/shc/shc.info | 12 | ||||
-rw-r--r-- | development/shc/slack-desc | 12 |
4 files changed, 70 insertions, 43 deletions
diff --git a/development/shc/README b/development/shc/README index ab1e45923f..be04109cc4 100644 --- a/development/shc/README +++ b/development/shc/README @@ -1,8 +1,15 @@ -SHC takes a script, which is specified on the command line and -produces C source code. The generated source code is then compiled -and linked to produce a stripped binary executable. +shc - Shell script compiler -Use with care. +SHC is a generic shell script compiler. It takes a script, which is specified on +the command line and produces C source code. The generated source code is then +compiled and linked to produce a stripped binary. -After installation, try it with - shc -v -r -T -f myscript +The compiled binary will still be dependent on the shell specified in the first +line of the shell code (i.e shebang: #!/bin/sh or such), thus shc does not +create completely independent binaries. + +shc itself is not a compiler such as cc, it rather encodes and encrypts a shell +script and generates C source code with the added expiration capability. It then +uses the system compiler to compile a stripped binary which behaves exactly like +the original script. Upon execution, the compiled binary will decrypt and +execute the code with the shells' -c option. diff --git a/development/shc/shc.SlackBuild b/development/shc/shc.SlackBuild index f62701a492..d3d52deceb 100644 --- a/development/shc/shc.SlackBuild +++ b/development/shc/shc.SlackBuild @@ -1,10 +1,30 @@ #!/bin/sh -# Slackware build script for shc script compiler -# Updated for Slackware by Roberto Metere <roberto <at> metere <dot> it> +# Slackware build script for shc + +# Previously maintained by Roberto Metere <roberto <at> metere <dot> it> +# Copyright 2017 Giuseppe Di Terlizzi <giuseppe.diterlizzi@gmail.com> +# 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=shc -VERSION=${VERSION:-3.8.7} +VERSION=${VERSION:-3.9.6} BUILD=${BUILD:-1} TAG=${TAG:-_SBo} @@ -24,10 +44,10 @@ OUTPUT=${OUTPUT:-/tmp} if [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" LIBDIRSUFFIX="" - elif [ "$ARCH" = "i686" ]; then +elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" LIBDIRSUFFIX="" - elif [ "$ARCH" = "x86_64" ]; then +elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC" LIBDIRSUFFIX="64" else @@ -41,37 +61,37 @@ rm -rf $PKG mkdir -p $TMP $PKG $OUTPUT cd $TMP rm -rf $PRGNAM-$VERSION -tar xvf $CWD/$PRGNAM-$VERSION.t* +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz cd $PRGNAM-$VERSION chown -R root:root . find -L . \ \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ -o -perm 511 \) -exec chmod 755 {} \; -o \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ - -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; - -# patch Makefile to respect CFLAGS -sed -i "s/CFLAGS =/CFLAGS +=/" Makefile - -make CFLAGS="$SLKCFLAGS" - -# avoid make install errors -mkdir -p $PKG/usr/bin -mkdir -p $PKG/usr/man/man1 -echo yes > yes - -make \ - INSTALL_PATH="$PKG/usr" \ - install < yes - -find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --docdir=/usr/doc/$PRGNAM-$VERSION \ + --build=$ARCH-slackware-linux + +make +make install DESTDIR=$PKG + +find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \ | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true find $PKG/usr/man -type f -exec gzip -9 {} \; for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done -mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/ -cp -a shc.README CHANGES Copying shc.html $PKG/usr/doc/$PRGNAM-$VERSION +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README README.md AUTHORS COPYING ChangeLog $PKG/usr/doc/$PRGNAM-$VERSION cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild mkdir -p $PKG/install diff --git a/development/shc/shc.info b/development/shc/shc.info index 5e49c69e02..5af3ba09dd 100644 --- a/development/shc/shc.info +++ b/development/shc/shc.info @@ -1,10 +1,10 @@ PRGNAM="shc" -VERSION="3.8.7" -HOMEPAGE="http://www.datsi.fi.upm.es/~frosal/" -DOWNLOAD="http://www.datsi.fi.upm.es/~frosal/sources/shc-3.8.7.tgz" -MD5SUM="6057436b4f00b2e0dbf5d364263d822e" +VERSION="3.9.6" +HOMEPAGE="http://neurobin.github.io/shc" +DOWNLOAD="https://github.com/neurobin/shc/archive/3.9.6/shc-3.9.6.tar.gz" +MD5SUM="da777637594be58caf33509d2ca0fbea" DOWNLOAD_x86_64="" MD5SUM_x86_64="" REQUIRES="" -MAINTAINER="Roberto Metere" -EMAIL="roberto@metere.it" +MAINTAINER="Giuseppe Di Terlizzi" +EMAIL="giuseppe.diterlizzi@gmail.com" diff --git a/development/shc/slack-desc b/development/shc/slack-desc index c791ee4eeb..8b895eed4f 100644 --- a/development/shc/slack-desc +++ b/development/shc/slack-desc @@ -6,14 +6,14 @@ # customary to leave one space after the ':' except on otherwise blank lines. |-----handy-ruler------------------------------------------------------| -shc: shc (generic SHell script Compiler) -shc: -shc: shc creates a stripped binary executable version of the -shc: script specified with -f on the command line. -shc: -shc: Homepage: http://www.datsi.fi.upm.es/~frosal/ +shc: shc (Shell script compiler) shc: +shc: SHC is a generic shell script compiler. It takes a script, which is +shc: specified on the command line and produces C source code. +shc: The generated source code is then compiled and linked to produce +shc: a stripped binary. shc: shc: shc: +shc: Home Page: http://neurobin.github.io/shc shc: |