cvsdist 38d0d0
#! /bin/sh
cvsdist 38d0d0
cvsdist 38d0d0
# We need to make our own copy of the eclipse platform in order to
cvsdist 38d0d0
# build against it.  We do this since the build root might already
cvsdist 38d0d0
# contain a copy of the plugin we are building -- and the eclipse
cvsdist 38d0d0
# releng scripts fail in this situation.  We put this script in the
cvsdist 38d0d0
# eclipse core so that it is easy to use from other spec files.
cvsdist 38d0d0
cvsdist 38d0d0
# Arguments are:
cvsdist 38d0d0
# * directory where results should end up (script will make it)
cvsdist 38d0d0
# * base location of eclipse platform install
cvsdist 8c8401
# * an optional string that is used to select non-platform
cvsdist 8c8401
#   plugins and features.  At present if a plugin or feature has
cvsdist 8c8401
#   this as a substring, it will be included.  You need only run
cvsdist 8c8401
#   this script once, it will link both the platform and the other
cvsdist 8c8401
#   optionally-selected parts in a single invocation.
7e1a9d
7e1a9d
# Test to see if the minimum arguments
7e1a9d
# are specified
7e1a9d
7e1a9d
if [ $# -lt 2 ]; then
7e1a9d
  echo "Usage: copy-platform where eclipse_base optional_directories"
Andrew Overholt 85c506
  echo "For example: copy-plaform ~/SDK /usr/lib/eclipse cdt pydev jdt"
7e1a9d
  exit 1
7e1a9d
fi
7e1a9d
7e1a9d
where=$1; shift
7e1a9d
eclipse=$1; shift
cvsdist 38d0d0
Andrew Overholt 85c506
datadir=/usr/share/eclipse
Andrew Overholt 85c506
Andrew Overholt 3bc4ce
mkdir -p $where/plugins $where/features
cvsdist 38d0d0
cd $where
cvsdist 38d0d0
7e1a9d
# Are there any optional arguments left?
7e1a9d
if [ $# -gt 0 ]; then
7e1a9d
   for optional in "$@"; do
7e1a9d
      (cd $eclipse; ls -d plugins/*"$optional"* features/*"$optional"*) |
7e1a9d
      while read f; do
a69cc9
         [ ! -e $f ] && ln -s $eclipse/$f $f
7e1a9d
      done
Andrew Overholt 3bc4ce
      (cd $eclipse/dropins; ls -d *"$optional"*) |
Andrew Overholt 3bc4ce
      while read f; do
Andrew Overholt 3bc4ce
	  if [ -e $eclipse/dropins/$f/eclipse ]; then
Andrew Overholt 3bc4ce
	      (cd $eclipse/dropins/$f/eclipse; ls -d plugins/* features/*) |
Andrew Overholt 3bc4ce
	      while read g; do
Andrew Overholt 3bc4ce
		  [ ! -e $g ] && \
Andrew Overholt 3bc4ce
		    ln -s $eclipse/dropins/$f/eclipse/$g $g
Andrew Overholt 3bc4ce
	      done
Andrew Overholt 3bc4ce
          else
Andrew Overholt 85c506
	      (cd $eclipse/dropins/$f; ls -d plugins/* features/*) |
Andrew Overholt 3bc4ce
	      while read g; do
Andrew Overholt 3bc4ce
	          [ ! -e $g ] && \
Andrew Overholt 8fa0c0
		    ln -s $eclipse/dropins/$f/$g $g
Andrew Overholt 3bc4ce
	      done
Andrew Overholt 3bc4ce
          fi
Andrew Overholt 3bc4ce
      done
Andrew Overholt 85c506
      (cd $datadir/dropins; ls -d *"$optional"*) |
Andrew Overholt 85c506
      while read f; do
Andrew Overholt 85c506
	  if [ -e $datadir/dropins/$f/eclipse ]; then
Andrew Overholt 85c506
	      (cd $datadir/dropins/$f/eclipse; ls -d plugins/* features/*) |
Andrew Overholt 85c506
	      while read g; do
Andrew Overholt 85c506
		  [ ! -e $g ] && \
Andrew Overholt 85c506
		    ln -s $datadir/dropins/$f/eclipse/$g $g
Andrew Overholt 85c506
	      done
Andrew Overholt 85c506
          else
Andrew Overholt 85c506
	      (cd $datadir/dropins/$f; ls -d plugins/* features/*) |
Andrew Overholt 85c506
	      while read g; do
Andrew Overholt 85c506
	          [ ! -e $g ] && \
Andrew Overholt 85c506
		    ln -s $datadir/dropins/$g $g
Andrew Overholt 85c506
	      done
Andrew Overholt 85c506
          fi
Andrew Overholt 85c506
      done
cvsdist 8c8401
   done
cvsdist 8c8401
fi
cvsdist 8c8401
cvsdist 38d0d0
# Code after this point is automatically created by eclipse.spec.