lighttpd 1.4.x https://www.lighttpd.net/
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.
 
 
 
 
 
 

295 lines
6.3 KiB

  1. #!/bin/bash
  2. SRCTEST=src/server.c
  3. PACKAGE=lighttpd
  4. BASEDOWNLOADURL="https://download.lighttpd.net/lighttpd/releases-1.4.x"
  5. SNAPSHOTURL="https://download.lighttpd.net/lighttpd/snapshots-1.4.x"
  6. if [[ "`id -un`" != "stbuehler" ]] && [[ -z "$AUTHOR" ]]; then
  7. export AUTHOR="gstrauss"
  8. export KEYID="AF16D0F0"
  9. fi
  10. AUTHOR="${AUTHOR:-stbuehler}"
  11. # may take one argument for prereleases like
  12. # ./packdist.sh [--nopack] rc1-r10
  13. syntax() {
  14. echo "./packdist.sh [--nopack] [--help] [~rc1]" >&2
  15. exit 2
  16. }
  17. if [ ! -f ${SRCTEST} ]; then
  18. echo "Current directory is not the source directory"
  19. exit 1
  20. fi
  21. dopack=1
  22. while [ $# -gt 0 ]; do
  23. case "$1" in
  24. "--nopack")
  25. dopack=0
  26. ;;
  27. "--help")
  28. syntax
  29. ;;
  30. "rc"*|"~rc"*)
  31. if [ -n "$append" ]; then
  32. echo "Only one append allowed" >&2
  33. syntax
  34. fi
  35. echo "Appending '$1'"
  36. append="$1"
  37. BASEDOWNLOADURL="${SNAPSHOTURL}"
  38. ;;
  39. *)
  40. echo "Unknown option '$1'" >&2
  41. syntax
  42. ;;
  43. esac
  44. shift
  45. done
  46. force() {
  47. "$@" || {
  48. echo "Command failed: $*"
  49. exit 1
  50. }
  51. }
  52. # summarize all changes since last release
  53. genchanges() {
  54. (
  55. cat ../NEWS | sed "/^- ${version}/,/^-/p;d" | sed "/^- /d;/^$/d" | sed -e 's/^ \*/\*/'
  56. ) > CHANGES
  57. return 0
  58. }
  59. # generate links in old textile format "text":url
  60. genlinks_changes() {
  61. local repourl ticketurl inf out
  62. repourl="https://redmine.lighttpd.net/projects/lighttpd/repository/revisions/"
  63. ticketurl="https://redmine.lighttpd.net/issues/"
  64. inf="$1"
  65. outf="$1".links
  66. (
  67. sed -e 's%\(https://[a-zA-Z0-9.:_/\-]\+\)%"\1":\1%g' |
  68. sed -e 's%#\([0-9]\+\)%"#\1":'"${ticketurl}"'\1%g' |
  69. sed -e 's%r\([0-9]\+\)%"r\1":'"${repourl}"'\1%g' |
  70. sed -e 's%\(CVE-[0-9\-]\+\)%"\1":https://cve.mitre.org/cgi-bin/cvename.cgi?name=\1%g' |
  71. cat
  72. ) < "$inf" > "$outf"
  73. }
  74. genlinks_downloads() {
  75. local repourl ticketurl inf out
  76. repourl="https://redmine.lighttpd.net/projects/lighttpd/repository/revisions/"
  77. ticketurl="https://redmine.lighttpd.net/issues/"
  78. inf="$1"
  79. outf="$1".links
  80. (
  81. sed -e 's%\(https://[a-zA-Z0-9.:_/\-]\+\)%"\1":\1%g' |
  82. cat
  83. ) < "$inf" > "$outf"
  84. }
  85. blog_post() {
  86. if [ -z "${append}" ]; then
  87. # release
  88. cat <<EOF
  89. ---
  90. layout: post
  91. title: ${version}
  92. author: $AUTHOR
  93. author_email: ${AUTHOR}@lighttpd.net
  94. categories:
  95. - download
  96. tags:
  97. - ${version}
  98. - lighttpd
  99. - releases
  100. ---
  101. {% excerpt %}
  102. TODO
  103. h2. Important changes
  104. TODO
  105. h2. Downloads
  106. EOF
  107. cat DOWNLOADS.links
  108. cat <<EOF
  109. {% endexcerpt %}
  110. h2. Changes from ${prevversion}
  111. EOF
  112. cat CHANGES.links
  113. else
  114. # pre release
  115. cat <<EOF
  116. ---
  117. layout: post
  118. title: 'PRE-RELEASE: lighttpd ${version}${append}'
  119. categories:
  120. - lighttpd
  121. tags:
  122. - '1.4'
  123. - ${version}
  124. - lighttpd
  125. - prerelease
  126. ---
  127. {% excerpt %}
  128. We would like to draw your attention to the latest pre-release of the stable 1.4 branch of lighttpd.
  129. You can get the pre-release from these urls:
  130. EOF
  131. cat DOWNLOADS.links
  132. cat <<EOF
  133. Please test it as much as possible and provide us with feedback.
  134. A lot of testing ensures a good release.
  135. <!-- TODO: describe major changes -->
  136. {% endexcerpt %}
  137. h4. Changes from ${prevversion}
  138. EOF
  139. cat CHANGES.links
  140. cat <<EOF
  141. If you want to get the latest source for any branch, you can get it from our svn repository.
  142. Documentation to do so can be obtained from this page: "DevelSubversion":https://redmine.lighttpd.net/projects/lighttpd/wiki/DevelSubversion
  143. Bug reports or feature requests can be filed in our ticket system: "New Issue":https://redmine.lighttpd.net/projects/lighttpd/issues/new
  144. Please make sure to check if there isn't a ticket already here: "Issues":https://redmine.lighttpd.net/projects/lighttpd/issues
  145. Perhaps you also want to have a look at our "download site":https://download.lighttpd.net/lighttpd/
  146. Thank you for flying light.
  147. EOF
  148. fi
  149. }
  150. if [ ${dopack} = "1" ]; then
  151. force ./autogen.sh
  152. if [ -d distbuild ]; then
  153. # make distcheck may leave readonly files
  154. chmod u+w -R distbuild
  155. rm -rf distbuild
  156. fi
  157. force mkdir distbuild
  158. force cd distbuild
  159. force ../configure --prefix=/usr
  160. # force make
  161. # force make check
  162. force make -j 4 distcheck
  163. force fakeroot make dist
  164. else
  165. force cd distbuild
  166. fi
  167. version=`./config.status -V | head -n 1 | cut -d' ' -f3`
  168. name="${PACKAGE}-${version}"
  169. if [ -n "${append}" ]; then
  170. cp "${name}.tar.gz" "${name}${append}.tar.gz"
  171. cp "${name}.tar.xz" "${name}${append}.tar.xz"
  172. name="${name}${append}"
  173. fi
  174. force sha256sum "${name}.tar."{gz,xz} > "${name}.sha256sum"
  175. rm -f "${name}".tar.*.asc
  176. force gpg ${KEYID:+-u "${KEYID}"} -a --output "${name}.tar.gz.asc" --detach-sig "${name}.tar.gz"
  177. force gpg ${KEYID:+-u "${KEYID}"} -a --output "${name}.tar.xz.asc" --detach-sig "${name}.tar.xz"
  178. (
  179. echo "* ${BASEDOWNLOADURL}/${name}.tar.gz"
  180. echo "** GPG signature: ${BASEDOWNLOADURL}/${name}.tar.gz.asc"
  181. echo "** SHA256: @$(sha256sum ${name}.tar.gz | cut -d' ' -f1)@"
  182. echo "* ${BASEDOWNLOADURL}/${name}.tar.xz"
  183. echo "** GPG signature: ${BASEDOWNLOADURL}/${name}.tar.xz.asc"
  184. echo "** SHA256: @$(sha256sum ${name}.tar.xz | cut -d' ' -f1)@"
  185. echo "* SHA256 checksums: ${BASEDOWNLOADURL}/${name}.sha256sum"
  186. ) > DOWNLOADS
  187. (
  188. echo "* \"${name}.tar.gz\":${BASEDOWNLOADURL}/${name}.tar.gz (\"GPG signature\":${BASEDOWNLOADURL}/${name}.tar.gz.asc)"
  189. echo "** SHA256: @$(sha256sum ${name}.tar.gz | cut -d' ' -f1)@"
  190. echo "* \"${name}.tar.xz\":${BASEDOWNLOADURL}/${name}.tar.xz (\"GPG signature\":${BASEDOWNLOADURL}/${name}.tar.xz.asc)"
  191. echo "** SHA256: @$(sha256sum ${name}.tar.xz | cut -d' ' -f1)@"
  192. echo "* \"SHA256 checksums\":${BASEDOWNLOADURL}/${name}.sha256sum"
  193. ) > DOWNLOADS.links
  194. force genchanges
  195. force genlinks_changes CHANGES
  196. #force genlinks_downloads DOWNLOADS
  197. prevversion="${version%.*}.$((${version##*.} - 1))"
  198. if [ -z "${append}" ]; then
  199. # only for Releases
  200. (
  201. cat <<EOF
  202. h1. Release Info
  203. * Version: ${version}
  204. * Previous version: [[Release-${prevversion//./_}|${prevversion}]]
  205. * Branch: 1.4
  206. * Status: stable
  207. * Release Purpose: bug fixes
  208. * Release manager: $AUTHOR
  209. * Released date: $(date +"%Y-%m-%d")
  210. h1. Important changes from ${prevversion}
  211. TODO
  212. h1. Downloads
  213. EOF
  214. cat DOWNLOADS
  215. cat <<EOF
  216. h1. Changes from ${prevversion}
  217. EOF
  218. cat CHANGES
  219. cat <<EOF
  220. h1. External references
  221. * https://www.lighttpd.net/$(date +"%Y/%-m/%-d")/${version}
  222. EOF
  223. ) > "Release-${version//./_}.page"
  224. cat "Release-${version//./_}.page"
  225. fi
  226. echo
  227. echo -------
  228. echo
  229. blog_post > $(date +"%Y-%m-%d")-"${version}.textile"
  230. cat $(date +"%Y-%m-%d")-"${version}.textile"
  231. echo
  232. echo -------
  233. echo
  234. echo wget "${BASEDOWNLOADURL}/${name}".'{tar.gz,tar.xz,sha256sum}; sha256sum -c '${name}'.sha256sum'