audio/discord: Update script.

Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
This commit is contained in:
Ruan K. F 2015-01-21 18:12:40 +07:00 committed by Willy Sudiarto Raharjo
parent 7792dc57ea
commit 5b10a8ba78
2 changed files with 10 additions and 11 deletions

View File

@ -24,7 +24,7 @@
PRGNAM=discord
VERSION=${VERSION:-3.2.1}
BUILD=${BUILD:-2}
BUILD=${BUILD:-3}
TAG=${TAG:-_SBo}
DOCS="AUTHORS ChangeLog COPYING INSTALL NEWS README"
@ -34,8 +34,8 @@ DOCS="AUTHORS ChangeLog COPYING INSTALL NEWS README"
# New options:
# --auto_volume and --max_volume options to specify volume levels.
SVN=${SVN:-no}
SVN_LINK=svn://svn.code.sf.net/p/discord/code/trunk
PKGSVN=discord-svn
SVN_LINK=svn://svn.code.sf.net/p/$PRGNAM/code/trunk
PKGSVN=$PRGNAM-svn
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@ -90,7 +90,7 @@ CXXFLAGS="$SLKCFLAGS" \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--build=$ARCH-slackware-linux
make || exit 1
make
make install DESTDIR=$PKG
if [ "$SVN" = "yes" ]; then
OPT="${SLKCFLAGS} -Wall -W -s "
@ -99,30 +99,27 @@ if [ "$SVN" = "yes" ]; then
svn checkout $SVN_LINK $PKGSVN || exit 1
cd $PKGSVN
# fix version on discord.c to compile
sed -i '24s/^\(\#.*\)$/\#include\ \"version.h\"\n\1/' discord.c
sed -i 's/^\(\#.*\)$/\#include\ \"version.h\"\n\1/' discord.c
echo -e "#ifndef VERSION\n\t#define VERSION \"${VERSION}svn\"\n#endif" > version.h
gcc $OPT discord.c $LIBS -o $PKGSVN || exit 1;
install -m0755 -o 0:0 $PKGSVN $PKG/usr/bin
cd ..
fi
find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
# converter of sbagen scripts to discord scripts
mv $PKG/usr/share/$PRGNAM/convert_sbg_to_discord.py $PKG/usr/bin
chmod 755 $PKG/usr/bin/convert_sbg_to_discord.py
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

2
audio/discord/doinst.sh Normal file
View File

@ -0,0 +1,2 @@
( cd usr/share/discord ; chmod 755 convert_sbg_to_discord.py )
( cd usr/bin ; ln -sf /usr/share/discord/convert_sbg_to_discord.py convert_sbg_to_discord.py )