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.

71 lines
1.3 KiB

17 years ago
17 years ago
17 years ago
17 years ago
  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="../"
  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. TAG_PATH=${TRUNK_PATH}/../../tags/${1}
  26. if [ -d $TAG_PATH -o -f $TARBALL ] ; then
  27. rm -rf $BUILD_ENV
  28. echo "! Release $1 already exists !"
  29. exit
  30. fi
  31. echo "* Rolling release $1 on $BUILD_ENV..."
  32. svn cp $TRUNK_PATH/../pam_usb $TAG_PATH
  33. svn export $TRUNK_PATH $SRC_PATH
  34. echo "* Cleaning up..."
  35. rm -rf $SRC_PATH/utils
  36. echo "* Tagging release \"$1\""
  37. sed -ri "s/(PUSB_VERSION) \"[^\"]*\"/\1 \"${1}\"/" ${SRC_PATH}/src/version.h
  38. cp -f ${SRC_PATH}/src/version.h ${TAG_PATH}/src/version.h
  39. echo "* Creating tarball..."
  40. cd $BUILD_ENV
  41. tar -zcf $TARBALL pam_usb-${1}
  42. cd - > /dev/null
  43. cp ${BUILD_ENV}/${TARBALL} .
  44. rm -rf $BUILD_ENV
  45. echo "* Release $1 successfully rolled."
  46. echo "* Tarball stored on `pwd`/${TARBALL}"
  47. md5sum $TARBALL
  48. }
  49. if [ "x$1" = "x" ] ; then
  50. echo "Usage: roll_release.sh <version>"
  51. exit
  52. fi
  53. cd `dirname $0`
  54. clean_sources
  55. create_release "$1"