1 #@ Makefile for S-nail.
2 #@ Adjustments have to be made in make.rc -- or on the command line.
3 #@ See the file INSTALL if you need help.
5 .PHONY
: ohno tangerine
all config build
install uninstall clean distclean test \
9 tangerine
: config build
test install
15 @
$(_prestop
); LC_ALL
=C
$${MAKE} -f .
/mk.mk
$(MAILJOBS
) all
16 install packager-install
: build
17 @
$(_prestop
); LC_ALL
=C
$${MAKE} -f .
/mk.mk DESTDIR
="$(DESTDIR)" install
19 @
$(_prestop
); LC_ALL
=C
$${MAKE} -f .
/mk.mk
uninstall
22 @
$(_prestop
); LC_ALL
=C
$${MAKE} -f .
/mk.mk
clean
24 @
$(_prestop
); LC_ALL
=C
$${MAKE} -f .
/mk.mk
distclean
27 @
$(_prestop
); LC_ALL
=C
$${MAKE} -f .
/mk.mk
test
30 @CONFIG
=DEVEL
; export CONFIG
; $(_prego
); $(_prestop
);\
31 LC_ALL
=C
$${MAKE} -f .
/mk.mk _update-version
&&\
32 LC_ALL
=C
$${MAKE} -f .
/mk.mk
$(MAILJOBS
) all
34 @CONFIG
=ODEVEL
; export CONFIG
; $(_prego
); $(_prestop
);\
35 LC_ALL
=C
$${MAKE} -f .
/mk.mk _update-version
&&\
36 LC_ALL
=C
$${MAKE} -f .
/mk.mk
$(MAILJOBS
) all
38 @
$(_prestop
); LC_ALL
=C
$${MAKE} -f .
/mk.mk _update-version
&&\
39 LC_ALL
=C
$${MAKE} -f .
/mk.mk
$(MAILJOBS
) all
42 LC_ALL
=C xgettext
--sort-by-file
--strict
--add-location \
43 --from-code
=UTF-8
--keyword
--keyword
=_
--keyword
=N_ \
44 --add-comments
=I18N
--foreign-user \
45 -o messages.pot
*.c
*.h
47 _prego
= SHELL
="$(SHELL)" MAKE
="$(MAKE)" \
48 CC
="$(CC)" CFLAGS
="$(CFLAGS)" LDFLAGS
="$(LDFLAGS)" \
49 $(SHELL
) .
/mk-conf.sh || exit
1
50 _prestop
= if
[ -f .
/mk.mk
]; then
:; else \
51 echo
'Program not configured, nothing to do';\
52 echo
'Use one of the targets: config, all, tangerine';\
55 < .
/config.ev read __ev__
; eval
$${__ev__}; unset __ev__
57 # Corresponds to same thing in mk-mk.in! (Except it is sed not $(sed))
58 _version_from_header
= VERSION
="`< version.h sed \
59 -e '/ VERSION /b X' -e d -e ':X' \
60 -e 's/[^\"]*\"v\([^\"]\{1,\}\)\"/\1/'`"
62 # This is pretty specific
64 @ORIG_LC_ALL
=${LC_ALL};\
65 LC_ALL
=C
; export LC_ALL
;\
66 : $${UAGENT
:=s-nail
};\
67 : $${UUAGENT
:=S-nail
};\
68 : $${UPLOAD
:=steffen@sdaoden.eu
:/var
/www
/localhost
/downloads
};\
70 DATE_MAN
="`date -u +'%b %d, %Y'`";\
71 DATE_ISO
="`date -u +%Y-%m-%d`";\
72 if
[ "`git rev-parse --verify HEAD`" != \
73 "`git rev-parse --verify master`" ]; then \
74 echo
>&2 'Not on the [master] branch';\
77 if
[ "`git status --porcelain --ignored |\
78 awk 'BEGIN{no=0}{++no}END{print no}'`" -ne
0 ]; then\
79 echo
>&2 'Directory not clean, see git status --ignored';\
82 echo
'Name of release tag:';\
84 echo
"Is $${UAGENT} <v$${REL}> correct? ENTER continues";\
87 git show announce
> "$${TMPDIR}/$${UAGENT}-$${REL}.ann.mail" &&\
89 grep
=grep sed
=sed cmp
=cmp mv
=mv \
90 VERSION
="$${REL}" $(MAKE
) -f mk-mk.in _update-version
&&\
91 $(_version_from_header
);\
94 < nail
.1 > nail
.1x awk
'\
95 BEGIN { written = 0 }\
96 /\.\\"--MKREL-START--/, /\.\\"--MKREL-END--/ {\
99 print ".\\\"--MKREL-START--";\
100 print ".\\\" '"$${UUAGENT}"'(1): v'"$${REL}"'" \
101 " / '"$${DATE_ISO}"'";\
102 print ".Dd '"$${DATE_MAN}"'";\
103 print ".ds VV \\\\%v'"$${REL}"'";\
104 print ".\\\"--MKREL-END--";\
109 mv
-f nail
.1x nail
.1 &&\
111 < nail.rc
> nail.rcx awk
'\
112 BEGIN { written = 0 }\
113 /^#--MKREL-START--/, /^#--MKREL-END--/ {\
116 print "#--MKREL-START--";\
118 "# '"$${UUAGENT}"'(1): v'"$${REL}"' / '"$${DATE_ISO}"'";\
119 print "#--MKREL-END--";\
124 mv
-f nail.rcx nail.rc
&&\
129 git add version.h nail
.1 nail.rc okeys.h tcaps.h
&&\
130 LC_ALL
=${ORIG_LC_ALL} git commit
-S
-m
"Bump $${UUAGENT} v$${REL}" &&\
131 LC_ALL
=${ORIG_LC_ALL} git tag
-s
-f
"v$${REL}" &&\
133 git update-ref refs
/heads
/next master
&&\
135 git checkout timeline
&&\
137 git archive
--format
=tar "v$${REL}" |
tar -x
-f
- &&\
140 rm -f .gitignore .mailmap TODO
&&\
141 sed
-E
-e
'/^\.\\"--MKREL-(START|END)--/d' \
142 -e
'/--BEGINSTRIP--/,$$ {' \
143 -e
'/^\.[[:space:]]*$$/d' -e
'/^\.[[:space:]]*\\"/d' \
145 -e
'/^\.$$/d' < nail
.1 > nail
.1x
&&\
146 mv
-f nail
.1x nail
.1 &&\
147 if command
-v mdocmx.sh
>/dev
/null
2>&1; then \
148 mdocmx.sh
< nail
.1 > nail
.1x
&&\
149 mv
-f nail
.1x nail
.1;\
151 sed
-Ee
'/^#--MKREL-(START|END)--/d' \
152 < nail.rc
> nail.rcx
&&\
153 mv
-f nail.rcx nail.rc \
156 .
/mk-okey-map.pl noverbose
&&\
157 .
/mk-tcap-map.pl noverbose
&&\
160 LC_ALL
=${ORIG_LC_ALL} \
161 git commit
-S
-m
"$${UUAGENT} v$${REL}, $${DATE_ISO}" &&\
162 LC_ALL
=${ORIG_LC_ALL} git tag
-s
-f
"v$${REL}.ar" &&\
164 git checkout master
&&\
165 git log
--no-walk
--decorate
--oneline
--branches
--remotes
&&\
167 echo
"Push git(1) repo? ENTER continues";\
171 git archive
--format
=tar --prefix="$${UAGENT}-$${REL}/" "v$${REL}.ar" |\
172 ( cd
"$${TMPDIR}" && tar -x
-f
- ) &&\
175 tar -c
-f
"$${UAGENT}-$${REL}.tar" "$${UAGENT}-$${REL}" &&\
176 openssl sha1
"$${UAGENT}-$${REL}.tar" >> \
177 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
178 openssl sha256
"$${UAGENT}-$${REL}.tar" >> \
179 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
180 openssl sha512
"$${UAGENT}-$${REL}.tar" >> \
181 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
182 gpg
--detach-sign
--armor
"$${UAGENT}-$${REL}.tar" 2>&1 &&\
183 cat
"$${UAGENT}-$${REL}.tar.asc" >> \
184 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
185 < "$${UAGENT}-$${REL}.tar" gzip
> "$${UAGENT}-$${REL}.tar.gz" &&\
186 < "$${UAGENT}-$${REL}.tar" xz
-e
-C sha256
> \
187 "$${UAGENT}-$${REL}.tar.xz" &&\
190 echo
"-put $${UAGENT}-$${REL}.tar";\
191 echo
"-rm $${UAGENT}-latest.tar";\
192 echo
"-ln $${UAGENT}-$${REL}.tar $${UAGENT}-latest.tar";\
193 echo
"-put $${UAGENT}-$${REL}.tar.gz";\
194 echo
"-rm $${UAGENT}-latest.tar.gz";\
195 echo
"-ln $${UAGENT}-$${REL}.tar.gz $${UAGENT}-latest.tar.gz";\
196 echo
"-put $${UAGENT}-$${REL}.tar.xz";\
197 echo
"-rm $${UAGENT}-latest.tar.xz";\
198 echo
"-ln $${UAGENT}-$${REL}.tar.xz $${UAGENT}-latest.tar.xz";\
199 echo
"-put $${UAGENT}-$${REL}.tar.asc";\
200 echo
"-rm $${UAGENT}-latest.tar.asc";\
201 echo
"-ln $${UAGENT}-$${REL}.tar.asc $${UAGENT}-latest.tar.asc";\
202 echo
"-chmod 0644 $${UAGENT}-$${REL}.tar*";\
204 sftp
-b
- $${UPLOAD} &&\
205 echo
'All seems fine';\
207 echo
'Really send announcement mail? ENTER continues';\
209 cd
"$${UAGENT}-$${REL}" &&\
210 make CONFIG
=MAXIMAL
all &&\
211 < "$${TMPDIR}/$${UAGENT}-$${REL}.ann.mail" \
212 LC_ALL
=${ORIG_LC_ALL} .
/$${UAGENT} -A
$${ACCOUNT} \
214 -s
"[ANN]ouncing $${UUAGENT} v$${REL}" \