1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
|
#!/bin/bash
set -e
NAME=eclipse-wtp
VERSION=$2
DEB_VERSION=${VERSION}
TMP_DIR=`mktemp -d`
WORK_DIR=$PWD
VERSION_UNDERSCORE=$(echo $VERSION | sed "s/\./_/g")
moveBundlesFiltered() {
BUNDLE_DIR=$1
BUNDLE_FILTER=$2
BUNDLES=$(find $BUNDLE_DIR -maxdepth 1 -mindepth 1 -type d -name "org.eclipse.*" \
! -name features ! -name plugins ! -name bundles ! -name docs)
for bundle in $BUNDLES; do
if [ "$BUNDLE_FILTER" != "" ] && [ $(basename "$bundle") != "$BUNDLE_FILTER" ]; then
continue;
fi
mv $bundle .
done
}
cd "$TMP_DIR"
mkdir modules
cd modules
TARBALL=R$VERSION_UNDERSCORE.tar.gz
wget https://github.com/eclipse-wtp-common/webtools.common/archive/refs/tags/$TARBALL
tar -xf $TARBALL
rm -f $TARBALL
MODULE_DIR=webtools.common-R$VERSION_UNDERSCORE
for subdir in . core/bundles xml/bundles features plugins bundles docs; do
if [ -d $MODULE_DIR/$subdir ]; then
moveBundlesFiltered "$MODULE_DIR/$subdir" "$MODULE_FILTER"
fi
done
rm -r $MODULE_DIR
wget https://github.com/eclipse-sourceediting/sourceediting/archive/refs/tags/$TARBALL
tar -xf $TARBALL
rm -f $TARBALL
MODULE_DIR=sourceediting-R$VERSION_UNDERSCORE
for subdir in . core/bundles xml/bundles features plugins bundles docs; do
if [ -d $MODULE_DIR/$subdir ]; then
moveBundlesFiltered "$MODULE_DIR/$subdir" "$MODULE_FILTER"
fi
done
rm -r $MODULE_DIR
cd ..
mkdir ${NAME}-${VERSION}
while read LINE ; do
echo "Picking $LINE"
mv modules/$LINE ${NAME}-${VERSION}
done < "$WORK_DIR/debian/wtpbundles"
rm -rf modules
cd ${NAME}-${VERSION}
find -type f -name .cvsignore -delete
find -type f -name .gitignore -delete
find -type f -name Thumbs.db -delete
find -type f -name *.jar -delete
rm -f org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/contenttype/XMLHeadTokenizer.java \
org.eclipse.wst.xml.core/src/org/eclipse/wst/xml/core/internal/parser/XML10Names.java
cd ..
echo "Creating tarball '${NAME}_${DEB_VERSION}.orig.tar.xz'..."
tar -cJf "$WORK_DIR/../${NAME}_${DEB_VERSION}.orig.tar.xz" $NAME-$VERSION
rm -rf "$TMP_DIR"
|