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.

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