#!/bin/sh # Heavily based on the Slackware 13.0 SlackBuild # # Binary repacking SlackBuild for Eclipse (Classic) # # http://www.eclipse.org/ NAME=eclipse VERSION=3.5.2 ARCH=i586 BUILD=${BUILD:-1sm} TMP=${TMP:-/tmp/txz} PKG=$TMP/package-$NAME CWD="$(pwd)" MIRROR="http://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-linux-gtk.tar.gz&url=http://eclipse.mirror.garr.it/mirrors/eclipse//eclipse/downloads/drops/R-3.5.2-201002111343/eclipse-SDK-3.5.2-linux-gtk.tar.gz&mirror_id=1039" case $ARCH in "x86_64") SOURCE=eclipse-SDK-$VERSION-linux-gtk-x86_64.tar.gz ;; "i586") SOURCE=eclipse-SDK-$VERSION-linux-gtk.tar.gz ;; esac # download source if [ ! -e "$CWD/$SOURCE" ]; then wget -c "$MIRROR/$SOURCE" || exit 1 fi # clean necessary before compile after old run rm -rf $PKG mkdir -p $PKG rm -rf $TMP/$NAME-$VERSION # extract source cd $TMP tar -xzvf $CWD/$SOURCE # Binary directory is "eclipse" so rename it mv eclipse $NAME-$VERSION cd $NAME-$VERSION # Make sure ownerships and permissions are sane chown -R root:root . 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 {} \; # Move the binary directory to $PKG/opt mkdir -p $PKG/opt mv $TMP/$NAME-$VERSION $PKG/opt # eclipse č installato in /opt/$NAME-$VERSION per coloro che conservano pių versioni di Eclipse sul loro sistema. # Con questo link e il sucessivo in /usr/bin viene indicata la versione attiva ( cd $PKG/opt ; ln -s $NAME-$VERSION eclipse ) # Add a link to run eclipse in /usr/bin mkdir -p $PKG/usr/bin ( cd $PKG/usr/bin ; ln -s /opt/$NAME-$VERSION/eclipse eclipse ) # or wrapper: #cat << EOF_SCRIPT > "$PKG/usr/bin/eclipse" ##!/bin/sh #exec /opt/$NAME-$VERSION/eclipse "\$@" #EOF_SCRIPT chmod 755 $PKG/usr/bin/eclipse # Add an icon for eclipse mkdir -p $PKG/usr/share/pixmaps ( cd $PKG/usr/share/pixmaps ; ln -s /opt/$NAME-$VERSION/icon.xpm eclipse.xpm ) # Add eclipse to KDE/GNOME/XFCE menu mkdir -p $PKG/usr/share/applications cat $CWD/eclipse.desktop > $PKG/usr/share/applications/eclipse.desktop ( cd $PKG find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null ) mkdir -p $PKG/usr/doc/$NAME-$VERSION cd $PKG/opt/$NAME-$VERSION cp -a epl-v10.html notice.html readme/* about.html about_files/* $PKG/usr/doc/$NAME-$VERSION mkdir $PKG/usr/doc/$NAME-$VERSION/SlackBuild cat $CWD/$NAME.SlackBuild > $PK$PKG/usr/doc/$NAME-$VERSION/SlackBuild/$NAME.SlackBuild cat $CWD/slack-desc > $PKG/usr/doc/$NAME-$VERSION/SlackBuild/slack-desc cat $CWD/eclipse.desktop > $PKG/usr/doc/$NAME-$VERSION/SlackBuild/eclipse.desktop cp $CWD/doinst.sh.gz $PKG/usr/doc/$NAME-$VERSION/SlackBuild/ mkdir -p $PKG/install cat $CWD/slack-desc > $PKG/install/slack-desc zcat $CWD/doinst.sh.gz > $PKG/install/doinst.sh # build package cd $PKG chown -R root:root $PKG if [ -x "$(which requiredbuilder)" ]; then requiredbuilder -y -v -s "$CWD" $PKG fi makepkg -l y -c n "$CWD"/../$NAME-$VERSION-$ARCH-$BUILD.txz # checksum and desc (cd "$CWD"/.. md5sum $NAME-$VERSION-$ARCH-$BUILD.txz > $NAME-$VERSION-$ARCH-$BUILD.txz.md5 cat $PKG/install/slack-desc | grep "^$NAME" > $NAME-$VERSION-$ARCH-$BUILD.txt ) # optional clean if [ "$1" = "--cleanup" ]; then if [ "$TMP" != "/" ]; then rm -rf $TMP fi fi