06b519f
#!/bin/bash
06b519f
06b519f
# Source0 is prepared by
06b519f
# svn checkout https://netpbm.svn.sourceforge.net/svnroot/netpbm/advanced netpbm-%{version}
06b519f
# svn checkout https://netpbm.svn.sourceforge.net/svnroot/netpbm/userguide netpbm-%{version}/userguide
06b519f
# svn checkout https://netpbm.svn.sourceforge.net/svnroot/netpbm/trunk/test netpbm-%{version}/test
06b519f
# and removing the .svn directories ( find -name "\.svn" -type d -print0 | xargs -0 rm -rf )
06b519f
# and removing the ppmtompeg code, due to patents ( rm -rf netpbm-%{version}/converter/ppm/ppmtompeg/ )
06b519f
06b519f
VERSION=$1
06b519f
if [[ -z $VERSION ]]; then
06b519f
    echo "Version is missing as argument"
06b519f
    exit 1
06b519f
fi
06b519f
NETPBM_NAME="netpbm-$VERSION"
06b519f
TEMP_DIR="/var/tmp/netpbm"
d776db3
TARBALL="$TEMP_DIR/$NETPBM_NAME.tar.xz"
06b519f
mkdir -p $TEMP_DIR
06b519f
pushd $TEMP_DIR
06b519f
svn checkout https://netpbm.svn.sourceforge.net/svnroot/netpbm/advanced $NETPBM_NAME
06b519f
svn checkout https://netpbm.svn.sourceforge.net/svnroot/netpbm/userguide $NETPBM_NAME/userguide
06b519f
svn checkout https://netpbm.svn.sourceforge.net/svnroot/netpbm/trunk/test $NETPBM_NAME/test
06b519f
find -name '\.svn' -type d -print0 | xargs -0 rm -rf
06b519f
rm -rf $NETPBM_NAME/converter/ppm/ppmtompeg/
d776db3
tar -cJvf $NETPBM_NAME.tar.xz $NETPBM_NAME
06b519f
rm -rf $NETPBM_NAME/
06b519f
popd
06b519f
if [[ -f "$TARBALL" ]]; then
06b519f
    cp $TARBALL .
06b519f
    rm $TARBALL
06b519f
fi
06b519f
exit 0