#!/usr/bin/bash # This SlackBuild like script is designed for Vector Linux packages by exeterdad. # 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. SHIM="# " # Add enough spaces between quotes to match quotes around name on next line NAME="kompozer" VERSION=0.7.10 ARCH=i586 BUILD=2vl59 VL_PACKAGER=exeterdad CWD=`pwd` cd ../ RELEASEDIR=`pwd` cd $CWD mkdir $RELEASEDIR/tmp TMP=$RELEASEDIR/tmp PKG=$TMP/package-$NAME if [ $UID != 0 ]; then echo "You need to be root to run this script." exit fi if [ ! -x /usr/bin/requiredbuilder ]; then echo "Requiredbuilder not installed, or not executable." exit fi export CFLAGS="-O2 -march=i586 -mtune=i686" export CXXFLAGS="-O2 -march=i586 -mtune=i686" rm -rf $PKG mkdir -p $PKG cd $TMP tar xjvf $CWD/$NAME-$VERSION-src.tar.bz2 || exit 1 cd $TMP/mozilla cp $CWD/mozconfig $TMP/mozilla/.mozconfig 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 {} \; echo "Here we go!" make -f client.mk build_all || exit 1 make -C xpinstall/packager STRIP=/bin/true PKG_BASENAME="$NAME-$VERSION" || exit 1 mkdir -p $PKG/usr/lib cd $PKG/usr/lib echo "Moving files to package directory..." tar -zxf $TMP/mozilla/dist/$NAME-$VERSION.tar.gz mv $PKG/usr/lib/$NAME $PKG/usr/lib/$NAME-$VERSION mkdir $PKG/usr/bin ln -sf ../lib/$NAME-$VERSION/$NAME $PKG/usr/bin/$NAME ln -sf $NAME-$VERSION $PKG/usr/lib/$NAME # Install icons: mkdir -p $PKG/usr/share/{applications,pixmaps} cat >> $PKG/usr/share/applications/kompozer.desktop << EOF [Desktop Entry] Version=1.0 Encoding=UTF-8 Name=Kompozer GenericName=Web Authoring System Comment=Create a Web Site Exec=kompozer Icon=kompozer.xpm Terminal=false Type=Application X-Desktop-File-Install-Version=0.9 Categories=Application;Development; EOF chmod 644 $PKG/usr/share/applications/* install -m644 $PKG/usr/lib/$NAME-$VERSION/chrome/icons/default/default.xpm $PKG/usr/share/pixmaps/$NAME.xpm # Create the extensions files so that the non-root users don't get # a warning when they start kompozer: ( cd $PKG/usr/lib/$NAME-$VERSION export LD_LIBRARY_PATH="$PWD" export MOZILLA_FIVE_HOME="$PWD" ./regxpcom ./regchrome touch `find . -name *.rdf` ./$NAME -register ) # These files/directories are usually created if kompozer is run as root, which on many # systems might (and possibly should) be never. Therefore, if we don't see them we'll # put stubs in place to prevent startup errors. # This shouldn't be necessary since we do the register thing above, but I'll leave it # in just incase. ( cd $PKG/usr/lib/$NAME-$VERSION if [ -d chrome ]; then if [ ! -r chrome/app-chrome.manifest ]; then echo > chrome/app-chrome.manifest fi fi if [ ! -d updates ]; then mkdir -pm755 updates/0 fi ) mkdir -p $PKG/install 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 ':'. $SHIM|-----handy-ruler------------------------------------------------------| $NAME: kompozer (Html editor) $NAME: $NAME: Unofficial bugfix release for NVU. It's a complete Web Authoring $NAME: System that combines web file management and easy to use WYSIWYG $NAME: (What You See Is What You Get) web page editing. Kompozer is designed $NAME: to be extremely easy to use, making it ideal for non-technical $NAME: computer users who want to create an attractive, professional-looking $NAME: web site without needing to know HTML or web coding. $NAME: License: MPL 1.1/GPL 2.0/LGPL 2.1 $NAME: Author: Original author- Mozilla, now by Kazé $NAME: Website: http://www.kompozer.net/ #---------------------------------------- BUILDDATE: `date` PACKAGER: $VL_PACKAGER HOST: `uname -srm` DISTRO: `cat /etc/vector-version` CFLAGS: $CFLAGS CONFIGURE: N/A See mozconfig 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 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 "Done"