#!/bin/sh

#JARS_DIR=/home/ksaito/JARS/Axis2-1.2
#TARGET_JARFILE=axis2-1.2-all.jar
JARS_DIR=/home/ksaito/JARS/tmp/Pellet-1.5-RC1/
TARGET_JARFILE=pellet-1.5RC1-all.jar

rm -f $TARGET_JARFILE
touch dummy.txt
jar cf $TARGET_JARFILE dummy.txt

rm -fr tmp
mkdir tmp
cd tmp

for j in $JARS_DIR/*.jar
do
    jar xf $j
    rm -f ../MANIFEST.MF
    rm -f META-INF/INDEX.LIST
    rm -f META-INF/*.SF
    rm -f META-INF/*.DSA
    mv META-INF/MANIFEST.MF ..
    echo $j
    jar umf ../MANIFEST.MF ../$TARGET_JARFILE *
    rm -r *
done

cd ..

rm -fr tmp
rm MANIFEST.MF
rm dummy.txt

#jar i $TARGET_JARFILE
