release.sh 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. #!/bin/sh +v
  2. PATH=/usr/local/gnu-autotools/bin/:$PATH
  3. export PATH
  4. # BSD make's "OBJDIR" support freaks out the automake-generated
  5. # Makefile. Effectively disable it.
  6. export MAKEOBJDIRPREFIX=/junk
  7. # Start from the build directory, where the version file is located
  8. if [ -f build/version ]; then
  9. cd build
  10. fi
  11. if [ \! -f version ]; then
  12. echo "Can't find version file"
  13. exit 1
  14. fi
  15. # Update the build number in the 'version' file.
  16. # Separate number from additional alpha/beta/etc marker
  17. MARKER=`cat version | sed 's/[0-9.]//g'`
  18. # Bump the number
  19. VN=`cat version | sed 's/[^0-9.]//g'`
  20. # Reassemble and write back out
  21. VN=$(($VN + 1))
  22. rm -f version.old
  23. mv version version.old
  24. chmod +w version.old
  25. echo $VN$MARKER > version
  26. # Build out the string.
  27. VS="$(($VN/1000000)).$(( ($VN/1000)%1000 )).$(( $VN%1000 ))$MARKER"
  28. cd ..
  29. # Substitute the integer version into Libarchive's archive.h
  30. perl -p -i -e "s/^(#define\tARCHIVE_VERSION_NUMBER).*/\$1 $VN/" libarchive/archive.h
  31. perl -p -i -e "s/^(#define\tARCHIVE_VERSION_STRING).*/\$1 \"libarchive $VS\"/" libarchive/archive.h
  32. # Substitute the string version into tar and cpio Makefiles
  33. perl -p -i -e "s/^(BSDTAR_VERSION_STRING)=.*/\$1=$VS/" tar/Makefile
  34. perl -p -i -e "s/^(BSDCPIO_VERSION_STRING)=.*/\$1=$VS/" cpio/Makefile
  35. # Substitute versions into configure.ac as well
  36. perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_S\]),.*\)/$1,['"$VS"'])/' configure.ac
  37. perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_N\]),.*\)/$1,['"$VN"'])/' configure.ac
  38. # Add a version notice to NEWS
  39. mv NEWS NEWS.bak
  40. chmod +w NEWS.bak
  41. echo > NEWS
  42. echo `date +"%b %d, %Y:"` libarchive $VS released >> NEWS
  43. cat NEWS.bak >> NEWS
  44. # Clean up first
  45. rm -rf /usr/obj`pwd`
  46. (cd examples/minitar && make cleandir && make clean)
  47. (cd libarchive && make cleandir && make clean)
  48. (cd libarchive/test && make cleandir && make clean && make list.h)
  49. (cd tar && make cleandir && make clean)
  50. # Build the libarchive distfile
  51. /bin/sh build/autogen.sh
  52. ./configure
  53. make distcheck