Commit eee16c00 authored by Vitaly Lipatov's avatar Vitaly Lipatov

epm play: add spotify install

parent 1005f858
#!/bin/sh
# TODO: common place
fatal()
{
echo "FATAL: $*" >&2
exit 1
}
PKGNAME=spotify-client
if [ "$1" = "--remove" ] ; then
epm remove $PKGNAME
exit
fi
[ "$1" != "--run" ] && echo "Install Spotify client for Linux from the official site" && exit
[ "$($DISTRVENDOR -a)" != "x86_64" ] && echo "Only x86_64 is supported" && exit 1
# epm uses eget to download * names
epm install "https://repository-origin.spotify.com/pool/non-free/s/spotify-client/$(epm print constructname $PKGNAME "*" amd64 deb)"
#!/bin/sh -x
# It will be run with two args: buildroot spec
BUILDROOT="$1"
SPEC="$2"
PRODUCT=spotify
LIBDIR=/opt
mkdir -p $BUILDROOT$LIBDIR/
mv $BUILDROOT/usr/share/$PRODUCT/ $BUILDROOT$LIBDIR/$PRODUCT/
subst "s|/usr/share/$PRODUCT|$LIBDIR/$PRODUCT|g" $SPEC
subst '1iAutoProv:no' $SPEC
# see https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=spotify
mkdir -p $BUILDROOT/usr/bin/
ln -sf $LIBDIR/$PRODUCT/$PRODUCT $BUILDROOT/usr/bin/$PRODUCT
mkdir -p $BUILDROOT/usr/share/applications/
ln -sf $LIBDIR/$PRODUCT/$PRODUCT.desktop $BUILDROOT/usr/share/applications/$PRODUCT.desktop
subst "s|%files|%files\n/usr/share/applications/$PRODUCT.desktop|" $SPEC
subst "s|%files|%files\n/usr/share/icons/hicolor/*/apps/$PRODUCT.png|" $SPEC
for i in 16 22 24 32 48 64 128 256 ; do
mkdir -p $BUILDROOT/usr/share/icons/hicolor/${i}x${i}/apps/
cp $BUILDROOT/$LIBDIR/$PRODUCT/icons/spotify-linux-$i.png $BUILDROOT/usr/share/icons/hicolor/${i}x${i}/apps/$PRODUCT.png
done
REQUIRES="libcurl-gnutls"
subst "s|^\(Name: .*\)$|# Converted from original package requires\nRequires:$REQUIRES\n\1|g" $SPEC
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment