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
8 @LC_ALL
=C
$(MAKE
) -f .
/mk.mk
all
10 @LC_ALL
=C
$(MAKE
) -f .
/mk.mk
install
12 @
$(_prestop
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk
uninstall
14 @
$(_prestop
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk
clean
16 @
$(_prestop
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk
distclean
21 @
$(_prestop
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk
all
23 @
$(_prestop
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk
test
24 doinstall packager-install
:
25 @
$(_prestop
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk DESTDIR
="$(DESTDIR)" install
28 @CONFIG
=DEVEL
; export CONFIG
;\
29 $(_prego
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk _update-version
&&\
30 LC_ALL
=C
$(MAKE
) -f .
/mk.mk
all
32 @CONFIG
=ODEVEL
; export CONFIG
;\
33 $(_prego
) && LC_ALL
=C
$(MAKE
) -f .
/mk.mk _update-version
&&\
34 LC_ALL
=C
$(MAKE
) -f .
/mk.mk
all
36 _prego
= SHELL
="$(SHELL)" MAKE
="$(MAKE)" \
37 CC
="$(CC)" CFLAGS
="$(CFLAGS)" LDFLAGS
="$(LDFLAGS)" \
39 _prestop
= if
[ -f .
/mk.mk
]; then
:; else \
40 echo
'Program not configured, nothing to do';\
41 echo
'The following targets will work: install, all, config';\
45 # Corresponds to same thing in mk-mk.in! (Except it is sed not $(sed))
46 _version_from_header
= VERSION
="`< version.h sed \
47 -e '/ VERSION /b X' -e d -e ':X' \
48 -e 's/[^\"]*\"v\([^\"]\{1,\}\)\"/\1/'`"
50 # This is pretty specific
52 @ORIG_LC_ALL
=${LC_ALL};\
53 LC_ALL
=C
; export LC_ALL
;\
54 : $${UAGENT
:=s-nail
};\
55 : $${UUAGENT
:=S-nail
};\
56 : $${UPLOAD
:=sdaoden@frs.sourceforge.net
:/home
/frs
/project
/s-nail
};\
57 : $${ACCOUNT
:=sn_sf
};\
58 DATE_MAN
="`date -u +'%b %d, %Y'`";\
59 DATE_ISO
="`date -u +%Y-%m-%d`";\
60 if
[ "`git rev-parse --verify HEAD`" != \
61 "`git rev-parse --verify master`" ]; then \
62 echo
>&2 'Not on the [master] branch';\
65 if
[ "`git status --porcelain --ignored |\
66 awk 'BEGIN{no=0}{++no}END{print no}'`" -ne
0 ]; then\
67 echo
>&2 'Directory not clean, see git status --ignored';\
70 echo
'Name of release tag:';\
72 echo
"Is $${UAGENT} <v$${REL}> correct? ENTER continues";\
75 grep
=grep sed
=sed cmp
=cmp mv
=mv \
76 VERSION
="$${REL}" $(MAKE
) -f mk-mk.in _update-version
&&\
77 $(_version_from_header
);\
79 FREL
=`echo $${REL} | sed -e 's/\./_/g'`;\
81 < nail
.1 > nail
.1x awk
'\
82 BEGIN { written = 0 }\
83 /\.\\"--MKREL-START--/, /\.\\"--MKREL-END--/ {\
86 print ".\\\"--MKREL-START--";\
87 print ".\\\" '"$${UUAGENT}"'(1): v'"$${REL}"'" \
88 " / '"$${DATE_ISO}"'";\
89 print ".Dd '"$${DATE_MAN}"'";\
90 print ".ds VV \\\\%v'"$${REL}"'";\
91 print ".\\\"--MKREL-END--";\
96 mv
-f nail
.1x nail
.1 &&\
98 < nail.rc
> nail.rcx awk
'\
99 BEGIN { written = 0 }\
100 /^#--MKREL-START--/, /^#--MKREL-END--/ {\
103 print "#--MKREL-START--";\
105 "# '"$${UUAGENT}"'(1): v'"$${REL}"' / '"$${DATE_ISO}"'";\
106 print "#--MKREL-END--";\
111 mv
-f nail.rcx nail.rc
&&\
113 git add version.h nail
.1 nail.rc
&&\
114 git commit
-m
"Bump $${UUAGENT} v$${REL}" &&\
115 git tag
-s
-f
"v$${REL}" &&\
117 git update-ref refs
/heads
/next master
&&\
119 git checkout timeline
&&\
121 git archive
--format
=tar.gz
"v$${REL}" |
tar -x
-z
-f
- &&\
123 git commit
-m
"$${UAGENT} v$${REL}, $${DATE_ISO}" &&\
125 git checkout master
&&\
126 git log
--no-walk
--decorate
--oneline
--branches
--remotes
&&\
128 echo
"Push git(1) repo? ENTER continues";\
132 git archive
--format
=tar.gz
--prefix="$${UAGENT}-$${REL}/" \
133 -o
"$${TMPDIR}/$${UAGENT}-$${FREL}.tar.gz" "v$${REL}" &&\
135 tar -x
-z
-f
"$${UAGENT}-$${FREL}.tar.gz" &&\
136 rm -f
"$${UAGENT}-$${FREL}.tar.gz" &&\
138 cd
"$${UAGENT}-$${REL}" &&\
139 sed
-E
-e
'/^\.\\"--MKREL-(START|END)--/d' \
140 -e
'/--BEGINSTRIP--/,$$ {' \
141 -e
'/^\.[[:space:]]*$$/d' -e
'/^\.[[:space:]]*\\"/d' \
143 -e
'/^\.$$/d' < nail
.1 > nail
.1x
&&\
144 mv
-f nail
.1x nail
.1 &&\
145 if command
-v mdocmx.sh
>/dev
/null
2>&1; then \
146 mdocmx.sh
< nail
.1 > nail
.1x
&&\
147 mv
-f nail
.1x nail
.1;\
149 sed
-Ee
'/^#--MKREL-(START|END)--/d' \
150 < nail.rc
> nail.rcx
&&\
151 mv
-f nail.rcx nail.rc \
153 tar -c
-f
"$${UAGENT}-$${FREL}.tar" "$${UAGENT}-$${REL}" &&\
155 < "$${UAGENT}-$${FREL}.tar" gzip
> "$${UAGENT}-$${FREL}.tar.gz" &&\
156 < "$${UAGENT}-$${FREL}.tar" xz
-e
-C sha256
> \
157 "$${UAGENT}-$${FREL}.tar.xz" &&\
158 rm -f
"$${UAGENT}-$${FREL}.tar" &&\
159 openssl md5
"$${UAGENT}-$${FREL}.tar.gz" > \
160 "$${UAGENT}-$${FREL}.cksum" 2>&1 &&\
161 openssl sha1
"$${UAGENT}-$${FREL}.tar.gz" >> \
162 "$${UAGENT}-$${FREL}.cksum" 2>&1 &&\
163 openssl sha256
"$${UAGENT}-$${FREL}.tar.gz" >> \
164 "$${UAGENT}-$${FREL}.cksum" 2>&1 &&\
165 gpg
--detach-sign
--armor
"$${UAGENT}-$${FREL}.tar.gz" 2>&1 &&\
166 cat
"$${UAGENT}-$${FREL}.tar.gz.asc" >> \
167 "$${UAGENT}-$${FREL}.cksum" 2>&1 &&\
168 openssl md5
"$${UAGENT}-$${FREL}.tar.xz" >> \
169 "$${UAGENT}-$${FREL}.cksum" 2>&1 &&\
170 openssl sha1
"$${UAGENT}-$${FREL}.tar.xz" >> \
171 "$${UAGENT}-$${FREL}.cksum" 2>&1 &&\
172 openssl sha256
"$${UAGENT}-$${FREL}.tar.xz" >> \
173 "$${UAGENT}-$${FREL}.cksum" 2>&1 &&\
174 gpg
--detach-sign
--armor
"$${UAGENT}-$${FREL}.tar.xz" 2>&1 &&\
175 cat
"$${UAGENT}-$${FREL}.tar.xz.asc" >> \
176 "$${UAGENT}-$${FREL}.cksum" 2>&1 &&\
178 ( echo
"-put $${UAGENT}-$${FREL}.tar.gz";\
179 echo
"-put $${UAGENT}-$${FREL}.tar.gz.asc";\
180 echo
"-put $${UAGENT}-$${FREL}.tar.xz";\
181 echo
"-put $${UAGENT}-$${FREL}.tar.xz.asc" ) | \
182 sftp
-b
- $${UPLOAD} &&\
183 echo
'All seems fine';\
185 echo
'Really send announcement mail? ENTER continues';\
187 cd
"$${UAGENT}-$${REL}" &&\
188 make CONFIG
=MAXIMAL
&&\
189 LC_ALL
=${ORIG_LC_ALL} .
/$${UAGENT} -A
$${ACCOUNT} \
190 -s
"[ANNOUNCE] of $${UUAGENT} v$${REL}" \
191 -b nail-announce-bcc nail-announce
&&\
194 echo
"Really remove $${UAGENT}-$${REL} build dir? ENTER continues";\
196 rm -rf
"$${UAGENT}-$${REL}" &&\