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.

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