Michal Srb 5f4447
#!/bin/bash
Michal Srb 5f4447
Michal Srb 5f4447
if [ $# -ne 1 ]; then
Michal Srb 5f4447
    echo "Usage: ./clean-tarball VERSION"
Michal Srb 5f4447
    exit 1
Michal Srb 5f4447
fi
Michal Srb 5f4447
Michal Srb 5f4447
VERSION=${1}
Michal Srb 5f4447
NAME="fop"
Michal Srb 5f4447
Michal Srb 5f4447
wget http://archive.apache.org/dist/xmlgraphics/fop/source/${NAME}-${VERSION}-src.tar.gz
Michal Srb 5f4447
tar xvf ${NAME}-${VERSION}-src.tar.gz
Michal Srb 5f4447
Michal Srb 5f4447
(
Michal Srb 5f4447
  cd ${NAME}-${VERSION}
Michal Srb 5f4447
  # non-free color profile
Michal Srb 5f4447
  find src/java/org/apache/fop/pdf/ -name "*.icm*" -delete
Michal Srb 5f4447
  find ./ -name "*.jar" -delete
Michal Srb 5f4447
  find ./ -name "*.pdf" -delete
Michal Srb 5f4447
  # serialized objects
Michal Srb 5f4447
  find ./${NAME}-${VERSION}/ -name "*.ser" -delete
Michal Srb 5f4447
  # examples, tests, ...
Michal Srb 5f4447
  rm -Rf lib/ examples/ test/ hyph/
Michal Srb 5f4447
  rm -Rf src/documentation/
Michal Srb 5f4447
  mkdir -p lib/build/
Michal Srb 5f4447
)
Michal Srb 5f4447
Michal Srb 5f4447
tar czvf ${NAME}-${VERSION}-clean.tar.gz ${NAME}-${VERSION}
Michal Srb 5f4447
rm -Rf ${NAME}-${VERSION}.tar.gz