#!/bin/sh
VERSION=$1
tar -xzvf astrometry.net-$VERSION.tar.gz
#Remove nonfree software
unlink astrometry.net-$VERSION/astrometry
rm -rf astrometry.net-$VERSION/demo
rm -rf astrometry.net-$VERSION/gsl-an
rm -f astrometry.net-$VERSION/catalogs/ic2000.fits
rm -f astrometry.net-$VERSION/catalogs/ngc2000-readme.txt
rm -f astrometry.net-$VERSION/catalogs/ngc2000.dat
rm -f astrometry.net-$VERSION/catalogs/ngc2000.fits
rm -f astrometry.net-$VERSION/catalogs/ngc2000names.dat
rm -f astrometry.net-$VERSION/catalogs/ngc2000names.fits
tar -cJvf astrometry.net-$VERSION-clean.tar.xz astrometry.net-$VERSION
#Remove temporary directory
rm -rf astrometry.net-$VERSION