slackbuilds/d/omnisharp-mono/SlackBuild
2018-04-20 23:02:35 +02:00

59 lines
1.4 KiB
Bash
Executable file

#!/bin/sh
# variables
TAG=cyco
TMP=/tmp/$TAG
OUTPUT=/tmp
CWD=$(pwd)
PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
VERSION=${VERSION:-$(curl -s https://api.github.com/repos/OmniSharp/omnisharp-roslyn/releases/latest | grep tag_name | grep -o "v[0-9.]*" | tr -d v)}
ARCH='mono'
BUILD=1
mkdir -p $PKG
# mise en place
[ ! -e $CWD/omnisharp-mono-${VERSION}.tar.gz ] && wget -c -O $CWD/omnisharp-mono-${VERSION}.tar.gz https://github.com/OmniSharp/omnisharp-roslyn/releases/download/v${VERSION}/omnisharp-mono.tar.gz
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM-$VERSION
cp -R $REPOSITORY $TMP/$PRGNAM-$VERSION
cd $TMP/$PRGNAM-$VERSION
# installation
mkdir -p $PKG/opt/$PRGNAM/
( cd $PKG/opt/$PRGNAM/
tar xvf $CWD/omnisharp-mono-${VERSION}.tar.gz
)
# correction
cd $PKG
chown -R root:root *
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM ( OmniSharp based on roslyn workspaces)
$PRGNAM:
$PRGNAM: OmniSharp-Roslyn is a .NET development platform based on Roslyn workspaces.
$PRGNAM: It provides project dependencies and language syntax to various IDE and
$PRGNAM: plugins.
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: https://github.com/OmniSharp/omnisharp-roslyn
$PRGNAM:
EOF
# empaquetage
cd $PKG
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz