From ba537ed547a0c105aac7a7d13f0c23c493a24281 Mon Sep 17 00:00:00 2001 From: fsLeg Date: Sat, 12 Feb 2022 21:13:57 +0300 Subject: [PATCH] shadowsocks-rust: added --- shadowsocks-rust/README | 3 + shadowsocks-rust/shadowsocks-rust.SlackBuild | 103 +++++++++++++++++++ shadowsocks-rust/shadowsocks-rust.info | 10 ++ shadowsocks-rust/slack-desc | 12 +++ 4 files changed, 128 insertions(+) create mode 100644 shadowsocks-rust/README create mode 100755 shadowsocks-rust/shadowsocks-rust.SlackBuild create mode 100644 shadowsocks-rust/shadowsocks-rust.info create mode 100644 shadowsocks-rust/slack-desc diff --git a/shadowsocks-rust/README b/shadowsocks-rust/README new file mode 100644 index 0000000..f445a4e --- /dev/null +++ b/shadowsocks-rust/README @@ -0,0 +1,3 @@ +A Rust port of shadowsocks that superceded shadowsocks-libev. + +Shadowsocks is a fast tunnel proxy that helps you bypass firewalls. \ No newline at end of file diff --git a/shadowsocks-rust/shadowsocks-rust.SlackBuild b/shadowsocks-rust/shadowsocks-rust.SlackBuild new file mode 100755 index 0000000..4dcd17d --- /dev/null +++ b/shadowsocks-rust/shadowsocks-rust.SlackBuild @@ -0,0 +1,103 @@ +#!/bin/sh + +# Slackware build script for shadowsocks-rust + +# Copyright 2022 Vladislav Borisov, Moscow, Russia +# 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=shadowsocks-rust +VERSION=${VERSION:-1.13.1} +BUILD=${BUILD:-1} +TAG=${TAG:-fsleg} + +# Automatically determine the architecture we're building on: +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + CARGOTARGET="--target i586-unknown-linux-gnu" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + CARGOTARGET="--target i686-unknown-linux-gnu" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + CARGOTARGET="--target x86_64-unknown-linux-gnu" +else + SLKCFLAGS="-O2" + CARGOTARGET="" +fi + +set -e # Exit on most errors + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION + +# Check whether content-disposition was used to download the sources +if [ -f $CWD/$PRGNAM-$VERSION.tar.gz ]; then + tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +elif [ -f $CWD/v$VERSION.tar.gz ]; then + tar xvf $CWD/v$VERSION.tar.gz +fi + +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 {} \; + +# Compile the binaries; internet access is required +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +RUSTFLAGS="-C target-cpu=native" \ +CARGO_HOME="$TMP/$PRGNAM-$VERSION" \ +cargo build --release +make install DESTDIR=$PKG TARGET=release PREFIX=/usr/bin + +# Strip binaries and libraries +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 + +# Copy available documentation +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -aR \ + LICENSE README.md examples/ \ + $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-txz} diff --git a/shadowsocks-rust/shadowsocks-rust.info b/shadowsocks-rust/shadowsocks-rust.info new file mode 100644 index 0000000..74f0ac8 --- /dev/null +++ b/shadowsocks-rust/shadowsocks-rust.info @@ -0,0 +1,10 @@ +PRGNAM="shadowsocks-rust" +VERSION="1.13.1" +HOMEPAGE="https://github.com/shadowsocks/shadowsocks-rust" +DOWNLOAD="https://github.com/shadowsocks/shadowsocks-rust/archive/refs/tags/v${VERSION}.tar.gz" +MD5SUM="16dd4c65ac1495e08dd0b7338ea13315" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Vladislav Borisov" +EMAIL="fsleg@t-rg.ws" diff --git a/shadowsocks-rust/slack-desc b/shadowsocks-rust/slack-desc new file mode 100644 index 0000000..fe14fd9 --- /dev/null +++ b/shadowsocks-rust/slack-desc @@ -0,0 +1,12 @@ + |-----handy-ruler------------------------------------------------------| +shadowsocks-rust: shadowsocks-rust (rust port of shadowsocks, a secure socks5 proxy) +shadowsocks-rust: +shadowsocks-rust: Rust port of shadowsocks. +shadowsocks-rust: +shadowsocks-rust: Shadowsocks is a fast tunnel proxy that helps you bypass firewalls. +shadowsocks-rust: +shadowsocks-rust: Homepage: https://github.com/shadowsocks/shadowsocks-rust +shadowsocks-rust: +shadowsocks-rust: +shadowsocks-rust: +shadowsocks-rust: \ No newline at end of file -- 2.46.3