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
: all install uninstall clean distclean config build
test
9 @LC_ALL
=C
$(MAKE
) -f .
/mk.mk
all
11 @LC_ALL
=C
$(MAKE
) -f .
/mk.mk
install
13 @
$(_prestop
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk
uninstall
15 @
$(_prestop
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk
clean
17 @
$(_prestop
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk
distclean
22 @
$(_prestop
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk
all
24 @
$(_prestop
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk
test
25 doinstall packager-install
:
26 @
$(_prestop
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk DESTDIR
="$(DESTDIR)" install
29 @CONFIG
=DEVEL
; export CONFIG
;\
30 $(_prego
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk _update-version
&&\
31 LC_ALL
=C
$(MAKE
) -f .
/mk.mk
all
33 @CONFIG
=ODEVEL
; export CONFIG
;\
34 $(_prego
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk _update-version
&&\
35 LC_ALL
=C
$(MAKE
) -f .
/mk.mk
all
37 @
$(_prestop
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk _update-version
&&\
38 LC_ALL
=C
$(MAKE
) -f .
/mk.mk
all
40 _prego
= SHELL
="$(SHELL)" MAKE
="$(MAKE)" \
41 CC
="$(CC)" CFLAGS
="$(CFLAGS)" LDFLAGS
="$(LDFLAGS)" \
43 _prestop
= if
[ -f .
/mk.mk
]; then
:; else \
44 echo
'Program not configured, nothing to do';\
45 echo
'The following targets will work: config, [all], install';\
49 # Corresponds to same thing in mk-mk.in! (Except it is sed not $(sed))
50 _version_from_header
= VERSION
="`< version.h sed \
51 -e '/ VERSION /b X' -e d -e ':X' \
52 -e 's/[^\"]*\"v\([^\"]\{1,\}\)\"/\1/'`"
54 # This is pretty specific
56 @ORIG_LC_ALL
=${LC_ALL};\
57 LC_ALL
=C
; export LC_ALL
;\
58 : $${UAGENT
:=s-nail
};\
59 : $${UUAGENT
:=S-nail
};\
60 : $${UPLOAD
:=steffen@sdaoden.eu
:/var
/www
/localhost
/downloads
};\
62 DATE_MAN
="`date -u +'%b %d, %Y'`";\
63 DATE_ISO
="`date -u +%Y-%m-%d`";\
64 if
[ "`git rev-parse --verify HEAD`" != \
65 "`git rev-parse --verify master`" ]; then \
66 echo
>&2 'Not on the [master] branch';\
69 if
[ "`git status --porcelain --ignored |\
70 awk 'BEGIN{no=0}{++no}END{print no}'`" -ne
0 ]; then\
71 echo
>&2 'Directory not clean, see git status --ignored';\
74 echo
'Name of release tag:';\
76 echo
"Is $${UAGENT} <v$${REL}> correct? ENTER continues";\
79 git show announce
> "$${TMPDIR}/$${UAGENT}-$${REL}.ann.mail" &&\
81 grep
=grep sed
=sed cmp
=cmp mv
=mv \
82 VERSION
="$${REL}" $(MAKE
) -f mk-mk.in _update-version
&&\
83 $(_version_from_header
);\
86 < nail
.1 > nail
.1x awk
'\
87 BEGIN { written = 0 }\
88 /\.\\"--MKREL-START--/, /\.\\"--MKREL-END--/ {\
91 print ".\\\"--MKREL-START--";\
92 print ".\\\" '"$${UUAGENT}"'(1): v'"$${REL}"'" \
93 " / '"$${DATE_ISO}"'";\
94 print ".Dd '"$${DATE_MAN}"'";\
95 print ".ds VV \\\\%v'"$${REL}"'";\
96 print ".\\\"--MKREL-END--";\
101 mv
-f nail
.1x nail
.1 &&\
103 < nail.rc
> nail.rcx awk
'\
104 BEGIN { written = 0 }\
105 /^#--MKREL-START--/, /^#--MKREL-END--/ {\
108 print "#--MKREL-START--";\
110 "# '"$${UUAGENT}"'(1): v'"$${REL}"' / '"$${DATE_ISO}"'";\
111 print "#--MKREL-END--";\
116 mv
-f nail.rcx nail.rc
&&\
118 git add version.h nail
.1 nail.rc
&&\
119 LC_ALL
=${ORIG_LC_ALL} git commit
-S
-m
"Bump $${UUAGENT} v$${REL}" &&\
120 LC_ALL
=${ORIG_LC_ALL} git tag
-s
-f
"v$${REL}" &&\
122 git update-ref refs
/heads
/next master
&&\
124 git checkout timeline
&&\
126 git archive
--format
=tar "v$${REL}" |
tar -x
-f
- &&\
129 rm -f .gitignore .mailmap TODO
&&\
130 sed
-E
-e
'/^\.\\"--MKREL-(START|END)--/d' \
131 -e
'/--BEGINSTRIP--/,$$ {' \
132 -e
'/^\.[[:space:]]*$$/d' -e
'/^\.[[:space:]]*\\"/d' \
134 -e
'/^\.$$/d' < nail
.1 > nail
.1x
&&\
135 mv
-f nail
.1x nail
.1 &&\
136 if command
-v mdocmx.sh
>/dev
/null
2>&1; then \
137 mdocmx.sh
< nail
.1 > nail
.1x
&&\
138 mv
-f nail
.1x nail
.1;\
140 sed
-Ee
'/^#--MKREL-(START|END)--/d' \
141 < nail.rc
> nail.rcx
&&\
142 mv
-f nail.rcx nail.rc \
146 LC_ALL
=${ORIG_LC_ALL} \
147 git commit
-S
-m
"$${UUAGENT} v$${REL}, $${DATE_ISO}" &&\
148 LC_ALL
=${ORIG_LC_ALL} git tag
-s
-f
"v$${REL}.ar" &&\
150 git checkout master
&&\
151 git log
--no-walk
--decorate
--oneline
--branches
--remotes
&&\
153 echo
"Push git(1) repo? ENTER continues";\
157 git archive
--format
=tar --prefix="$${UAGENT}-$${REL}/" "v$${REL}.ar" |\
158 ( cd
"$${TMPDIR}" && tar -x
-f
- ) &&\
160 tar -c
-f
"$${UAGENT}-$${REL}.tar" "$${UAGENT}-$${REL}" &&\
162 openssl sha1
"$${UAGENT}-$${REL}.tar" >> \
163 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
164 openssl sha256
"$${UAGENT}-$${REL}.tar" >> \
165 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
166 openssl sha512
"$${UAGENT}-$${REL}.tar" >> \
167 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
168 gpg
--detach-sign
--armor
"$${UAGENT}-$${REL}.tar" 2>&1 &&\
169 cat
"$${UAGENT}-$${REL}.tar.asc" >> \
170 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
172 < "$${UAGENT}-$${REL}.tar" gzip
> "$${UAGENT}-$${REL}.tar.gz" &&\
173 < "$${UAGENT}-$${REL}.tar" xz
-e
-C sha256
> \
174 "$${UAGENT}-$${REL}.tar.xz" &&\
176 rm -f
"$${UAGENT}-$${REL}.tar" &&\
179 echo
"-put $${UAGENT}-$${REL}.tar.gz";\
180 echo
"-rm $${UAGENT}-latest.tar.gz";\
181 echo
"-ln $${UAGENT}-$${REL}.tar.gz $${UAGENT}-latest.tar.gz";\
182 echo
"-put $${UAGENT}-$${REL}.tar.xz";\
183 echo
"-rm $${UAGENT}-latest.tar.xz";\
184 echo
"-ln $${UAGENT}-$${REL}.tar.xz $${UAGENT}-latest.tar.xz";\
185 echo
"-put $${UAGENT}-$${REL}.tar.asc";\
186 echo
"-rm $${UAGENT}-latest.tar.asc";\
187 echo
"-ln $${UAGENT}-$${REL}.tar.asc $${UAGENT}-latest.tar.asc";\
188 echo
"-chmod 0644 $${UAGENT}-$${REL}.tar.*";\
190 sftp
-b
- $${UPLOAD} &&\
191 echo
'All seems fine';\
193 echo
'Really send announcement mail? ENTER continues';\
195 cd
"$${UAGENT}-$${REL}" &&\
196 make CONFIG
=MAXIMAL
all &&\
197 < "$${TMPDIR}/$${UAGENT}-$${REL}.ann.mail" \
198 LC_ALL
=${ORIG_LC_ALL} .
/$${UAGENT} -A
$${ACCOUNT} \
200 -s
"[ANN]ouncing $${UUAGENT} v$${REL}" \