git2tarxz.sh 1013 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. # Create source tarball from git repo, with generated version
  3. # number. We don't include the git history in the tarball.
  4. # Note that this script doesn't need to be run as root. It does
  5. # need to be able to write to the current directory it's run from.
  6. PRGNAM=xcf-pixbuf-loader
  7. CLONE_URL=https://github.com/StephaneDelcroix/$PRGNAM.git
  8. set -e
  9. GITDIR=$( mktemp -dt $PRGNAM.git.XXXXXX )
  10. rm -rf $GITDIR
  11. git clone $CLONE_URL $GITDIR
  12. CWD="$( pwd )"
  13. cd $GITDIR
  14. VERSION=$( git log --date=format:%Y%m%d --pretty=format:%cd.%h -n1 )
  15. rm -rf .git
  16. find . -name .gitignore -print0 | xargs -0 rm -f
  17. cd "$CWD"
  18. rm -rf $PRGNAM-$VERSION $PRGNAM-$VERSION.tar.xz
  19. mv $GITDIR $PRGNAM-$VERSION
  20. tar cvfJ $PRGNAM-$VERSION.tar.xz $PRGNAM-$VERSION
  21. cat <<EOF
  22. Archive created: $PRGNAM-$VERSION.tar.xz
  23. Update $PRGNAM.info with:
  24. VERSION="$VERSION"
  25. DOWNLOAD="https://slackware.uk/~urchlay/src/$PRGNAM-$VERSION.tar.xz"
  26. MD5SUM="$( md5sum $PRGNAM-$VERSION.tar.xz | cut -d' ' -f1 )"
  27. Don't forget to upload the new source!
  28. EOF