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.
 
 
 
 
 
 

156 lines
3.7 KiB

  1. #!/bin/bash
  2. SRCTEST=src/spawn-fcgi.c
  3. PACKAGE=spawn-fcgi
  4. # may take one argument for prereleases like
  5. # ./packdist.sh [--nopack] -rc1-r10
  6. tmpdir=$(mktemp --tmpdir -d packdist-XXXXXXX)
  7. trap 'rm -rf "${tmpdir}"' EXIT
  8. if [ ! -f ${SRCTEST} ]; then
  9. echo "Current directory is not the source directory"
  10. exit 1
  11. fi
  12. dopack=1
  13. if [ "$1" = "--nopack" ]; then
  14. dopack=0
  15. shift
  16. fi
  17. append="$1"
  18. force() {
  19. "$@" || {
  20. echo "Command failed: $*"
  21. exit 1
  22. }
  23. }
  24. # summarize all changes since last release
  25. genchanges() {
  26. (
  27. echo "h1. Changes"
  28. echo
  29. cat ../NEWS | sed "/^- ${version}/,/^-/p;d" | sed "/^- /d;/^$/d" | sed -e 's/^ \*/\*/'
  30. ) > CHANGES
  31. return 0
  32. }
  33. # genereate links in old textile format "text":url
  34. genlinks_changes() {
  35. local repourl ticketurl inf out
  36. repourl="http://redmine.lighttpd.net/projects/spawn-fcgi/repository/revisions/"
  37. ticketurl="http://redmine.lighttpd.net/issues/show/"
  38. inf="$1"
  39. outf="$1".links
  40. (
  41. sed -e 's%\(http://[a-zA-Z0-9.:_/\-]\+\)%"\1":\1%g' |
  42. sed -e 's%#\([0-9]\+\)%"#\1":'"${ticketurl}"'\1%g' |
  43. sed -e 's%r\([0-9]\+\)%"r\1":'"${repourl}"'\1%g'
  44. ) < "$inf" > "$outf"
  45. }
  46. genlinks_downloads() {
  47. local repourl ticketurl inf out
  48. repourl="http://redmine.lighttpd.net/projects/spawn-fcgi/repository/revisions/"
  49. ticketurl="http://redmine.lighttpd.net/issues/show/"
  50. inf="$1"
  51. outf="$1".links
  52. (
  53. sed -e 's%\(http://[a-zA-Z0-9.:_/\-]\+\)%"\1":\1%g'
  54. ) < "$inf" > "$outf"
  55. }
  56. if [ ${dopack} = "1" ]; then
  57. force ./autogen.sh
  58. if [ -d distbuild ]; then
  59. # make distcheck may leave readonly files
  60. chmod u+w -R distbuild
  61. rm -rf distbuild
  62. fi
  63. force mkdir distbuild
  64. force cd distbuild
  65. force ../configure --prefix=/usr
  66. # force make
  67. # force make check
  68. force make distcheck
  69. force make dist-gzip
  70. force make dist-bzip2
  71. force make dist-xz
  72. else
  73. force cd distbuild
  74. fi
  75. version=`./config.status -V | head -n 1 | cut -d' ' -f3`
  76. name="${PACKAGE}-${version}"
  77. if [ -x "$(which tardiff)" -a -x "$(which git)" ]; then
  78. force cd ..
  79. force git archive --format tar.gz -o "${tmpdir}/git-archive.tar.gz" --prefix "${name}/" HEAD
  80. force cd distbuild
  81. echo "Diff git -> dist tar"
  82. force tardiff --modified --autoskip "${tmpdir}/git-archive.tar.gz" "${name}.tar.gz"
  83. fi
  84. downloadbaseurl="http://download.lighttpd.net/spawn-fcgi/releases-1.6.x"
  85. if [ -n "${append}" ]; then
  86. cp "${name}.tar.gz" "${name}${append}.tar.gz"
  87. cp "${name}.tar.bz2" "${name}${append}.tar.bz2"
  88. cp "${name}.tar.xz" "${name}${append}.tar.xz"
  89. name="${name}${append}"
  90. downloadbaseurl="http://download.lighttpd.net/spawn-fcgi/snapshots-1.6.x"
  91. fi
  92. force sha256sum "${name}.tar."{gz,bz2,xz} > "${name}.sha256sum"
  93. rm -f "${name}".tar.*.asc
  94. force gpg -a --output "${name}.tar.gz.asc" --detach-sig "${name}.tar.gz"
  95. force gpg -a --output "${name}.tar.bz2.asc" --detach-sig "${name}.tar.bz2"
  96. force gpg -a --output "${name}.tar.xz.asc" --detach-sig "${name}.tar.xz"
  97. (
  98. echo "h1. Downloads"
  99. echo
  100. echo "* ${downloadbaseurl}/${name}.tar.gz"
  101. echo "** GPG signature: ${downloadbaseurl}/${name}.tar.gz.asc"
  102. echo "** SHA256: @$(sha256sum ${name}.tar.gz | cut -d' ' -f1)@"
  103. echo "* ${downloadbaseurl}/${name}.tar.bz2"
  104. echo "** GPG signature: ${downloadbaseurl}/${name}.tar.bz2.asc"
  105. echo "** SHA256: @$(sha256sum ${name}.tar.bz2 | cut -d' ' -f1)@"
  106. echo "* ${downloadbaseurl}/${name}.tar.xz"
  107. echo "** GPG signature: ${downloadbaseurl}/${name}.tar.xz.asc"
  108. echo "** SHA256: @$(sha256sum ${name}.tar.xz | cut -d' ' -f1)@"
  109. echo "* SHA256 checksums: ${downloadbaseurl}/${name}.sha256sum"
  110. ) > DOWNLOADS
  111. force genchanges
  112. force genlinks_changes CHANGES
  113. force genlinks_downloads DOWNLOADS
  114. cat CHANGES
  115. echo
  116. cat DOWNLOADS
  117. echo
  118. echo -------
  119. echo
  120. cat CHANGES.links
  121. echo
  122. cat DOWNLOADS.links
  123. echo
  124. echo -------
  125. echo
  126. echo wget "${downloadbaseurl}/${name}".'{tar.gz,tar.bz2,tar.xz,sha256sum}; sha256sum -c '${name}'.sha256sum'