slackbuilds/UNUSED/xap/i3blocks-contrib/SlackBuild
2021-04-08 13:42:40 +02:00

63 lines
1.3 KiB
Bash
Executable file

#!/bin/sh
# variables
CWD=$(pwd)
PRGNAM=$(basename $(pwd))
BRANCH=
ARCH=${ARCH:-$(uname -m)}
BUILD=1
TAG=gwh
TMP=/tmp/$TAG
PKG=$TMP/pkg-$PRGNAM
OUTPUT=/tmp
REPOSITORIES=/home/installs/SlackBuilds/repositories
PREFIX=/usr
[ ! -e $REPOSITORIES/$PRGNAM ] && git clone https://github.com/vivien/i3blocks-contrib $REPOSITORIES/$PRGNAM
( cd $REPOSITORIES/$PRGNAM
git pull
)
VERSION="git_$( cd $REPOSITORIES/$PRGNAM && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
# nettoyage préalable
rm -fr $PKG
mkdir -p $PKG$PREFIX/libexec/
# installation
cp -R $REPOSITORIES/$PRGNAM $PKG$PREFIX/libexec/
cd $PKG$PREFIX/libexec/$PRGNAM/
rm .gitignore
rm -fr .git
mkdir -p $PKG$PREFIX/doc/$PRGNAM
mv *.md *.adoc config.example $PKG$PREFIX/doc/$PRGNAM
# correction
cd $PKG
chown -R root:root *
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM (Official repository for community contributed blocklets)
$PRGNAM:
$PRGNAM: This repository contains a set of scripts (a.k.a. blocklets) for i3blocks,
$PRGNAM: contributed by the community.
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM:
$PRGNAM: https://github.com/vivien/i3blocks-contrib
$PRGNAM:
EOF
# empaquetage
cd $PKG
rm -f $PKG/{,usr/}lib$(uname -m | grep -o 64)/*.la
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz