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.

67 lines
1.2 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 "* Tagging release \"$1\""
  34. sed -ri "s/(PUSB_VERSION) \"[^\"]*\"/\1 \"${1}\"/" ${SRC_PATH}/src/version.h
  35. echo "* Creating tarball..."
  36. cd $BUILD_ENV
  37. tar -zcf $TARBALL pam_usb-${1}
  38. cd - > /dev/null
  39. cp -a $SRC_PATH ../tags/${1}
  40. cp ${BUILD_ENV}/${TARBALL} .
  41. rm -rf $BUILD_ENV
  42. echo "* Release $1 successfully rolled."
  43. echo "* Tarball stored on `pwd`/${TARBALL}"
  44. md5sum $TARBALL
  45. }
  46. if [ "x$1" = "x" ] ; then
  47. echo "Usage: roll_release.sh <version>"
  48. exit
  49. fi
  50. cd `dirname $0`
  51. clean_sources
  52. create_release "$1"