geom_gate userland utility improvements
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.
 
 
 
 

100 lines
2.5 KiB

  1. #! /bin/sh
  2. # Script to build release-archives with
  3. #
  4. version=$1
  5. if [ -z "$version" ]; then
  6. echo "Specify a version number!"
  7. exit
  8. fi
  9. if [ "xonly" = "x$2" ]; then
  10. echo "Setup version number only!"
  11. only=1
  12. fi
  13. libversion="$version"
  14. major=`echo $libversion |cut -d. -f1 | sed -e "s/[^0-9]//g"`
  15. minor=`echo $libversion |cut -d. -f2 | sed -e "s/[^0-9]//g"`
  16. patch=`echo $libversion |cut -d. -f3 | cut -d- -f1 | sed -e "s/[^0-9]//g"`
  17. numeric=`perl -e 'printf("%02x%02x%02x\n", '"$major, $minor, $patch);"`
  18. HEADER=include/libssh2.h
  19. if test -z "$only"; then
  20. ext=".dist"
  21. # when not setting up version numbers locally
  22. for a in $HEADER; do
  23. cp $a "$a$ext"
  24. done
  25. HEADER="$HEADER$ext"
  26. fi
  27. # requires a date command that knows -u for UTC time zone
  28. datestamp=`LC_TIME=C date -u`
  29. # Replace in-place version number in header file:
  30. sed -i -e 's/^#define LIBSSH2_VERSION .*/#define LIBSSH2_VERSION "'$libversion'"/g' \
  31. -e 's/^#define LIBSSH2_VERSION_NUM .*/#define LIBSSH2_VERSION_NUM 0x'$numeric'/g' \
  32. -e 's/^#define LIBSSH2_VERSION_MAJOR .*/#define LIBSSH2_VERSION_MAJOR '$major'/g' \
  33. -e 's/^#define LIBSSH2_VERSION_MINOR .*/#define LIBSSH2_VERSION_MINOR '$minor'/g' \
  34. -e 's/^#define LIBSSH2_VERSION_PATCH .*/#define LIBSSH2_VERSION_PATCH '$patch'/g' \
  35. -e "s/^#define LIBSSH2_TIMESTAMP .*/#define LIBSSH2_TIMESTAMP \"$datestamp\"/g" \
  36. $HEADER
  37. echo "libssh2 version $libversion"
  38. echo "libssh2 numerical $numeric"
  39. echo "datestamp $datestamp"
  40. if test -n "$only"; then
  41. # done!
  42. exit;
  43. fi
  44. findprog()
  45. {
  46. file="$1"
  47. for part in `echo $PATH| tr ':' ' '`; do
  48. path="$part/$file"
  49. if [ -x "$path" ]; then
  50. # there it is!
  51. return 1
  52. fi
  53. done
  54. # no such executable
  55. return 0
  56. }
  57. ############################################################################
  58. #
  59. # automake is needed to run to make a non-GNU Makefile.in if Makefile.am has
  60. # been modified.
  61. #
  62. if { findprog automake >/dev/null 2>/dev/null; } then
  63. echo "- Could not find or run automake, I hope you know what you're doing!"
  64. else
  65. echo "Runs automake --include-deps"
  66. automake --include-deps Makefile >/dev/null
  67. fi
  68. #######################################################################
  69. #
  70. # Generate the changelog
  71. #
  72. echo "generate NEWS"
  73. git log --pretty=fuller --no-color --date=short --decorate=full -1000 | ./git2news.pl > NEWS.dist
  74. ############################################################################
  75. #
  76. # Now run make dist to generate a tar.gz archive
  77. #
  78. echo "make dist"
  79. targz="libssh2-$version.tar.gz"
  80. make -s dist VERSION=$version