#!/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 second to last line to keep this dir intact. # # This Template was compiled from the contributions of many users of the Vector # Linux forum at http://forum.vectorlinux.com and from tidbits collected # from all over the internet. # # Generated by sbbuilder-0.4.12, written by Rodrigo Bistolfi # (rbistolfi) and Raimon Grau Cuscó (Kidd) for VectorLinux. # # Please put your name below if you add some original scripting lines. # AUTHORS = JohnB316; incognu NAME="seamonkey" #Enter package Name! VERSION=${VERSION:-"1.1.15"} #Enter package Version! VER=$(echo $VERSION|sed 's/-/_/') #this fixes - in version VL_PACKAGER=${VL_PACKAGER:-"incognu"} #Enter your Name! LINK=${LINK:-"ftp://ftp.mozilla.org/pub/mozilla.org/seamonkey/releases/1.1.15/seamonkey-1.1.15.source.tar.bz2"} #Enter URL for package here! #SYSTEM VARIABLES #---------------------------------------------------------------------------- BUILDNUM=${BUILDNUM:-"1"} VL_VERSION=${VL_VERSION:-"$(ls /var/log/packages/|grep vlconfig2|cut -d "-" -f4|cut -c 2-5)"} BUILD=${BUILD:-"$BUILDNUM""$VL_VERSION"} ARCH=${ARCH:-"$(uname -m)"} CONFIG_OPTIONS=${CONFIG_OPTIONS:-""} LDFLAG_OPTIONS=${LDFLAG_OPTIONS:-""} ADDRB=${ADDRB:-""} #Add deps that need to be added to the slack-required file here EXRB=${EXRB:-""} #Add deps that need to be excluded from the slack-required file here #---------------------------------------------------------------------------- #SETUP PACKAGING ENVIRONMENT #-------------------------------------------- CWD=$(pwd) cd ../ RELEASEDIR=$(pwd) cd $CWD mkdir -p $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 1 fi if [ ! -x /usr/bin/requiredbuilder ]; then echo "Requiredbuilder not installed, or not executable." exit 1 fi if [ $VL_PACKAGER = "YOURNAME" ]; then echo 'Who are you? Please edit VL_PACKAGER=${VL_PACKAGER:-YOURNAME} in this script. Change the word "YOURNAME" to your VectorLinux packager name. You may also export VL_PACKAGER, or call this script with VL_PACKAGER="YOUR NAME HERE"' exit 1 fi #CFLAGS SETUP #-------------------------------------------- if [[ "$ARCH" = i?86 ]]; then ARCH=i586 SLKCFLAGS="-O2 -march=i586 -mtune=i686" CONFIGURE_TRIPLET="i486-slackware-linux" elif [ "$ARCH" = "x86_64" ]; then SLKCFLAGS="-O2 -fpic" CONFIGURE_TRIPLET="x86_64-vlocity-linux" elif [ "$ARCH" = "powerpc" ]; then SLKCFLAGS="-O2" CONFIGURE_TRIPLET="powerpc-vlocity-linux" fi export CFLAGS="$SLKCFLAGS $CFLAG_OPTIONS" export CXXFLAGS=$CFLAGS export LDFLAGS="$LDFLAGS $LDFLAG_OPTIONS" #-------------------------------------------- #GET THE SOURCE #-------------------------------------------- for SRC in $(echo $LINK);do if [ ! -f $CWD/$(basename $SRC) ] then wget -c $SRC fi done #-------------------------------------------- rm -rf $PKG mkdir -p $PKG cd $TMP rm -rf $NAME-$VERSION #EXTRACT SOURCES #----------------------------------------------------- echo "Extracting source..." tar xvf $CWD/$NAME-$VERSION.source.tar.* || exit 1 #----------------------------------------------------- cd $TMP/mozilla || exit 1 # Put any Patches here #----------------------------------------------------- #patch -p1 < #----------------------------------------------------- # Add /usr/lib/mozilla/plugins to MOZ_PLUGINS_PATH: zcat $CWD/seamonkey.moz_plugin_path.diff.gz | patch -p1 -N --verbose --backup --suffix=.orig || exit 1 rm -f xpfe/bootstrap/mozilla.in.orig # append VL to user agent string: cat << EOF >> ./xpfe/bootstrap/browser-prefs.js || exit 1 pref("general.useragent.extra.vendorComment", "(VectorLinux package $VERSION-$BUILD)"); EOF # change homepage to vl; this is in prefs js but should also be here: localisation: zcat $CWD/all.js.diff.gz | patch -p1 -N --verbose --backup --suffix=.orig || exit 1 zcat $CWD/configure.diff.gz | patch -p1 -N --verbose --backup --suffix=.orig || exit 1 zcat $CWD/configure.in.diff.gz | patch -p1 -N --verbose --backup --suffix=.orig || exit 1 zcat $CWD/region.properties.diff.gz | patch -p1 -N --verbose --backup --suffix=.orig || exit 1 # Fix a long standing bug that's prevented staying current on GTK+. # Thanks to the BLFS folks. :-) # thanks to Slackware cat >> layout/build/Makefile.in << EOF ifdef MOZ_ENABLE_CANVAS EXTRA_DSO_LDOPTS += \$(XLDFLAGS) -lX11 -lXrender endif EOF #SET PERMISSIONS #----------------------------------------- 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 #---------------------------------------------------------------------- # If you are building a KDE-related app, then change the following # arguments in the script below: # --prefix=$(kde-config -prefix) \ # --sysconfdir=/etc/kde \ # # Making these changes will ensure that your package will build in the # correct path and that it will work seamlessly within the KDE environment. # #----------------------------------------------------------------------- echo "Configuring source..." export MOZILLA_OFFICIAL="1" export BUILD_OFFICIAL="1" BUILD_OFFICIAL=1 MOZILLA_OFFICIAL=1 \ ./configure --prefix=/opt/seamonkey \ --enable-optimize="-O2 -march=i586 -mtune=i686" \ --disable-debug \ --enable-elf-dynstr-gc \ --with-default-mozilla-five-home=/opt/seamonkey/lib/seamonkey-${VERSION} \ --enable-strip \ --enable-strip-libs \ --disable-tests \ --enable-svg \ --enable-canvas \ --disable-freetype2 \ --enable-svg-renderer-cairo \ --enable-pango \ --disable-short-wchar \ --enable-nspr-autoconf \ --enable-ldap \ --enable-extensions=default,irc \ --enable-crypto \ --disable-xprint \ --disable-gnomeui \ --disable-gnomevfs \ --disable-installer \ --enable-system-nspr \ --enable-system-nss \ --enable-system-zlib \ --enable-system-jpeg \ --enable-system-png \ --enable-system-mng \ --enable-system-cairo \ --with-java-include-path=/usr/include \ --with-java-bin-path=/usr/bin \ --enable-default-toolkit=gtk2 \ --enable-application=suite \ --enable-xft \ --disable-activex \ --disable-activex-scripting \ $CONFIGURE_TRIPLET || exit 1 BUILD_OFFICIAL=1 MOZILLA_OFFICIAL=1 make -s export || exit 1 BUILD_OFFICIAL=1 MOZILLA_OFFICIAL=1 make -s libs || exit 1 BUILD_OFFICIAL=1 MOZILLA_OFFICIAL=1 DESTDIR=$PKG make install ####################################################################### #Miscellenious tweaks and things outside a normal ./configure go here # ####################################################################### chmod a+x $PKG/opt/seamonkey/bin/seamonkey chown root.root $PKG/opt/seamonkey/bin/seamonkey # copy the .desktop files and the matching icons to their proper places mkdir -p $PKG/usr/share/applications cp -a $CWD/*.desktop $PKG/usr/share/applications chown -R root:root $PKG/usr/share/applications chmod 644 $PKG/usr/share/applications/* mkdir -p $PKG/usr/share/pixmaps cp -a $CWD/*.png $PKG/usr/share/pixmaps chown -R root:root $PKG/usr/share/pixmaps chmod 644 $PKG/usr/share/pixmaps/* # now copy the xfce helpers into their proper place mkdir -p $PKG/usr/share/xfce4/helpers cp -a $CWD/helpers/*.desktop $PKG/usr/share/xfce4/helpers chown -R root:root $PKG/usr/share/xfce4 chmod 644 $PKG/usr/share/xfce4/helpers/* #mkdir -p $PKG/usr/share/applications #cp $CWD/$NAME.desktop $PKG/usr/share/applications/$NAME.desktop #mkdir -p $PKG/usr/share/pixmaps #cp $CWD/$NAME.png $PKG/usr/share/pixmaps/$NAME.png mkdir -p $PKG/usr/doc/$NAME-$VERSION cp -a LEGAL LICENSE README.txt \ $PKG/usr/doc/$NAME-$VERSION cat $CWD/$NAME.SlackBuild > $PKG/usr/doc/$NAME-$VERSION/$NAME.SlackBuild cat $CWD/doinst.sh > $PKG/install/doinst.sh # since we are putting seamonkey into /opt/seamonkey, # let's add a startup script to seed its path mkdir -p $PKG/etc/profile.d cat $CWD/seamonkey.sh > $PKG/etc/profile.d/seamonkey.sh chown root.root $PKG/etc/profile.d/seamonkey.sh chmod a+x $PKG/etc/profile.d/seamonkey.sh cd $PKG # copy our chrome modifications to the global chrome directory if [ ! -d $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome ] ; then mkdir -p $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome fi cp -a $CWD/eurynome.jar $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/ chown root.root $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/eurynome.jar chmod 644 $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/eurynome.jar cp -a $CWD/nereid.jar $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/ chown root.root $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/nereid.jar chmod 644 $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/nereid.jar cp -a $CWD/nuvola.jar $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/ chown root.root $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/nuvola.jar chmod 644 $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/nuvola.jar cp -a $CWD/newsfox.jar $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/ chown root.root $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/newsfox.jar chmod 644 $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/newsfox.jar cp -a $CWD/*.rdf $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/ chown root.root $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/*.rdf chmod 644 $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/*.rdf # copy the chrome modifications into the default profile if [ ! -d $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/US/chrome ] ; then mkdir -p $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/US/chrome fi cp -a $CWD/chrome.rdf $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/US/chrome/chrome.rdf cp -a $CWD/*.css $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/US/chrome chown root.root $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/US/chrome/*.rdf chown root.root $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/US/chrome/*.css chmod 644 $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/US/chrome/*.rdf chmod 644 $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/US/chrome/*.css cp -a $CWD/*.js $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/US/. chown root.root $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/US/*.js chmod 644 $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/US/*.js # now copy the inconnu icons into the right place -- actually these are jtek's based on incognu's if [ ! -d $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/icons/default ] ; then mkdir -p $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/icons/default else rm $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/icons/default/*.* fi cp -a $CWD/default-linux/*.xpm $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/icons/default chown root.root $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/icons/default/*.xpm chmod 644 $PKG/opt/seamonkey/lib/seamonkey-$VERSION/chrome/icons/default/*.xpm # copy our modified bookmarks and our prefs.js into the default profile cp -a $CWD/bookmarks.html $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/ chown root.root $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/bookmarks.html chmod 644 $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/bookmarks.html cp -a $CWD/bookmarks.html $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/US chown root.root $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/US/bookmarks.html chmod 644 $PKG/opt/seamonkey/lib/seamonkey-$VERSION/defaults/profile/US/bookmarks.html #---------------------------------------------------------------------- if [ -d $PKG/usr/share/man ] ; then mkdir -p $PKG/usr/man mv $PKG/usr/share/man/* $PKG/usr/man rm -rf $PKG/usr/share/man fi find $PKG/usr/man -type f -exec gzip -9 {} \; if [ -d $PKG/usr/share/info ] ; then mkdir -p $PKG/usr/info mv $PKG/usr/share/info/* $PKG/usr/info rm -rf $PKG/usr/share/info fi find $PKG/usr/info -type f -exec gzip -9 {} \; mkdir -p $PKG/install if [ -d $PKG/usr/info ] ; then cat >> $PKG/install/doinst.sh << EOF cd usr/info if [ -f dir ]; then rm dir fi if [ -f dir.gz ]; then rm dir.gz fi for i in *.info.gz do install-info $i dir done EOF fi mkdir -p $PKG/install #if there is a slack-desc in src dir use it if test -f $CWD/slack-desc; then cp $CWD/slack-desc $RELEASEDIR/slack-desc else # 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 # Fill in the package summary between the () below. # Then package the description, License, Author and Website. # There may be no more then 11 $NAME: lines in a valid slack-desc. 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: $NAME (an open-source web browser suite) $NAME: The SeaMonkey browser suite. SeaMonkey features a state-of-the-art $NAME: web browser and powerful email client, as well as a WYSIWYG web page $NAME: composer and a feature-rich IRC chat client. For web $NAME: developers, mozilla.org's DOM inspector and JavaScript debugger tools $NAME: are included as well. $NAME: $NAME: License: MPL 1.1/GPL 2.0/LGPL 2.1 $NAME: Authors: The SeaMonkey Project $NAME: Website: http://www.seamonkey-project.org/ EOF fi cat >> $RELEASEDIR/slack-desc << EOF #---------------------------------------- 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 #STRIPPING #------------------------------------------------------------------------------------------------------------------ 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 #------------------------------------------------------------------------------------------------------------------ #FINISH PACKAGE #-------------------------------------------------------------- echo "Finding dependencies..." ADD="$ADDRB" EXCLUDE="$EXRB" 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 "Package Complete" #-------------------------------------------------------------- # vim: set tabstop=4 shiftwidth=4 foldmethod=marker : ##