make-config.in: complete path (leftover of [807f64e2], 2015-12-26!)
[s-mailx.git] / make-release.sh
blobd9e9080113421518466714fc008c4cd800128aa6
1 #!/bin/sh -
2 #@ make-release.sh: simple somewhat generic release builder
4 # In order to be able to remove the release scripts from the release tarball,
5 # we must delete them, which some shells may not like while they are running.
6 # So be safe and move instances temporarily to .git/, the .inc will remove them
7 if [ "`basename \`pwd\``" != .git ]; then
8 cp make-release.* .git/
9 cd .git
10 exec sh ./make-release.sh "${@}"
12 cd ..
14 ## Variables
16 : ${PROGRAM:=s-nail}
17 : ${UPROGRAM:=S-nail}
18 : ${MANUAL:=code-nail.html}
20 : ${UPLOAD:=steffen@sdaoden.eu:/var/www/localhost/downloads}
22 : ${MAILX:=s-nail -Snofollowup-to -Sreply-to=mailx -Ssmime-sign}
23 : ${ACCOUNT:=ich}
24 : ${MAILBCC:=mailx-announce-bcc}
25 : ${MAILTO:=mailx-announce}
28 have_perl=
29 if command -v perl >/dev/null 2>&1; then
30 have_perl=1
33 ## Hooks
35 current_version() {
36 VERSION=`TOPDIR= grep=${grep} sed=${sed} cmp=${cmp} mv=${mv} \
37 ${make} -f make-config.in _echo-version`
40 update_stable_hook() {
41 [ -n "${grappa}${have_perl}" ] || exit 86
44 echo 'gen-version.h: update'
45 TOPDIR= grep=${grep} sed=${sed} cmp=${cmp} mv=${mv} \
46 ${make} -f make-config.in _update-version
47 ${git} add gen-version.h
50 echo 'nail.1: expanding MKREL'
51 < nail.1 > nail.1x ${awk} '
52 BEGIN { written = 0 }
53 /\.\\"--MKREL-START--/, /\.\\"--MKREL-END--/ {
54 if (written++ != 0)
55 next
56 print ".\\\"--MKREL-START--"
57 print ".\\\"@ '"${UPROGRAM}"' v'"${REL}"' / '"${DATE_ISO}"'"
58 print ".Dd '"${DATE_MAN}"'"
59 print ".ds VV \\\\%v'"${REL}"'"
60 print ".\\\"--MKREL-END--"
61 next
63 {print}
64 ' &&
65 ${mv} -f nail.1x nail.1
66 ${git} add nail.1
69 if [ -z "${grappa}" ] && command -v groff >/dev/null 2>&1; then
70 echo 'NEWS: updating anchors'
71 < nail.1 ${SHELL} mdocmx.sh |
72 MDOCMX_ENABLE=1 groff -U -Tutf8 -mdoc \
73 -dmx-anchor-dump=/tmp/anchors -dmx-toc-force=tree >/dev/null
74 ${SHELL} make-news-anchors.sh /tmp/anchors < NEWS > NEWSx
75 ${mv} -f NEWSx NEWS
76 ${git} add NEWS
80 echo 'nail.rc: expanding MKREL'
81 < nail.rc > nail.rcx ${awk} '
82 BEGIN { written = 0 }
83 /^#--MKREL-START--/, /^#--MKREL-END--/ {
84 if (written++ != 0)
85 next
86 print "#--MKREL-START--"
87 print "#@ '"${UPROGRAM}"' v'"${REL}"' / '"${DATE_ISO}"'"
88 print "#--MKREL-END--"
89 next
91 {print}
92 ' &&
93 ${mv} -f nail.rcx nail.rc
94 ${git} add nail.rc
97 if [ -n "${have_perl}" ]; then
98 ${make} d-okeys && ${git} add gen-okeys.h
99 ${make} d-tcaps && ${git} add gen-tcaps.h
100 ${make} d-errors && ${git} add gen-errors.h
104 update_release_hook() {
106 echo 'nail.1: stripping MKREL etc.'
107 ${sed} -E -e '/^\.\\"--MKREL-(START|END)--/d' \
108 -e '/--BEGINSTRIP--/,$ {' \
109 -e '/^\.[[:space:]]*$/d' -e '/^\.[[:space:]]*\\"/d' \
110 -e '}' \
111 -e '/^\.$/d' \
112 < nail.1 > nail.1x
113 ${mv} -f nail.1x nail.1
114 ${SHELL} mdocmx.sh < nail.1 > nail.1x
115 ${mv} -f nail.1x nail.1
116 # And generate the HTML manual, while here
117 if [ -z "${grappa}" ] && command -v groff >/dev/null 2>&1; then
118 < nail.1 MDOCMX_ENABLE=1 groff -Thtml -mdoc > /tmp/nail-manual.html
120 ${git} add nail.1
123 echo 'nail.rc: stripping MKREL etc.'
124 ${sed} -Ee '/^#--MKREL-(START|END)--/d' < nail.rc > nail.rcx
125 ${mv} -f nail.rcx nail.rc
126 ${git} add nail.rc
128 if [ -n "${have_perl}" ]; then
129 ${make} d-okeys-nv && ${git} add gen-okeys.h
130 ${make} d-tcaps-nv && ${git} add gen-tcaps.h
131 ${make} d-errors-nv && ${git} add gen-errors.h
134 ${git} rm -f .gitignore .mailmap TODO \
135 make-release.* make-news-anchors.sh mdocmx.sh
138 . .git/make-release.inc
140 # s-sh-mode