Sophie

Sophie

distrib > * > 2008.0 > x86_64 > by-pkgid > d061baaa6d8251d8c45491c96ae2d045 > files > 5

eclipse-phpeclipse-1.1.8-16.4.2mdv2008.0.src.rpm

#!/bin/sh
VERSION=1.1.8

# check out the modules based on the release date
echo "Creating directory 'phpeclipse-$VERSION'..."
mkdir phpeclipse-$VERSION
pushd phpeclipse-$VERSION
echo "Exporting phpeclipse from CVS..."
for m in net.sourceforge.phpeclipse \
         net.sourceforge.phpeclipse.core \
         net.sourceforge.phpeclipse.debug.core \
         net.sourceforge.phpeclipse.debug.ui \
         net.sourceforge.phpeclipse.externaltools \
         net.sourceforge.phpeclipse.feature \
         net.sourceforge.phpeclipse.launching \
         net.sourceforge.phpeclipse.phphelp \
         net.sourceforge.phpeclipse.smarty.ui \
         net.sourceforge.phpeclipse.ui \
         net.sourceforge.phpeclipse.webbrowser \
         net.sourceforge.phpeclipse.xml.core \
         net.sourceforge.phpeclipse.xml.ui; do
  cvs -z3 -d:pserver:anonymous@phpeclipse.cvs.sourceforge.net:/cvsroot/phpeclipse export -D "2006/04/08 00:00" $m
  # sf.net servers suck!
  if [ $? -eq 1 ]; then
    sleep 10
    cvs -z3 -d:pserver:anonymous@phpeclipse.cvs.sourceforge.net:/cvsroot/phpeclipse export -D "2006/04/08 00:00" $m
    if [ $? -eq 1 ]; then 
      echo "ERROR: There was a problem checking out module: $m"
      exit 1
    fi
  fi 
done

find -name feature.xml -o -name plugin.xml | xargs sed --in-place "s/1.1.7/$VERSION/"
find -name .project -o -name .classpath -o -name .template | xargs rm
popd

echo "Downloading Source .zip file..."
wget http://easynews.dl.sourceforge.net/sourceforge/phpeclipse/net.sourceforge.phpeclipse_$VERSION.src.zip
mkdir source-plugin
unzip -q -d source-plugin net.sourceforge.phpeclipse_$VERSION.src.zip

pushd source-plugin/plugins/net.sourceforge.phpeclipse.source_$VERSION/src

# take _$VERSION off the directory names
for dir in $(ls --color=no); do
  newdir=$(echo $dir | sed s/_$VERSION//)
  mv $dir $newdir
done

# the plugin id and project name don't match for this one 
mv net.sourceforge.phpdt.smarty.ui net.sourceforge.phpeclipse.smarty.ui

# copy source files over
for sourcefile in $(find -name \*.java); do
  targetdir="../../../../phpeclipse-$VERSION/$(dirname $sourcefile | sed "s|./||")"
  mkdir -p $targetdir
  mv $sourcefile $targetdir
done
  
popd

# grab the plugin.xml, plugin.properties and other files from the binary zip
echo "Downloading Binary .zip file..."
wget http://umn.dl.sourceforge.net/sourceforge/phpeclipse/net.sourceforge.phpeclipse_$VERSION.bin.dist.zip
mkdir binary-plugin
unzip -q -d binary-plugin net.sourceforge.phpeclipse_$VERSION.bin.dist.zip

pushd binary-plugin
# remove the jars so they don't accidentally end up in the source archive
find -name \*.jar | xargs rm

# flatten the directory structure
mv features/net.sourceforge.phpeclipse_$VERSION net.sourceforge.phpeclipse.feature
mv plugins/* . 
rmdir features plugins

# take _$VERSION off the directory names
for dir in $(ls --color=no | grep $VERSION); do
  newdir=$(echo $dir | sed s/_$VERSION//)
  mv $dir $newdir
done

# the plugin id and project name don't match for this one 
mv net.sourceforge.phpdt.smarty.ui net.sourceforge.phpeclipse.smarty.ui

# finally copy the files over 
for sourcedir in $(ls --color=no); do
  targetdir=../phpeclipse-$VERSION/$sourcedir
  cp -r  $sourcedir/* $targetdir
done

popd

find phpeclipse-$VERSION -name \*.java | xargs dos2unix 
find phpeclipse-$VERSION -name \*.xml | xargs dos2unix
sed --in-place "s/3.1.1/0.0.0/" phpeclipse-$VERSION/net.sourceforge.phpeclipse.feature/feature.xml 

tar zcf phpeclipse-$VERSION.tar.gz phpeclipse-$VERSION

rm -rf binary-plugin source-plugin net.sourceforge.phpeclipse_$VERSION.src.zip phpeclipse-$VERSION net.sourceforge.phpeclipse_$VERSION.bin.dist.zip