68 lines
1.5 KiB
Bash
Executable file
68 lines
1.5 KiB
Bash
Executable file
#!/bin/sh -x
|
|
|
|
# variables
|
|
TAG=cyco
|
|
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
|
|
makepkg -l y -c n $OUTPUT/$PRGNAM-$(echo $VERSION | sed 's/-//g')-$ARCH-$BUILD$TAG.txz
|