nail.1: mail,reply,etc.: some errors depend on *expandaddr*
[s-mailx.git] / make-release.sh
blob55bedeeb2fb33de4cd82ec6bece7b9872a405f69
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 command -v perl >/dev/null 2>&1 || exit 42
16 ## Variables
18 : ${PROGRAM:=s-nail}
19 : ${UPROGRAM:=S-nail}
20 : ${MANUAL:=code-nail.html}
22 : ${UPLOAD:=steffen@sdaoden.eu:/var/www/localhost/downloads}
24 # Mail
25 : ${MAILX:=s-nail -Snofollowup-to -Sreply-to=mailx -Ssmime-sign}
26 : ${ACCOUNT:=ich}
27 : ${MAILBCC:=mailx-announce-bcc}
28 : ${MAILTO:=mailx-announce}
30 ## Hooks
32 update_stable_hook() {
33 if [ -f nail.1 ]; then
34 echo 'nail.1: expanding MKREL'
35 < nail.1 > nail.1x awk '
36 BEGIN { written = 0 }
37 /\.\\"--MKREL-START--/, /\.\\"--MKREL-END--/ {
38 if (written++ != 0)
39 next
40 print ".\\\"--MKREL-START--"
41 print ".\\\"@ '"${UPROGRAM}"' v'"${REL}"' / '"${DATE_ISO}"'"
42 print ".Dd '"${DATE_MAN}"'"
43 print ".ds VV \\\\%v'"${REL}"'"
44 print ".\\\"--MKREL-END--"
45 next
47 {print}
48 ' &&
49 mv -f nail.1x nail.1
50 git add nail.1
52 echo 'NEWS: updating anchors'
53 if command -v mdocmx.sh >/dev/null 2>&1 &&
54 command -v groff >/dev/null 2>&1; then
55 < nail.1 mdocmx.sh |
56 MDOCMX_ENABLE=1 groff -U -Tutf8 -mdoc \
57 -dmx-anchor-dump=/tmp/anchors -dmx-toc-force=tree >/dev/null
58 sh ./make-news-anchors.sh /tmp/anchors < NEWS > NEWSx
59 mv -f NEWSx NEWS
60 git add NEWS
64 if [ -f nail.rc ]; then
65 echo 'nail.rc: expanding MKREL'
66 < nail.rc > nail.rcx awk '
67 BEGIN { written = 0 }
68 /^#--MKREL-START--/, /^#--MKREL-END--/ {
69 if (written++ != 0)
70 next
71 print "#--MKREL-START--"
72 print "#@ '"${UPROGRAM}"' v'"${REL}"' / '"${DATE_ISO}"'"
73 print "#--MKREL-END--"
74 next
76 {print}
77 ' &&
78 mv -f nail.rcx nail.rc
79 git add nail.rc
82 [ -f ./make-okey-map.pl ] && perl ./make-okey-map.pl && git add gen-okeys.h
83 [ -f ./make-tcap-map.pl ] && perl ./make-tcap-map.pl && git add gen-tcaps.h
84 [ -f ./make-errors.sh ] && sh ./make-errors.sh && git add gen-errors.h
87 update_release_hook() {
88 git rm -f make-news-anchors.sh
90 if [ -f nail.1 ]; then
91 echo 'nail.1: stripping MKREL etc.'
92 sed -E -e '/^\.\\"--MKREL-(START|END)--/d' \
93 -e '/--BEGINSTRIP--/,$ {' \
94 -e '/^\.[[:space:]]*$/d' -e '/^\.[[:space:]]*\\"/d' \
95 -e '}' \
96 -e '/^\.$/d' \
97 < nail.1 > nail.1x
98 mv -f nail.1x nail.1
99 if command -v mdocmx.sh >/dev/null 2>&1; then
100 mdocmx.sh < nail.1 > nail.1x
101 mv -f nail.1x nail.1
102 # And generate the HTML manual, while here
103 < nail.1 MDOCMX_ENABLE=1 groff -Thtml -mdoc > /tmp/nail-manual.html
105 git add nail.1
108 if [ -f nail.rc ]; then
109 echo 'nail.rc: stripping MKREL etc.'
110 sed -Ee '/^#--MKREL-(START|END)--/d' < nail.rc > nail.rcx
111 mv -f nail.rcx nail.rc
112 git add nail.rc
115 [ -f ./make-okey-map.pl ] &&
116 perl ./make-okey-map.pl noverbose && git add gen-okeys.h
117 [ -f ./make-tcap-map.pl ] &&
118 perl ./make-tcap-map.pl noverbose && git add gen-tcaps.h
119 [ -f ./make-errors.sh ] &&
120 sh ./make-errors.sh noverbose && git add gen-errors.h
123 . ./make-release.inc
125 # s-sh-mode