src_tarball.sh 388 B

12345678910111213141516171819
  1. #!/bin/bash
  2. VERSION=`cat CMakeLists.txt | grep "project(" | grep -oP '(\d.)+'`
  3. #Trim variable
  4. VERSION=`echo $VERSION`
  5. echo $VERSION
  6. ORIGDIR=`pwd`
  7. TMPDIR=libks.$$
  8. mkdir -p ../${TMPDIR}
  9. cd ..
  10. cp -a libks ${TMPDIR}/libks-$VERSION
  11. cd ${TMPDIR}
  12. rm -rf libks-$VERSION/.git*
  13. tar zcvf libks-$VERSION.tar.gz libks-$VERSION
  14. mv libks-$VERSION.tar.gz ${ORIGDIR}/.
  15. cd ${ORIGDIR}
  16. rm -rf ../${TMPDIR}