Hardware authentication for Linux using ordinary USB Flash Drives.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

64 lines
1.1 KiB

  1. #!/bin/sh
  2. #
  3. # roll_release.sh
  4. #
  5. # Rolls a distribution tarball from the svn trunk
  6. # and performs basic QA checks.
  7. #
  8. TRUNK_PATH="./pam_usb"
  9. clean_sources()
  10. {
  11. cd $TRUNK_PATH
  12. make clean >> /dev/null || exit
  13. if [ "`svn st`" ] ; then
  14. echo "! Directory $TRUNK_PATH is not clean !"
  15. svn st
  16. exit
  17. fi
  18. cd - > /dev/null
  19. }
  20. create_release()
  21. {
  22. BUILD_ENV=`mktemp -d /tmp/build.XXXXXX`
  23. SRC_PATH=${BUILD_ENV}/pam_usb-${1}
  24. TARBALL=pam_usb-${1}.tar.gz
  25. if [ -d "../tags/${1}" -o -f $TARBALL ] ; then
  26. rm -rf $BUILD_ENV
  27. echo "! Release $1 already exists !"
  28. exit
  29. fi
  30. echo "* Rolling release $1 on $BUILD_ENV..."
  31. cp -r $TRUNK_PATH ${SRC_PATH}
  32. find "$SRC_PATH" -type d -name ".svn" -exec rm -rf "{}" +
  33. echo "* Creating tarball..."
  34. cd $BUILD_ENV
  35. tar -zcf $TARBALL pam_usb-${1}
  36. cd - > /dev/null
  37. cp -a $SRC_PATH ../tags/${1}
  38. cp ${BUILD_ENV}/${TARBALL} .
  39. rm -rf $BUILD_ENV
  40. echo "* Release $1 successfully rolled."
  41. echo "* Tarball stored on `pwd`/${TARBALL}"
  42. md5sum $TARBALL
  43. }
  44. if [ "x$1" = "x" ] ; then
  45. echo "Usage: roll_release.sh <version>"
  46. exit
  47. fi
  48. cd `dirname $0`
  49. clean_sources
  50. create_release "$1"