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 _prego
= SHELL
="$(SHELL)" MAKE
="$(MAKE)" \
38 CC
="$(CC)" CFLAGS
="$(CFLAGS)" LDFLAGS
="$(LDFLAGS)" \
40 _prestop
= if
[ -f .
/mk.mk
]; then
:; else \
41 echo
'Program not configured, nothing to do';\
42 echo
'The following targets will work: config, [all], install';\
46 # Corresponds to same thing in mk-mk.in! (Except it is sed not $(sed))
47 _version_from_header
= VERSION
="`< version.h sed \
48 -e '/ VERSION /b X' -e d -e ':X' \
49 -e 's/[^\"]*\"v\([^\"]\{1,\}\)\"/\1/'`"
51 # This is pretty specific
53 @ORIG_LC_ALL
=${LC_ALL};\
54 LC_ALL
=C
; export LC_ALL
;\
55 : $${UAGENT
:=s-nail
};\
56 : $${UUAGENT
:=S-nail
};\
57 : $${UPLOAD
:=steffen@sdaoden.eu
:/var
/www
/localhost
/downloads
};\
59 DATE_MAN
="`date -u +'%b %d, %Y'`";\
60 DATE_ISO
="`date -u +%Y-%m-%d`";\
61 if
[ "`git rev-parse --verify HEAD`" != \
62 "`git rev-parse --verify master`" ]; then \
63 echo
>&2 'Not on the [master] branch';\
66 if
[ "`git status --porcelain --ignored |\
67 awk 'BEGIN{no=0}{++no}END{print no}'`" -ne
0 ]; then\
68 echo
>&2 'Directory not clean, see git status --ignored';\
71 echo
'Name of release tag:';\
73 echo
"Is $${UAGENT} <v$${REL}> correct? ENTER continues";\
76 git show announce
> "$${TMPDIR}/$${UAGENT}-$${REL}.ann.mail" &&\
78 grep
=grep sed
=sed cmp
=cmp mv
=mv \
79 VERSION
="$${REL}" $(MAKE
) -f mk-mk.in _update-version
&&\
80 $(_version_from_header
);\
83 < nail
.1 > nail
.1x awk
'\
84 BEGIN { written = 0 }\
85 /\.\\"--MKREL-START--/, /\.\\"--MKREL-END--/ {\
88 print ".\\\"--MKREL-START--";\
89 print ".\\\" '"$${UUAGENT}"'(1): v'"$${REL}"'" \
90 " / '"$${DATE_ISO}"'";\
91 print ".Dd '"$${DATE_MAN}"'";\
92 print ".ds VV \\\\%v'"$${REL}"'";\
93 print ".\\\"--MKREL-END--";\
98 mv
-f nail
.1x nail
.1 &&\
100 < nail.rc
> nail.rcx awk
'\
101 BEGIN { written = 0 }\
102 /^#--MKREL-START--/, /^#--MKREL-END--/ {\
105 print "#--MKREL-START--";\
107 "# '"$${UUAGENT}"'(1): v'"$${REL}"' / '"$${DATE_ISO}"'";\
108 print "#--MKREL-END--";\
113 mv
-f nail.rcx nail.rc
&&\
115 git add version.h nail
.1 nail.rc
&&\
116 LC_ALL
=${ORIG_LC_ALL} git commit
-S
-m
"Bump $${UUAGENT} v$${REL}" &&\
117 LC_ALL
=${ORIG_LC_ALL} git tag
-s
-f
"v$${REL}" &&\
119 git update-ref refs
/heads
/next master
&&\
121 git checkout timeline
&&\
123 git archive
--format
=tar "v$${REL}" |
tar -x
-f
- &&\
126 rm -f .gitignore .mailmap TODO
&&\
127 sed
-E
-e
'/^\.\\"--MKREL-(START|END)--/d' \
128 -e
'/--BEGINSTRIP--/,$$ {' \
129 -e
'/^\.[[:space:]]*$$/d' -e
'/^\.[[:space:]]*\\"/d' \
131 -e
'/^\.$$/d' < nail
.1 > nail
.1x
&&\
132 mv
-f nail
.1x nail
.1 &&\
133 if command
-v mdocmx.sh
>/dev
/null
2>&1; then \
134 mdocmx.sh
< nail
.1 > nail
.1x
&&\
135 mv
-f nail
.1x nail
.1;\
137 sed
-Ee
'/^#--MKREL-(START|END)--/d' \
138 < nail.rc
> nail.rcx
&&\
139 mv
-f nail.rcx nail.rc \
143 LC_ALL
=${ORIG_LC_ALL} \
144 git commit
-S
-m
"$${UUAGENT} v$${REL}, $${DATE_ISO}" &&\
145 LC_ALL
=${ORIG_LC_ALL} git tag
-s
-f
"v$${REL}.ar" &&\
147 git checkout master
&&\
148 git log
--no-walk
--decorate
--oneline
--branches
--remotes
&&\
150 echo
"Push git(1) repo? ENTER continues";\
154 git archive
--format
=tar --prefix="$${UAGENT}-$${REL}/" "v$${REL}.ar" |\
155 ( cd
"$${TMPDIR}" && tar -x
-f
- ) &&\
157 tar -c
-f
"$${UAGENT}-$${REL}.tar" "$${UAGENT}-$${REL}" &&\
159 openssl md5
"$${UAGENT}-$${REL}.tar" > \
160 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
161 openssl sha1
"$${UAGENT}-$${REL}.tar" >> \
162 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
163 openssl sha256
"$${UAGENT}-$${REL}.tar" >> \
164 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
165 gpg
--detach-sign
--armor
"$${UAGENT}-$${REL}.tar" 2>&1 &&\
166 cat
"$${UAGENT}-$${REL}.tar.asc" >> \
167 "$${UAGENT}-$${REL}.cksum" 2>&1 &&\
169 < "$${UAGENT}-$${REL}.tar" gzip
> "$${UAGENT}-$${REL}.tar.gz" &&\
170 < "$${UAGENT}-$${REL}.tar" xz
-e
-C sha256
> \
171 "$${UAGENT}-$${REL}.tar.xz" &&\
173 rm -f
"$${UAGENT}-$${REL}.tar" &&\
176 echo
"-put $${UAGENT}-$${REL}.tar.gz";\
177 echo
"-rm $${UAGENT}-latest.tar.gz";\
178 echo
"-ln $${UAGENT}-$${REL}.tar.gz $${UAGENT}-latest.tar.gz";\
179 echo
"-put $${UAGENT}-$${REL}.tar.xz";\
180 echo
"-rm $${UAGENT}-latest.tar.xz";\
181 echo
"-ln $${UAGENT}-$${REL}.tar.xz $${UAGENT}-latest.tar.xz";\
182 echo
"-put $${UAGENT}-$${REL}.tar.asc";\
183 echo
"-rm $${UAGENT}-latest.tar.asc";\
184 echo
"-ln $${UAGENT}-$${REL}.tar.asc $${UAGENT}-latest.tar.asc";\
185 echo
"-chmod 0644 $${UAGENT}-$${REL}.tar.*";\
187 sftp
-b
- $${UPLOAD} &&\
188 echo
'All seems fine';\
190 echo
'Really send announcement mail? ENTER continues';\
192 cd
"$${UAGENT}-$${REL}" &&\
193 make CONFIG
=MAXIMAL
all &&\
194 LC_ALL
=${ORIG_LC_ALL} .
/$${UAGENT} -A
$${ACCOUNT} \
195 -s
"[ANNOUNCE] of $${UUAGENT} v$${REL}" \
196 -q
"$${TMPDIR}/$${UAGENT}-$${REL}.ann.mail" \
197 -b mailx-announce-bcc mailx-announce
&&\