| 1 |
#! /bin/sh
|
| 2 |
|
| 3 |
# We need to make our own copy of the eclipse platform in order to
|
| 4 |
# build against it. We do this since the build root might already
|
| 5 |
# contain a copy of the plugin we are building -- and the eclipse
|
| 6 |
# releng scripts fail in this situation. We put this script in the
|
| 7 |
# eclipse core so that it is easy to use from other spec files.
|
| 8 |
|
| 9 |
# Arguments are:
|
| 10 |
# * directory where results should end up (script will make it)
|
| 11 |
# * base location of eclipse platform install
|
| 12 |
# * an optional string that is used to select non-platform
|
| 13 |
# plugins and features. At present if a plugin or feature has
|
| 14 |
# this as a substring, it will be included. You need only run
|
| 15 |
# this script once, it will link both the platform and the other
|
| 16 |
# optionally-selected parts in a single invocation.
|
| 17 |
|
| 18 |
# Test to see if the minimum arguments
|
| 19 |
# are specified
|
| 20 |
|
| 21 |
if [ $# -lt 2 ]; then
|
| 22 |
echo "Usage: copy-platform where eclipse_base optional_directories"
|
| 23 |
echo "For example: copy-plaform ~/SDK /usr/lib/eclipse cdt pydev jdt"
|
| 24 |
exit 1
|
| 25 |
fi
|
| 26 |
|
| 27 |
where=$1; shift
|
| 28 |
eclipse=$1; shift
|
| 29 |
|
| 30 |
datadir=/usr/share/eclipse
|
| 31 |
|
| 32 |
mkdir -p $where/plugins $where/features
|
| 33 |
cd $where
|
| 34 |
|
| 35 |
# Are there any optional arguments left?
|
| 36 |
if [ $# -gt 0 ]; then
|
| 37 |
for optional in "$@"; do
|
| 38 |
(cd $eclipse; ls -d plugins/*"$optional"* features/*"$optional"*) |
|
| 39 |
while read f; do
|
| 40 |
[ ! -e $f ] && ln -s $eclipse/$f $f
|
| 41 |
done
|
| 42 |
(cd $eclipse/dropins; ls -d *"$optional"*) |
|
| 43 |
while read f; do
|
| 44 |
if [ -e $eclipse/dropins/$f/eclipse ]; then
|
| 45 |
(cd $eclipse/dropins/$f/eclipse; ls -d plugins/* features/*) |
|
| 46 |
while read g; do
|
| 47 |
[ ! -e $g ] && \
|
| 48 |
ln -s $eclipse/dropins/$f/eclipse/$g $g
|
| 49 |
done
|
| 50 |
else
|
| 51 |
(cd $eclipse/dropins/$f; ls -d plugins/* features/*) |
|
| 52 |
while read g; do
|
| 53 |
[ ! -e $g ] && \
|
| 54 |
ln -s $eclipse/dropins/$f/$g $g
|
| 55 |
done
|
| 56 |
fi
|
| 57 |
done
|
| 58 |
(cd $datadir/dropins; ls -d *"$optional"*) |
|
| 59 |
while read f; do
|
| 60 |
if [ -e $datadir/dropins/$f/eclipse ]; then
|
| 61 |
(cd $datadir/dropins/$f/eclipse; ls -d plugins/* features/*) |
|
| 62 |
while read g; do
|
| 63 |
[ ! -e $g ] && \
|
| 64 |
ln -s $datadir/dropins/$f/eclipse/$g $g
|
| 65 |
done
|
| 66 |
else
|
| 67 |
(cd $datadir/dropins/$f; ls -d plugins/* features/*) |
|
| 68 |
while read g; do
|
| 69 |
[ ! -e $g ] && \
|
| 70 |
ln -s $datadir/dropins/$g $g
|
| 71 |
done
|
| 72 |
fi
|
| 73 |
done
|
| 74 |
done
|
| 75 |
fi
|
| 76 |
|
| 77 |
# Code after this point is automatically created by eclipse.spec.
|