#!/usr/bin/bash # This script assumes it will be launched within "/NAME/VERSION/src" dir. # With all sources in "src" Your Vector Linux .tlz package, slack-desc, # and slack-required will be found in "VERSION" dir. The extraction and # build will be in a temp dir created in "NAME" dir, and then removed on exit. # Comment out last line to keep this dir intact. #Find Configuration Files #-------------------------------------------- CWD=`pwd` cd ../../../ TOP=`pwd` CONFIGURATIONS=$TOP/Configurations cd $CWD #-------------------------------------------- NAME="wxPython" #Enter Name! VERSION=2.6.4.0 #Enter Version! #SYSTEM VARIABLES #----------------------------------------------------- ARCH=`cat $CONFIGURATIONS/ARCH` BUILD=`cat $CONFIGURATIONS/BUILD` VL_PACKAGER=`cat $CONFIGURATIONS/VL_PACKAGER` CONFIG_OPTIONS=`cat $CONFIGURATIONS/CONFIG_OPTIONS` CFLAG_OPTIONS=`cat $CONFIGURATIONS/CFLAG_OPTIONS` LDFLAG_OPTIONS=`cat $CONFIGURATIONS/LDFLAG_OPTIONS` #----------------------------------------------------- CWD=`pwd` cd ../ RELEASEDIR=`pwd` cd $CWD mkdir $RELEASEDIR/tmp TMP=$RELEASEDIR/tmp PKG=$TMP/package-$NAME if [ $UID != 0 ]; then echo "You are not authorized to run this script. Please login as root" exit fi if [ ! -x /usr/bin/requiredbuilder ]; then echo "Requiredbuilder not installed, or not executable." exit fi #CFLAGS Setup #-------------------------------------------- if [ "$ARCH" = "i386" ]; then SLKCFLAGS="-O2 -march=i386 -mtune=i686" elif [ "$ARCH" = "i486" ]; then SLKCFLAGS="-O2 -march=i486 -mtune=i686" elif [ "$ARCH" = "i586" ]; then SLKCFLAGS="-O2 -march=i586 -mtune=i686" elif [ "$ARCH" = "i686" ]; then SLKCFLAGS="-O2 -march=i686 -mtune=i686" elif [ "$ARCH" = "s390" ]; then SLKCFLAGS="-O2" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2" fi export CFLAGS="$SLKCFLAGS $CFLAG_OPTIONS" export CXXFLAGS=$CFLAGS export LDFLAGS=$LDFLAG_OPTIONS #-------------------------------------------- rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf $NAME-$VERSION #Extract Sources. **Check file type!** #----------------------------------------------------- #tar xjvf $CWD/$NAME-$VERSION.tar.bz2 || exit 1 tar xjvf $CWD/wxPython-src-$VERSION.tar.bz2 || exit 1 #----------------------------------------------------- cd $TMP/$NAME-src-$VERSION echo "Setting permissions..." chown -R root:root . find . -perm 664 -exec chmod 644 {} \; find . -perm 777 -exec chmod 755 {} \; find . -perm 2777 -exec chmod 755 {} \; find . -perm 775 -exec chmod 755 {} \; find . -perm 2755 -exec chmod 755 {} \; find . -perm 774 -exec chmod 644 {} \; find . -perm 666 -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 511 -exec chmod 755 {} \; find . -perm 711 -exec chmod 755 {} \; find . -perm 555 -exec chmod 755 {} \; #CONFIGURE & MAKE #----------------------------------------------------- echo "Configuring source..." ################################# # Configure and build wxWidgets # ################################# cd $TMP/wxPython-src-$VERSION mkdir bld cd bld ../configure --prefix=/usr \ --with-gtk=2 \ --enable-monolithic \ --disable-rpath \ --enable-geometry \ --enable-optimise \ --enable-sound --with-sdl \ --enable-display \ --enable-unicode \ --enable-debug_flag \ --disable-debugreport \ make make -C contrib/src/animate make -C contrib/src/gizmos make -C contrib/src/stc ################## # Build wxPython # ################## cd $TMP/wxPython-src-$VERSION/wxPython python setup.py \ WXPORT=gtk2 \ UNICODE=1 \ EP_ADD_OPTS=1 \ WX_CONFIG="$TMP/wxPython-src-$VERSION/bld/wx-config --no_rpath" \ build_ext --rpath=/usr/lib \ build ############################## # Install wxGTK and contribs # ############################## cd $TMP/wxPython-src-$VERSION/bld make prefix=$PKG/usr install make -C contrib/src/animate prefix=$PKG/usr install make -C contrib/src/gizmos prefix=$PKG/usr install make -C contrib/src/stc prefix=$PKG/usr install ############################## # Install wxPython for wxGTK # ############################## cd $TMP/wxPython-src-$VERSION/wxPython python setup.py \ WXPORT=gtk2 \ UNICODE=1 \ EP_ADD_OPTS=1 \ WX_CONFIG="$PKG/usr/bin/wx-config --prefix=$PKG/usr --no_rpath" \ build_ext --rpath=/usr/lib \ install --root=$PKG # Menu items for file in distrib/*.desktop; do install -m 644 $file $PKG/usr/share/applications done # Icons install -m 644 wx/py/PyCrust_32.png $PKG/usr/share/pixmaps/PyCrust.png install -m 644 wx/tools/XRCed/XRCed_32.png $PKG/usr/share/pixmaps/XRCed.png # Docs mkdir -p $PKG/usr/doc/wxpython-$VERSION cp -a $TMP/wxPython-src-$VERSION/docs/* $PKG/usr/doc/wxpython-$VERSION # Fix a broken symlink: ( cd $PKG/usr/bin rm -rf wx-config ln -sf ../lib/wx/config/gtk2-unicode-debug-2.6 wx-config ) cd $TMP/wxPython-src-$VERSION/wxPython sed "s/BUILD_GLCANVAS = 1/BUILD_GLCANVAS = 0/" -i config.py ./setup.py build WXPORT=gtk2 \ UNICODE=1 \ BUILD_GLCANVAS=0 \ WX_CONFIG="$PKG/usr/bin/wx-config --prefix=$PKG/usr --no_rpath" \ ./setup.py install WXPORT=gtk2 \ UNICODE=1 \ BUILD_GLCANVAS=0 \ WX_CONFIG="$PKG/usr/bin/wx-config --prefix=$PKG/usr --no_rpath" \ install --root="$PKG" #----------------------------------------------------- mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a AUTHORS COPYING ChangeLog README TODO $PKG/usr/doc/$NAME-$VERSION cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild find $PKG/usr/man -type f -exec gzip -9 {} \; mkdir -p $PKG/install # This creates the white space in front of "handy-ruler" in slack-desc below. LENGTH=`expr length "$NAME"` SPACES=0 SHIM="" until [ "$SPACES" = "$LENGTH" ]; do SHIM="$SHIM " let SPACES=$SPACES+1 done cat > $RELEASEDIR/slack-desc << EOF # HOW TO EDIT THIS FILE: # The "handy ruler" below makes it easier to edit a package description. Line # up the first '|' above the ':' following the base package name, and the '|' # on the right side marks the last column you can put a character in. You must # make exactly 11 lines for the formatting to be correct. It's also # customary to leave one space after the ':'. |-----handy-ruler------------------------------------------------------| $NAME: $NAME $NAME: $NAME: wxpython: wxPython is a GUI toolkit for the Python programming language. It $NAME: allows Python programmers to create programs with a robust, highly $NAME: functional graphical user interface, simply and easily. It is $NAME: implemented as a Python extension module (native code) that wraps $NAME: the popular wxWidgets cross platform GUI library, which is written $NAME: in C++. $NAME: $NAME: License: GPL $NAME: Website: www.wxwidgets/org $NAME: Authors: Many, see site $NAME: #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS LDFLAGS: $LDFLAGS CONFIGURE: `awk "/\.\/configure\ /" $TMP/$NAME-$VERSION/config.log` EOF cat $RELEASEDIR/slack-desc > $PKG/install/slack-desc cd $PKG echo " " echo "Stripping...." echo " " 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 echo "Finding dependancies..." requiredbuilder -v -y -s $RELEASEDIR $PKG #Finish package #-------------------------------------------------------------- echo "Creating package $NAME-$VERSION-$ARCH-$BUILD.tlz" makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.tlz cd $CWD echo "Cleaning up temp files..." rm -rf $TMP echo "Package Complete" #--------------------------------------------------------------