[cmake] don't put date into config.h (not used anyway), only unset local vars for...
[lighttpd.git] / packdist.sh
blob1e1c4d8e91a101d1794e14c4e1aab53f19985397
1 #!/bin/bash
3 SRCTEST=src/server.c
4 PACKAGE=lighttpd
5 BASEDOWNLOADURL="http://download.lighttpd.net/lighttpd/releases-1.4.x"
6 SNAPSHOTURL="http://download.lighttpd.net/lighttpd/snapshots-1.4.x"
8 AUTHOR=stbuehler
10 # may take one argument for prereleases like
11 # ./packdist.sh [--nopack] rc1-r10
13 syntax() {
14 echo "./packdist.sh [--nopack] [--help] [~rc1]" >&2
15 exit 2
18 if [ ! -f ${SRCTEST} ]; then
19 echo "Current directory is not the source directory"
20 exit 1
23 dopack=1
25 while [ $# -gt 0 ]; do
26 case "$1" in
27 "--nopack")
28 dopack=0
30 "--help")
31 syntax
33 "rc"*|"~rc"*)
34 if [ -n "$append" ]; then
35 echo "Only one append allowed" >&2
36 syntax
38 echo "Appending '$1'"
39 append="$1"
40 BASEDOWNLOADURL="${SNAPSHOTURL}"
43 echo "Unknown option '$1'" >&2
44 syntax
46 esac
47 shift
48 done
50 force() {
51 "$@" || {
52 echo "Command failed: $*"
53 exit 1
57 # summarize all changes since last release
58 genchanges() {
60 cat ../NEWS | sed "/^- ${version}/,/^-/p;d" | sed "/^- /d;/^$/d" | sed -e 's/^ \*/\*/'
61 ) > CHANGES
62 return 0
65 # genereate links in old textile format "text":url
66 genlinks_changes() {
67 local repourl ticketurl inf out
68 repourl="http://redmine.lighttpd.net/projects/lighttpd/repository/revisions/"
69 ticketurl="http://redmine.lighttpd.net/issues/"
70 inf="$1"
71 outf="$1".links
73 sed -e 's%\(http://[a-zA-Z0-9.:_/\-]\+\)%"\1":\1%g' |
74 sed -e 's%#\([0-9]\+\)%"#\1":'"${ticketurl}"'\1%g' |
75 sed -e 's%r\([0-9]\+\)%"r\1":'"${repourl}"'\1%g' |
76 sed -e 's%\(CVE-[0-9\-]\+\)%"\1":http://cve.mitre.org/cgi-bin/cvename.cgi?name=\1%g' |
77 cat
78 ) < "$inf" > "$outf"
80 genlinks_downloads() {
81 local repourl ticketurl inf out
82 repourl="http://redmine.lighttpd.net/projects/lighttpd/repository/revisions/"
83 ticketurl="http://redmine.lighttpd.net/issues/"
84 inf="$1"
85 outf="$1".links
87 sed -e 's%\(http://[a-zA-Z0-9.:_/\-]\+\)%"\1":\1%g' |
88 cat
89 ) < "$inf" > "$outf"
92 blog_post() {
93 if [ -z "${append}" ]; then
94 # release
95 cat <<EOF
96 ---
97 layout: post
98 title: ${version}
99 author: $AUTHOR
100 author_email: ${AUTHOR}@lighttpd.net
101 categories:
102 - download
103 tags:
104 - ${version}
105 - lighttpd
106 - releases
108 {% excerpt %}
109 h2. Important changes
111 TODO
113 h2. Downloads
116 cat DOWNLOADS.links
117 cat <<EOF
119 {% endexcerpt %}
120 h2. Changes from ${prevversion}
123 cat CHANGES.links
124 else
125 # pre release
126 cat <<EOF
128 layout: post
129 title: 'PRE-RELEASE: lighttpd ${version}${append}'
130 categories:
131 - lighttpd
132 tags:
133 - '1.4'
134 - ${version}
135 - lighttpd
136 - prerelease
138 {% excerpt %}
139 We would like to draw your attention to the latest pre-release of the stable 1.4 branch of lighttpd.
141 You can get the pre-release from these urls:
143 cat DOWNLOADS.links
144 cat <<EOF
146 Please test it as much as possible and provide us with feedback.
147 A lot of testing ensures a good release.
149 <!-- TODO: describe major changes -->
151 {% endexcerpt %}
153 h4. Changes from ${prevversion}
156 cat CHANGES.links
158 cat <<EOF
160 If you want to get the latest source for any branch, you can get it from our svn repository.
161 Documentation to do so can be obtained from this page: "DevelSubversion":http://redmine.lighttpd.net/projects/lighttpd/wiki/DevelSubversion
162 Bug reports or feature requests can be filed in our ticket system: "New Issue":http://redmine.lighttpd.net/projects/lighttpd/issues/new
163 Please make sure to check if there isn't a ticket already here: "Issues":http://redmine.lighttpd.net/projects/lighttpd/issues
164 Perhaps you also want to have a look at our "download site":http://download.lighttpd.net/lighttpd/
166 Thank you for flying light.
171 if [ ${dopack} = "1" ]; then
172 force ./autogen.sh
174 if [ -d distbuild ]; then
175 # make distcheck may leave readonly files
176 chmod u+w -R distbuild
177 rm -rf distbuild
180 force mkdir distbuild
181 force cd distbuild
183 force ../configure --prefix=/usr
185 # force make
186 # force make check
188 force make distcheck
189 force make dist
190 else
191 force cd distbuild
194 version=`./config.status -V | head -n 1 | cut -d' ' -f3`
195 name="${PACKAGE}-${version}"
196 if [ -n "${append}" ]; then
197 cp "${name}.tar.gz" "${name}${append}.tar.gz"
198 cp "${name}.tar.xz" "${name}${append}.tar.xz"
199 name="${name}${append}"
202 force sha256sum "${name}.tar."{gz,xz} > "${name}.sha256sum"
204 rm -f "${name}".tar.*.asc
206 force gpg -a --output "${name}.tar.gz.asc" --detach-sig "${name}.tar.gz"
207 force gpg -a --output "${name}.tar.xz.asc" --detach-sig "${name}.tar.xz"
210 echo "* ${BASEDOWNLOADURL}/${name}.tar.gz"
211 echo "** GPG signature: ${BASEDOWNLOADURL}/${name}.tar.gz.asc"
212 echo "** SHA256: @$(sha256sum ${name}.tar.gz | cut -d' ' -f1)@"
213 echo "* ${BASEDOWNLOADURL}/${name}.tar.xz"
214 echo "** GPG signature: ${BASEDOWNLOADURL}/${name}.tar.xz.asc"
215 echo "** SHA256: @$(sha256sum ${name}.tar.xz | cut -d' ' -f1)@"
216 echo "* SHA256 checksums: ${BASEDOWNLOADURL}/${name}.sha256sum"
217 ) > DOWNLOADS
220 echo "* \"${name}.tar.gz\":${BASEDOWNLOADURL}/${name}.tar.gz (\"GPG signature\":${BASEDOWNLOADURL}/${name}.tar.gz.asc)"
221 echo "** SHA256: @$(sha256sum ${name}.tar.gz | cut -d' ' -f1)@"
222 echo "* \"${name}.tar.xz\":${BASEDOWNLOADURL}/${name}.tar.xz (\"GPG signature\":${BASEDOWNLOADURL}/${name}.tar.xz.asc)"
223 echo "** SHA256: @$(sha256sum ${name}.tar.xz | cut -d' ' -f1)@"
224 echo "* \"SHA256 checksums\":${BASEDOWNLOADURL}/${name}.sha256sum"
225 ) > DOWNLOADS.links
227 force genchanges
228 force genlinks_changes CHANGES
229 #force genlinks_downloads DOWNLOADS
231 prevversion="${version%.*}.$((${version##*.} - 1))"
233 if [ -z "${append}" ]; then
234 # only for Releases
236 cat <<EOF
237 h1. Release Info
239 * Version: ${version}
240 * Previous version: [[Release-${prevversion//./_}|${prevversion}]]
241 * Branch: 1.4
242 * Status: stable
243 * Release Purpose: bug fixes
244 * Release manager: $AUTHOR
245 * Released date: $(date +"%Y-%m-%d")
247 h1. Important changes from ${prevversion}
249 TODO
251 h1. Downloads
254 cat DOWNLOADS
255 cat <<EOF
257 h1. Changes from ${prevversion}
260 cat CHANGES
261 cat <<EOF
263 h1. External references
265 * http://www.lighttpd.net/$(date +"%Y/%m/%d")/${version//./-}
268 ) > "Release-${version//./_}.page"
270 cat "Release-${version//./_}.page"
273 echo
274 echo -------
275 echo
279 blog_post > $(date +"%Y-%m-%d")-"${version//./-}.textile"
280 cat $(date +"%Y-%m-%d")-"${version//./-}.textile"
282 echo
283 echo -------
284 echo
286 echo wget "${BASEDOWNLOADURL}/${name}".'{tar.gz,tar.xz,sha256sum}; sha256sum -c '${name}'.sha256sum'