#!/bin/sh # Heavily based on the Slackware 13.0 SlackBuild # http://sintegrial.com.x10.bz # Packager Andrea Sciucca ( gohanz at infinito.it) # http://www.slacky.it # # Required astyle, cxxtools, enca, tidy # # REMOVE QSCINTILLA PACKAGE BEFORE COMPILATION, OTHERWISE THE COMPILATION STOP FOR A LINKING ERROR! # # # Exit on most errors #set -e CWD=`pwd` TMP=${TMP:-/tmp/txz} NAME=ste PKG=$TMP/package/$NAME VERSION=0.3.0 ARCH=${ARCH:-i486} BUILD=1as SOURCE=http://sintegrial.com.x10.bz/ste/get.php?file=ste_src if [ ! -e $NAME-$VERSION-src.zip ]; then wget -c $SOURCE fi if [ ! -d $TMP ]; then mkdir -p $TMP fi if [ ! -d $PKG ]; then mkdir -p $PKG fi if [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST=i486 elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686"; SLKLDFLAGS=""; LIBDIRSUFFIX=""; CHOST=i486 elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fPIC"; SLKLDFLAGS="-L/usr/lib64"; LIBDIRSUFFIX="64" fi cd $TMP unzip -o $CWD/$NAME-$VERSION-src.zip echo -e "\E[0;32m+-----------------------------------------+\E[0;0m" echo -e "\E[0;32m| Start SlackBuild Sintegrial Text Editor |\E[0;0m" echo -e "\E[0;32m+-----------------------------------------+\E[0;0m" cd $NAME-$VERSION-src # QScintlla system package conflict with compilation. # We remove it during compilation and restore after. removepkg QScintilla find . -perm 666 -exec chmod 644 {} \; find . -perm 664 -exec chmod 644 {} \; find . -perm 600 -exec chmod 644 {} \; find . -perm 444 -exec chmod 644 {} \; find . -perm 400 -exec chmod 644 {} \; find . -perm 440 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; chown -R root:root . # Build Qt4 Static Qscintilla local copy # Configure: (cd application/3rdparty/qscintilla/Qt4 qmake -unix PREFIX=/usr QMAKE_LIBS="$SLKLDFLAGS" QMAKE_CFLAGS="$SLKCFLAGS" QMAKE_CXXFLAGS="$SLKCFLAGS" -o Makefile Qt4.pro && make ) # Build Qt4 Sintegrial Text Editor # Configure: qmake -unix PREFIX=/usr QMAKE_LIBS="$SLKLDFLAGS" QMAKE_CFLAGS="$SLKCFLAGS" QMAKE_CXXFLAGS="$SLKCFLAGS" -o Makefile ste.pro # Build and install: LDFLAGS="$SLKLDFLAGS" \ CFLAGS="$SLKCFLAGS" \ CXXFLAGS="$SLKCFLAGS" \ make INSTALL_ROOT=$PKG make install # Restore Slackware 13.0 QScintilla package. upgradepkg --install-new $CWD/Slackware13.0-packages/* mkdir -p $PKG/usr/share/pixmaps cp -a application/images/ste.png $PKG/usr/share/pixmaps mkdir -p $PKG/usr/share/applications cat << EOF > $PKG/usr/share/applications/$NAME.desktop [Desktop Entry] Type=Application Encoding=UTF-8 Name=S.T.E GenericName=Text Editor GenericName[it]=Editor di testi Comment=Easy-to-use and feature-rich plain text editor Comment[it]=Editor di testi facile da usare e ricco di funzioni Icon=ste Exec=ste Terminal=false StartupNotify=true Categories=Qt;Application;Development; EOF mkdir -p $PKG/usr/doc/$NAME-$VERSION/SlackBuild cp -a INSTALL README $PKG/usr/doc/$NAME-$VERSION mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/SlackBuild/slack-desc cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/SlackBuild/$NAME.SlackBuild echo "if [ -x /usr/bin/update-desktop-database ]; then /usr/bin/update-desktop-database &> /dev/null fi" >> $PKG/install/doinst.sh echo "" >> $PKG/install/doinst.sh echo "if [ -x /usr/bin/gtk-update-icon-cache ]; then /usr/bin/gtk-update-icon-cache -f -q /usr/share/icons/hicolor &> /dev/null fi" >> $PKG/install/doinst.sh echo "" >> $PKG/install/doinst.sh strip --strip-unneeded $PKG/usr/bin/* cd $PKG ADD=$(ls /var/log/packages/ | sed -ne 's/\(astyle\)-\([^-]\+-[^-]\+-[^-]\+\)/\1 >= \2,/p' \ -e 's/\(tidy\)-\([^-]\+-[^-]\+-[^-]\+\)/\1 >= \2/p') \ requiredbuilder -v -y -s $CWD $PKG makepkg -l y -c n $CWD/$NAME-$VERSION-$ARCH-$BUILD.txz if [ "$1" = "--cleanup" ]; then rm -rf $TMP fi