- Update package-build releng script to work with mylar.

This commit is contained in:
Ben Konrath 2007-03-16 18:41:07 +00:00
parent 32b1de4498
commit c577a4fe6e
2 changed files with 41 additions and 44 deletions

View File

@ -193,42 +193,9 @@ RCS file: templates/package-build/prepare-build-dir.sh
diff -N templates/package-build/prepare-build-dir.sh
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ templates/package-build/prepare-build-dir.sh 1 Jan 1970 00:00:00 -0000
@@ -0,0 +1,83 @@
@@ -0,0 +1,77 @@
+#!/bin/sh
+
+
+make_links()
+{
+ TYPE=$1
+ TYPEDIR=$2
+ shift; shift;
+ XMLFILES=$@
+
+ CURBUILDFILE=$BUILDDIR/tmp/$TYPE-build.xml
+ cat $BUILDFILE | sed "s|@type@|$TYPE|" > $CURBUILDFILE
+
+ for f in $XMLFILES; do
+ PROJECTDIR=$(dirname $f)
+ PROJECTNAME=$(ant -Dbasedir=$PROJECTDIR -f $CURBUILDFILE 2>&1 | grep echo | cut --delimiter=' ' -f 7)
+ if [ -z $PROJECTNAME ]; then
+ if [ ! -e $PROJECTDIR/META-INF/MANIFEST.MF ]; then
+ echo "ERROR: could not determine the feature id for $PROJECTDIR"
+ exit 1
+ fi
+ PROJECTNAME=$(grep Bundle-SymbolicName $PROJECTDIR/META-INF/MANIFEST.MF | cut --delimiter=';' -f 1 | cut --delimiter=' ' -f 2)
+ if [ -z $PROJECTNAME ]; then
+ echo "ERROR: could not determine the feature id for $PROJECTDIR"
+ exit 1
+ fi
+ fi
+
+ echo " making symlink: $BUILDDIR/$TYPEDIR/$PROJECTNAME -> $PROJECTDIR"
+ ln -sf $PROJECTDIR $BUILDDIR/$TYPEDIR/$PROJECTNAME
+
+ done
+}
+
+
+if [ $# -ne 2 ]; then
+ echo "usage: $0 <path to source dir> <path to build dir>"
+ exit 1
@ -257,23 +224,50 @@ diff -N templates/package-build/prepare-build-dir.sh
+ </target>
+</project>" > $BUILDFILE
+
+# find the feature.xml, plugin.xml and fragment.xml files
+FEATURES=$(find $SOURCEDIR -name feature.xml)
+PLUGINS=$(find $SOURCEDIR -name plugin.xml)
+FRAGMENTS=$(find $SOURCEDIR -name fragment.xml)
+for type in feature plugin fragment; do
+ CURBUILDFILE=$BUILDDIR/tmp/$type-build.xml
+ cat $BUILDFILE | sed "s|@type@|$type|" > $CURBUILDFILE
+done
+
+# make the directories eclipse is expecting
+echo " making the 'features' and 'plugins' directories"
+mkdir -p $BUILDDIR/features $BUILDDIR/plugins
+
+# make symlinks for the features
+make_links feature features $FEATURES
+FEATURES=$(find $SOURCEDIR -name feature.xml)
+for f in $FEATURES; do
+ PROJECTDIR=$(dirname $f)
+ PROJECTNAME=$(ant -Dbasedir=$PROJECTDIR -f $BUILDDIR/tmp/feature-build.xml 2>&1 | grep echo | cut --delimiter=' ' -f 7)
+ if [ -z $PROJECTNAME ]; then
+ echo "ERROR: could not determine the feature id for $PROJECTDIR"
+ exit 1
+ fi
+
+# make the symlinks for plugins
+make_links plugin plugins $PLUGINS
+ echo " making symlink: $BUILDDIR/features/$PROJECTNAME -> $PROJECTDIR"
+ ln -sf $PROJECTDIR $BUILDDIR/features/$PROJECTNAME
+done
+
+# make the symlinks for fragments - they go in the plugins directory as well
+make_links fragment plugins $FRAGMENTS
+# make symlinks for plugins and fragments
+PLUGINDIRS=$(find $SOURCEDIR -name plugin.xml -o -name fragment.xml -o -name MANIFEST.MF | sed "s/plugin.xml//g" | sed "s/fragment.xml//g" | sed "s/META-INF\/MANIFEST.MF//" | sort | uniq)
+for dir in $PLUGINDIRS; do
+ PROJECTNAME=""
+ if [ -e $dir/META-INF/MANIFEST.MF ]; then
+ PROJECTNAME=$(grep Bundle-SymbolicName $dir/META-INF/MANIFEST.MF | cut --delimiter=';' -f 1 | cut --delimiter=' ' -f 2)
+ elif [ -e $dir/plugin.xml ]; then
+ PROJECTNAME=$(ant -Dbasedir=$dir -f $BUILDDIR/tmp/plugin-build.xml 2>&1 | grep echo | cut --delimiter=' ' -f 7)
+ elif [ -e $dir/fragment.xml ]; then
+ PROJECTNAME=$(ant -Dbasedir=$dir -f $BUILDDIR/tmp/fragment-build.xml 2>&1 | grep echo | cut --delimiter=' ' -f 7)
+ fi
+
+ if [ -z $PROJECTNAME ]; then
+ echo "ERROR: could not determine the plugin or fragment id for $dir"
+ exit 1
+ fi
+
+ echo " making symlink: $BUILDDIR/plugins/$PROJECTNAME -> $dir"
+ ln -sf $dir $BUILDDIR/plugins/$PROJECTNAME
+
+done
+
+rm -rf $BUILDDIR/tmp
+echo done

View File

@ -19,7 +19,7 @@ Epoch: 1
Summary: An open, extensible IDE
Name: eclipse
Version: %{eclipse_majmin}.%{eclipse_micro}
Release: 4%{?dist}
Release: 5%{?dist}
License: Eclipse Public License
Group: Text Editors/Integrated Development Environments (IDE)
URL: http://www.eclipse.org/
@ -1740,6 +1740,9 @@ fi
%{_libdir}/%{name}/plugins/org.eclipse.sdk_*
%changelog
* Fri Mar 16 2007 Ben Konrath <bkonrath@redhat.com> 3.2.2-5
- Update package-build releng script to work with mylar.
* Thu Mar 15 2007 Ben Konrath <bkonrath@redhat.com> 3.2.2-4
- Update to tomcat 5.5.20.