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
/
10 exec sh make-release.sh
14 command -v perl
>/dev
/null
2>&1 ||
exit 42
20 : ${MANUAL:=code-nail.html}
22 : ${UPLOAD:=steffen@sdaoden.eu:/var/www/localhost/downloads}
25 : ${MAILX:=s-nail -Snofollowup-to -Sreply-to=mailx -Ssmime-sign}
27 : ${MAILBCC:=mailx-announce-bcc}
28 : ${MAILTO:=mailx-announce}
32 update_stable_hook
() {
33 if [ -f nail
.1 ]; then
34 echo 'nail.1: expanding MKREL'
35 < nail
.1 > nail
.1x
awk '
37 /\.\\"--MKREL-START--/, /\.\\"--MKREL-END--/ {
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--"
52 echo 'NEWS: updating anchors'
53 if command -v mdocmx.sh
>/dev
/null
2>&1 &&
54 command -v groff >/dev
/null
2>&1; then
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
64 if [ -f nail.rc
]; then
65 echo 'nail.rc: expanding MKREL'
66 < nail.rc
> nail.rcx
awk '
68 /^#--MKREL-START--/, /^#--MKREL-END--/ {
71 print "#--MKREL-START--"
72 print "#@ '"${UPROGRAM}"' v'"${REL}"' / '"${DATE_ISO}"'"
73 print "#--MKREL-END--"
78 mv -f nail.rcx 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' \
99 if command -v mdocmx.sh
>/dev
/null
2>&1; then
100 mdocmx.sh
< nail
.1 > nail
.1x
102 # And generate the HTML manual, while here
103 < nail
.1 MDOCMX_ENABLE
=1 groff -Thtml -mdoc > /tmp
/nail-manual.html
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
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