slackbuilds/UNUSED/ap/beets/SlackBuild
Gwenhael Le Moine 73d13d7d43
unuused
2020-09-07 16:52:51 +02:00

69 lines
1.6 KiB
Bash
Executable file

#!/bin/sh
# variables
TAG=gwh
TMP=/tmp/$TAG
CWD=$(pwd)
OUTPUT=/tmp
PRGNAM=$(basename $CWD)
PKG=$TMP/pkg-$PRGNAM
VERSION=$(date +%Y.%m.%d_%H.%M)
ARCH=$(uname -m)
BUILD=1
PREFIX=/usr
REPOSITORY=/home/installs/SlackBuilds/repositories/$PRGNAM
# nettoyage préalable
rm -fr $PKG $TMP/$PRGNAM
mkdir -p $PKG
# mise en place
GIT_URL="https://github.com/beetbox/beets.git"
[ ! -e $REPOSITORY ] && git clone "$GIT_URL" $REPOSITORY
( cd $REPOSITORY && git pull )
VERSION="$( cd $REPOSITORY && git log -1 --format=%h_%ad --date=format:%Y.%m.%d )"
cp -R $REPOSITORY $TMP/$PRGNAM
cd $TMP/$PRGNAM
python ./setup.py build
# installation
python ./setup.py install --root=$PKG
mkdir -p $PKG$PREFIX/share/zsh/site-functions/
cp extra/_beet $PKG$PREFIX/share/zsh/site-functions/
mkdir -p $PKG/usr/doc/$PRGNAM
cp -R LICENSE README.rst docs/ extra/ $PKG/usr/doc/$PRGNAM
# correction
cd $PKG
chown -R root:root *
# embaumement
mkdir -p $PKG/install
cat <<EOF > $PKG/install/slack-desc
$PRGNAM: $PRGNAM (music library manager and MusicBrainz tagger)
$PRGNAM:
$PRGNAM: Beets is the media library management system for obsessive-compulsive music geeks.
$PRGNAM:
$PRGNAM: The purpose of beets is to get your music collection right once and for all. It
$PRGNAM: catalogs your collection, automatically improving its metadata as it goes. It
$PRGNAM: then provides a bouquet of tools for manipulating and accessing your music.
$PRGNAM:
$PRGNAM:
$PRGNAM: http://beets.io/
$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