#!/bin/bash set -e MYNAME=$1 CWD=$(pwd) TMP=${TMP:-/tmp} PKG=$TMP/package-$1 # Set the config option variables if they are not already set: if [ -r ../KDE.options ]; then . ../KDE.options fi # The global options may be overridden here (if needed): if [ -r ./local.options ]; then . ./local.options fi # Avoid a version number in .la files: if [ -d /usr/lib${LIBDIRSUFFIX}/qt ]; then QTDIR=/usr/lib${LIBDIRSUFFIX}/qt fi rm -rf /tmp/$1-4.* rm -rf $PKG mkdir -p $PKG/usr cd $TMP VERSION="$(ls -1 "$CWD/src/$1-"*.tar.* | sed -r "s:.*/::" | cut -d "-" -f 2 | sed -r "s:[.]tar[.].*::")" echo "Building $1-$VERSION..." tar xvf $CWD/src/$1-$VERSION.tar.?z* || exit 1 cd $1-$VERSION cat CMakeLists.txt \ | fgrep -v 'add_subdirectory( doc )' \ | fgrep -v "add_subdirectory(doc)" \ | fgrep -v "KdepimLibs" \ | fgrep -v "macro_optional_add_subdirectory(kopete)" \ | fgrep -v "macro_optional_add_subdirectory(kget)" \ | fgrep -v "add_subdirectory (doc)" \ | fgrep -v "macro_optional_add_subdirectory(klinkstatus)" \ | fgrep -v "macro_optional_add_subdirectory(kfilereplace)" \ | fgrep -v "macro_optional_add_subdirectory(kimagemapeditor)" \ | fgrep -v "macro_optional_add_subdirectory(doc)" \ | fgrep -v "add_subdirectory( po )" >aaa mv -f aaa CMakeLists.txt cat CMakeLists.txt \ | fgrep -v 'add_subdirectory(libkmahjongg)' \ | fgrep -v 'macro_optional_add_subdirectory(bomber)' \ | fgrep -v 'macro_optional_add_subdirectory(granatier)' \ | fgrep -v 'macro_optional_add_subdirectory(lskat)' \ | fgrep -v 'macro_optional_add_subdirectory(kapman)' \ | fgrep -v 'macro_optional_add_subdirectory(katomic)' \ | fgrep -v 'macro_optional_add_subdirectory(knavalbattle)' \ | fgrep -v 'macro_optional_add_subdirectory(kblackbox)' \ | fgrep -v 'macro_optional_add_subdirectory(kblocks)' \ | fgrep -v 'macro_optional_add_subdirectory(kdiamond)' \ | fgrep -v 'macro_optional_add_subdirectory(kgoldrunner)' \ | fgrep -v 'macro_optional_add_subdirectory(kigo)' \ | fgrep -v 'macro_optional_add_subdirectory(kiriki)' \ | fgrep -v 'macro_optional_add_subdirectory(kjumpingcube)' \ | fgrep -v 'macro_optional_add_subdirectory(kfourinline)' \ | fgrep -v 'macro_optional_add_subdirectory(killbots)' \ | fgrep -v 'macro_optional_add_subdirectory(knetwalk)' \ | fgrep -v 'macro_optional_add_subdirectory(kreversi)' \ | fgrep -v 'macro_optional_add_subdirectory(kbreakout)' \ | fgrep -v 'macro_optional_add_subdirectory(klickety)' \ | fgrep -v 'macro_optional_add_subdirectory(klines)' \ | fgrep -v 'macro_optional_add_subdirectory(kmahjongg)' \ | fgrep -v 'macro_optional_add_subdirectory(kolf)' \ | fgrep -v 'macro_optional_add_subdirectory(kollision)' \ | fgrep -v 'macro_optional_add_subdirectory(konquest)' \ | fgrep -v 'macro_optional_add_subdirectory(kshisen)' \ | fgrep -v 'macro_optional_add_subdirectory(ksirk)' \ | fgrep -v 'macro_optional_add_subdirectory(kspaceduel)' \ | fgrep -v 'macro_optional_add_subdirectory(ksquares)' \ | fgrep -v 'macro_optional_add_subdirectory(ktuberling)' \ | fgrep -v 'macro_optional_add_subdirectory(ksnakeduel)' \ | fgrep -v 'macro_optional_add_subdirectory(kubrick)' \ | fgrep -v 'macro_optional_add_subdirectory(palapeli)' \ | fgrep -v 'macro_optional_add_subdirectory(kajongg)' > aaa mv -f aaa CMakeLists.txt find | grep CMakeLists.txt | while read LINE; do cat $LINE | fgrep -v "add_subdirectory( doc )" \ | fgrep -v "add_subdirectory(doc)" \ | fgrep -v "add_subdirectory (doc)" \ | fgrep -v "add_subdirectory ( doc )" >aaa mv aaa $LINE done sed -i "s/GWENVIEW_SEMANTICINFO_BACKEND \"Nepomuk\"/GWENVIEW_SEMANTICINFO_BACKEND \"None\"/" CMakeLists.txt mkdir -p build cd build cmake \ $KDE_OPT_ARGS \ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_INSTALL_PREFIX=/usr \ -DMAN_INSTALL_DIR=/usr/man \ -DSYSCONF_INSTALL_DIR=/etc/kde \ -DLIB_SUFFIX=${LIBDIRSUFFIX} \ -DKDE_DISTRIBUTION_TEXT="tomas@slax.org" \ .. make $NUMJOBS || make || exit 1 make install DESTDIR=$PKG || exit 1 cd - ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true ) if [ -d $PKG/usr/share/apps/$1/icons/hicolor ]; then if [ -d $PKG/usr/share/apps/$1/icons/oxygen ]; then cp -a $PKG/usr/share/apps/$1/icons/oxygen/* $PKG/usr/share/apps/$1/icons/hicolor/ rm -Rf $PKG/usr/share/apps/$1/icons/oxygen fi mv $PKG/usr/share/apps/$1/icons/hicolor $PKG/usr/share/apps/$1/icons/oxygen fi if [ -d $PKG/usr/share/icons/hicolor ]; then if [ -d $PKG/usr/share/icons/oxygen ]; then cp -a $PKG/usr/share/icons/oxygen/* $PKG/usr/share/icons/hicolor rm -Rf $PKG/usr/share/icons/oxygen fi mv $PKG/usr/share/icons/hicolor $PKG/usr/share/icons/oxygen fi cd $PKG /sbin/makepkg -l y -c n $TMP/$1-$VERSION-$ARCH-$BUILD.txz installpkg $TMP/$1-$VERSION-$ARCH-$BUILD.txz cd .. rm -Rf $1-$VERSION rm -Rf package-$1