Source

m0e-vabs / var / vabs / xfce4-meta / src / xfce4-meta.SlackBuild

#!/usr/bin/bash
# This script assumes it will be launched within "/NAME/VERSION/src" dir.
# With all sources in "src" Your Vector Linux .txz 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.14.1, 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 = 

set -e

NAME="xfce4-meta"            #Enter package Name!
VERSION=${VERSION:-"4.10.0"}      #Enter package Version!
VER=$(echo $VERSION|sed 's/-/_/') #this fixes - in version
VL_PACKAGER=${VL_PACKAGER:-"rbistolfi"}   #Enter your Name!
LINK=${LINK:-""}  #Enter URL for package here!


#SYSTEM VARIABLES
#----------------------------------------------------------------------------
BUILDNUM=${BUILDNUM:-"3"}
VL_VERSION=${VL_VERSION:-"$(ls /var/log/packages/|grep vlconfig2|cut -d "-" -f4|cut -c 2-5)"}
BUILD=${BUILD:-"$BUILDNUM""$VL_VERSION"}
ARCH="noarch"
CONFIG_OPTIONS=${CONFIG_OPTIONS:-""}
LDFLAG_OPTIONS=${LDFLAG_OPTIONS:-""}
ADDRB=${ADDRB:-"xfce4-dev-tools libxfce4util xfconf libxfce4ui libxfcegui4 exo garcon tumbler Thunar xfce4-panel xfce4-settings xfce4-session xfdesktop xfwm4 xfce4-appfinder gtk-xfce-engine xfwm4-themes Terminal orage xfce4-mixer thunar-volman xfce4-power-manager xfce4-notifyd xfce4-volumed xfce4-taskmanager"} #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
MAKEDEPENDS=${MAKEDEPENDS:-"glib2"} # Add deps needed to BUILD this package here.

# List the components for this metapackage in the order they should be built
COMPONENTS="xfce4-dev-tools libxfce4util xfconf libxfce4ui libxfcegui4 exo garcon tumbler Thunar xfce4-panel xfce4-settings xfce4-session xfdesktop xfwm4 xfce4-appfinder gtk-xfce-engine xfwm4-themes Terminal orage xfce4-mixer thunar-volman xfce4-power-manager xfce4-notifyd xfce4-volumed xfce4-taskmanager"
METABUILD=${METABUILD:-"NO"} # Set this to "YES" to force all components be built from source code.
NUMJOBS=${NUMJOBS:-"-j6"}
#----------------------------------------------------------------------------

#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

# Check if we need to build all the components.
if [ ! "$METABUILD" = "NO" ]; then
	echo "METABUILD set to $METABUILD.  The following components will be built from source code"
	for i in $(echo $COMPONENTS); do
		echo "$i"
	done
	echo ;
	# Download the vldepper tool if it doesn't exist
	if [ ! -f /usr/local/bin/vldepper ]; then
		wget --no-check-certificate https://bitbucket.org/VLCore/vlbuildbot/raw/master/slave/usr/local/bin/vldepper || exit 1
		mv vldepper /usr/local/bin/vldepper
		chmod +x /usr/local/bin/vldepper
	fi
	for pkg in $COMPONENTS; do
		cp -arxp /home/slackbuilds/var/vabs/$pkg /tmp/builds/ || exit 1
		cd /tmp/builds/$pkg/src/ || exit 1
		vldepper $pkg.SlackBuild || exit 1
		BUILDNUM=${BUILDNUM} ARCH="" NUMJOBS=${NUMJOBS} sh $pkg.SlackBuild || exit 1
		installpkg ../*.t?z || exit 1
	done
fi

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

# 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 (Xfce4 Desktop Environment)
$NAME:
$NAME: Xfce4 meta package
$NAME: 
$NAME: 
$NAME: 
$NAME:
$NAME:
$NAME: License: GPL
$NAME: Authors: http://xfce.org
$NAME: Website: http://xfce.org

EOF
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/$DIRNAME/config.log)

EOF

cat $RELEASEDIR/slack-desc > $PKG/install/slack-desc


#FINISH PACKAGE
#--------------------------------------------------------------
echo "Finding dependencies..."
for dep in $ADDRB
do
	echo $dep >> $PKG/install/slack-required
done
echo "Creating package $NAME-$VERSION-$ARCH-$BUILD.txz"
cd $PKG
makepkg -l y -c n $RELEASEDIR/$NAME-$VERSION-$ARCH-$BUILD.txz

cd $CWD
echo "Cleaning up temp files..." && rm -rf $TMP
echo "Package Complete"
#--------------------------------------------------------------

# vim: set tabstop=4 shiftwidth=4 foldmethod=marker : ##
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.