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
;\
31 $(_prego
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk _update-version
&&\
32 LC_ALL
=C
$(MAKE
) -f .
/mk.mk
$(MAILJOBS
) all
34 @CONFIG
=ODEVEL
; export CONFIG
;\
35 $(_prego
) && 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)" \
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';\
56 # Corresponds to same thing in mk-mk.in! (Except it is sed not $(sed))
57 _version_from_header
= VERSION
="`< version.h sed \
58 -e '/ VERSION /b X' -e d -e ':X' \
59 -e 's/[^\"]*\"v\([^\"]\{1,\}\)\"/\1/'`"
61 # This is pretty specific
63 @ORIG_LC_ALL
=${LC_ALL};\
64 LC_ALL
=C
; export LC_ALL
;\
65 : $${UAGENT
:=s-nail
};\
66 : $${UUAGENT
:=S-nail
};\
67 : $${UPLOAD
:=steffen@sdaoden.eu
:/var
/www
/localhost
/downloads
};\
69 DATE_MAN
="`date -u +'%b %d, %Y'`";\
70 DATE_ISO
="`date -u +%Y-%m-%d`";\
71 if
[ "`git rev-parse --verify HEAD`" != \
72 "`git rev-parse --verify master`" ]; then \
73 echo
>&2 'Not on the [master] branch';\
76 if
[ "`git status --porcelain --ignored |\
77 awk 'BEGIN{no=0}{++no}END{print no}'`" -ne
0 ]; then\
78 echo
>&2 'Directory not clean, see git status --ignored';\
81 echo
'Name of release tag:';\
83 echo
"Is $${UAGENT} <v$${REL}> correct? ENTER continues";\
86 git show announce
> "$${TMPDIR}/$${UAGENT}-$${REL}.ann.mail" &&\
88 grep
=grep sed
=sed cmp
=cmp mv
=mv \
89 VERSION
="$${REL}" $(MAKE
) -f mk-mk.in _update-version
&&\
90 $(_version_from_header
);\
93 < nail
.1 > nail
.1x awk
'\
94 BEGIN { written = 0 }\
95 /\.\\"--MKREL-START--/, /\.\\"--MKREL-END--/ {\
98 print ".\\\"--MKREL-START--";\
99 print ".\\\" '"$${UUAGENT}"'(1): v'"$${REL}"'" \
100 " / '"$${DATE_ISO}"'";\
101 print ".Dd '"$${DATE_MAN}"'";\
102 print ".ds VV \\\\%v'"$${REL}"'";\
103 print ".\\\"--MKREL-END--";\
108 mv
-f nail
.1x nail
.1 &&\
110 < nail.rc
> nail.rcx awk
'\
111 BEGIN { written = 0 }\
112 /^#--MKREL-START--/, /^#--MKREL-END--/ {\
115 print "#--MKREL-START--";\
117 "# '"$${UUAGENT}"'(1): v'"$${REL}"' / '"$${DATE_ISO}"'";\
118 print "#--MKREL-END--";\
123 mv
-f nail.rcx nail.rc
&&\
128 git add version.h nail
.1 nail.rc okeys.h tcaps.h
&&\
129 LC_ALL
=${ORIG_LC_ALL} git commit
-S
-m
"Bump $${UUAGENT} v$${REL}" &&\
130 LC_ALL
=${ORIG_LC_ALL} git tag
-s
-f
"v$${REL}" &&\
132 git update-ref refs
/heads
/next master
&&\
134 git checkout timeline
&&\
136 git archive
--format
=tar "v$${REL}" |
tar -x
-f
- &&\
139 rm -f .gitignore .mailmap TODO
&&\
140 sed
-E
-e
'/^\.\\"--MKREL-(START|END)--/d' \
141 -e
'/--BEGINSTRIP--/,$$ {' \
142 -e
'/^\.[[:space:]]*$$/d' -e
'/^\.[[:space:]]*\\"/d' \
144 -e
'/^\.$$/d' < nail
.1 > nail
.1x
&&\
145 mv
-f nail
.1x nail
.1 &&\
146 if command
-v mdocmx.sh
>/dev
/null
2>&1; then \
147 mdocmx.sh
< nail
.1 > nail
.1x
&&\
148 mv
-f nail
.1x nail
.1;\
150 sed
-Ee
'/^#--MKREL-(START|END)--/d' \
151 < nail.rc
> nail.rcx
&&\
152 mv
-f nail.rcx nail.rc \
155 .
/mk-okey-map.pl noverbose
&&\
156 .
/mk-tcap-map.pl noverbose
&&\
159 LC_ALL
=${ORIG_LC_ALL} \
160 git commit
-S
-m
"$${UUAGENT} v$${REL}, $${DATE_ISO}" &&\
161 LC_ALL
=${ORIG_LC_ALL} git tag
-s
-f
"v$${REL}.ar" &&\
163 git checkout master
&&\
164 git log
--no-walk
--decorate
--oneline
--branches
--remotes
&&\
166 echo
"Push git(1) repo? ENTER continues";\
170 git archive
--format
=tar --prefix="$${UAGENT}-$${REL}/" "v$${REL}.ar" |\
171 ( cd
"$${TMPDIR}" && tar -x
-f
- ) &&\
173 tar -c
-f
"$${UAGENT}-$${REL}.tar" "$${UAGENT}-$${REL}" &&\
175 openssl sha1
"$${UAGENT}-$${REL}.tar" >> \
176 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
177 openssl sha256
"$${UAGENT}-$${REL}.tar" >> \
178 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
179 openssl sha512
"$${UAGENT}-$${REL}.tar" >> \
180 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
181 gpg
--detach-sign
--armor
"$${UAGENT}-$${REL}.tar" 2>&1 &&\
182 cat
"$${UAGENT}-$${REL}.tar.asc" >> \
183 "$${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" &&\
189 rm -f
"$${UAGENT}-$${REL}.tar" &&\
192 echo
"-put $${UAGENT}-$${REL}.tar.gz";\
193 echo
"-rm $${UAGENT}-latest.tar.gz";\
194 echo
"-ln $${UAGENT}-$${REL}.tar.gz $${UAGENT}-latest.tar.gz";\
195 echo
"-put $${UAGENT}-$${REL}.tar.xz";\
196 echo
"-rm $${UAGENT}-latest.tar.xz";\
197 echo
"-ln $${UAGENT}-$${REL}.tar.xz $${UAGENT}-latest.tar.xz";\
198 echo
"-put $${UAGENT}-$${REL}.tar.asc";\
199 echo
"-rm $${UAGENT}-latest.tar.asc";\
200 echo
"-ln $${UAGENT}-$${REL}.tar.asc $${UAGENT}-latest.tar.asc";\
201 echo
"-chmod 0644 $${UAGENT}-$${REL}.tar.*";\
203 sftp
-b
- $${UPLOAD} &&\
204 echo
'All seems fine';\
206 echo
'Really send announcement mail? ENTER continues';\
208 cd
"$${UAGENT}-$${REL}" &&\
209 make CONFIG
=MAXIMAL
all &&\
210 < "$${TMPDIR}/$${UAGENT}-$${REL}.ann.mail" \
211 LC_ALL
=${ORIG_LC_ALL} .
/$${UAGENT} -A
$${ACCOUNT} \
213 -s
"[ANN]ouncing $${UUAGENT} v$${REL}" \