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