2010-05-13 00:57:27 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# Slackware build script for <kid3>
|
|
|
|
# Written by Michales Michaloudes korgie@gmail.com
|
|
|
|
|
|
|
|
PRGNAM=kid3
|
2016-08-27 00:01:57 +02:00
|
|
|
VERSION=${VERSION:-3.4.2}
|
2010-05-13 00:57:27 +02:00
|
|
|
BUILD=${BUILD:-1}
|
|
|
|
TAG=${TAG:-_SBo}
|
|
|
|
|
|
|
|
MP4TAG=${MP4TAG:-yes}
|
2010-06-04 07:00:07 +02:00
|
|
|
if [ -z "$ARCH" ]; then
|
|
|
|
case "$( uname -m )" in
|
2016-08-27 00:01:57 +02:00
|
|
|
i?86) ARCH=i586 ;;
|
2010-06-04 07:00:07 +02:00
|
|
|
arm*) ARCH=arm ;;
|
|
|
|
*) ARCH=$( uname -m ) ;;
|
|
|
|
esac
|
|
|
|
fi
|
|
|
|
|
2010-05-13 00:57:27 +02:00
|
|
|
CWD=$(pwd)
|
2013-11-22 08:34:22 +01:00
|
|
|
TMP=${TMP:-/tmp/SBo}
|
2010-05-13 00:57:27 +02:00
|
|
|
PKG=$TMP/package-$PRGNAM
|
|
|
|
OUTPUT=${OUTPUT:-/tmp}
|
|
|
|
|
2016-08-27 00:01:57 +02:00
|
|
|
if [ "$ARCH" = "i586" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i586 -mtune=i686"
|
2010-05-13 00:57:27 +02:00
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "i686" ]; then
|
|
|
|
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
|
|
|
|
LIBDIRSUFFIX=""
|
|
|
|
elif [ "$ARCH" = "x86_64" ]; then
|
|
|
|
SLKCFLAGS="-O2 -fPIC"
|
|
|
|
LIBDIRSUFFIX="64"
|
2010-06-04 07:00:07 +02:00
|
|
|
else
|
|
|
|
SLKCFLAGS="-O2"
|
|
|
|
LIBDIRSUFFIX=""
|
2010-05-13 00:57:27 +02:00
|
|
|
fi
|
|
|
|
|
2012-09-19 07:14:41 +02:00
|
|
|
# Autodetection of kde4
|
|
|
|
if [ -f /usr/bin/kde4 ]; then
|
2014-11-04 14:30:57 +01:00
|
|
|
KDE4=";KDE"
|
2012-09-19 07:14:41 +02:00
|
|
|
else
|
2014-11-04 14:30:57 +01:00
|
|
|
KDE4=""
|
2012-09-19 07:14:41 +02:00
|
|
|
fi
|
|
|
|
|
|
|
|
# Autodetection of libmp4v2
|
|
|
|
if [ -h /usr/lib$LIBDIRSUFFIX/libmp4v2.so ]; then
|
|
|
|
MP4TAG="ON"
|
|
|
|
else
|
|
|
|
MP4TAG="OFF"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# Autodetection of chromaprint
|
|
|
|
if pkg-config --exists libchromaprint ; then
|
|
|
|
CHROMA="ON"
|
|
|
|
else
|
|
|
|
CHROMA="OFF"
|
|
|
|
fi
|
|
|
|
|
2014-11-04 14:30:57 +01:00
|
|
|
# Autodetection of phonon
|
|
|
|
if pkg-config --exists phonon ; then
|
|
|
|
PHONON="ON"
|
|
|
|
else
|
|
|
|
PHONON="OFF"
|
|
|
|
fi
|
|
|
|
|
2010-05-13 00:57:27 +02:00
|
|
|
set -e
|
|
|
|
|
|
|
|
rm -rf $PKG
|
|
|
|
mkdir -p $TMP $PKG $OUTPUT
|
|
|
|
cd $TMP
|
|
|
|
rm -rf $PRGNAM-$VERSION
|
2012-09-19 07:14:41 +02:00
|
|
|
tar xvf $CWD/$PRGNAM-$VERSION.tar.?z*
|
2010-05-13 00:57:27 +02:00
|
|
|
cd $PRGNAM-$VERSION
|
|
|
|
chown -R root:root .
|
2013-11-22 08:37:19 +01:00
|
|
|
find -L . \
|
2016-08-27 00:01:57 +02:00
|
|
|
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
|
|
|
|
-o -perm 511 \) -exec chmod 755 {} \; -o \
|
|
|
|
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
|
|
|
|
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
|
|
|
|
|
|
|
|
mkdir -p build
|
|
|
|
cd build
|
|
|
|
cmake \
|
2010-05-13 00:57:27 +02:00
|
|
|
-DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
|
|
|
|
-DCMAKE_INSTALL_PREFIX=/usr \
|
|
|
|
-DLIB_SUFFIX:STRING=${LIBDIRSUFFIX} \
|
|
|
|
-DLIB_INSTALL_DIR=/usr/lib${LIBDIRSUFFIX} \
|
2011-12-18 03:54:27 +01:00
|
|
|
-DMAN_INSTALL_DIR=/usr/man \
|
|
|
|
-DSYSCONF_INSTALL_DIR=/etc \
|
|
|
|
-DINCLUDE_INSTALL_DIR=/usr/include \
|
2012-09-19 07:14:41 +02:00
|
|
|
-DWITH_CHROMAPRINT="$CHROMA" \
|
|
|
|
-DWITH_MP4V2="$MP4TAG" \
|
2014-11-04 14:30:57 +01:00
|
|
|
-DWITH_APPS="Qt;CLI$KDE4" \
|
|
|
|
-DWITH_PHONON="$PHONON" \
|
2016-08-27 00:01:57 +02:00
|
|
|
-DWITH_DOCDIR="doc/$PRGNAM-$VERSION" \
|
|
|
|
-DBUILD_SHARED_LIBS:BOOL=ON \
|
|
|
|
-DCMAKE_BUILD_TYPE=Release ..
|
|
|
|
make
|
|
|
|
make install DESTDIR=$PKG
|
|
|
|
cd ..
|
2010-05-13 00:57:27 +02:00
|
|
|
|
2011-12-18 03:54:27 +01:00
|
|
|
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
|
2010-05-13 00:57:27 +02:00
|
|
|
|
|
|
|
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION/
|
|
|
|
cp -a \
|
|
|
|
AUTHORS COPYING ChangeLog INSTALL LICENSE NEWS README \
|
|
|
|
$PKG/usr/doc/$PRGNAM-$VERSION
|
|
|
|
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
|
|
|
|
|
2014-11-04 14:30:57 +01:00
|
|
|
if [ -d $PKG/usr/share/man ]; then
|
2016-08-27 00:01:57 +02:00
|
|
|
mv $PKG/usr/share/man $PKG/usr/
|
2014-11-04 14:30:57 +01:00
|
|
|
fi
|
|
|
|
|
2010-05-13 00:57:27 +02:00
|
|
|
mkdir -p $PKG/install
|
|
|
|
cat $CWD/slack-desc > $PKG/install/slack-desc
|
|
|
|
cat $CWD/doinst.sh > $PKG/install/doinst.sh
|
|
|
|
|
|
|
|
cd $PKG
|
|
|
|
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
|