`addrcodec': trim input, cannot do otherwise; fix IDNA with [f3852f88]
[s-mailx.git] / make-release.sh
blob4c81c4823cab3cddd683b95661e8816b893b1f96
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 < nail.1 > nail.1x awk '
35 BEGIN { written = 0 }
36 /\.\\"--MKREL-START--/, /\.\\"--MKREL-END--/ {
37 if (written++ != 0)
38 next
39 print ".\\\"--MKREL-START--"
40 print ".\\\"@ '"${UPROGRAM}"' v'"${REL}"' / '"${DATE_ISO}"'"
41 print ".Dd '"${DATE_MAN}"'"
42 print ".ds VV \\\\%v'"${REL}"'"
43 print ".\\\"--MKREL-END--"
44 next
46 {print}
47 ' &&
48 mv -f nail.1x nail.1
49 git add nail.1
52 if [ -f nail.rc ]; then
53 < nail.rc > nail.rcx awk '
54 BEGIN { written = 0 }
55 /^#--MKREL-START--/, /^#--MKREL-END--/ {
56 if (written++ != 0)
57 next
58 print "#--MKREL-START--"
59 print "#@ '"${UPROGRAM}"' v'"${REL}"' / '"${DATE_ISO}"'"
60 print "#--MKREL-END--"
61 next
63 {print}
64 ' &&
65 mv -f nail.rcx nail.rc
66 git add nail.rc
69 [ -f ./make-okey-map.pl ] && perl ./make-okey-map.pl && git add gen-okeys.h
70 [ -f ./make-tcap-map.pl ] && perl ./make-tcap-map.pl && git add gen-tcaps.h
71 [ -f ./make-errors.sh ] && sh ./make-errors.sh && git add gen-errors.h
74 update_release_hook() {
75 git rm -f make-news-anchors.sh
77 if [ -f nail.1 ]; then
78 sed -E -e '/^\.\\"--MKREL-(START|END)--/d' \
79 -e '/--BEGINSTRIP--/,$ {' \
80 -e '/^\.[[:space:]]*$/d' -e '/^\.[[:space:]]*\\"/d' \
81 -e '}' \
82 -e '/^\.$/d' \
83 < nail.1 > nail.1x
84 mv -f nail.1x nail.1
85 if command -v mdocmx.sh >/dev/null 2>&1; then
86 mdocmx.sh < nail.1 > nail.1x
87 mv -f nail.1x nail.1
89 git add nail.1
92 if [ -f nail.rc ]; then
93 sed -Ee '/^#--MKREL-(START|END)--/d' < nail.rc > nail.rcx
94 mv -f nail.rcx nail.rc
95 git add nail.rc
98 [ -f ./make-okey-map.pl ] &&
99 perl ./make-okey-map.pl noverbose && git add gen-okeys.h
100 [ -f ./make-tcap-map.pl ] &&
101 perl ./make-tcap-map.pl noverbose && git add gen-tcaps.h
102 [ -f ./make-errors.sh ] &&
103 sh ./make-errors.sh noverbose && git add gen-errors.h
106 . ./make-release.inc
108 # s-sh-mode