3 # Generate a NASM release
5 # Usage: release version [destination]
10 echo "Usage: $0 version [destination]" 1>&2
15 if [ -z "$WHERE" ]; then
19 if [ -n "$GIT_DIR" ]; then
25 if [ x
`cat version` != x
"${version}" ]; then
26 echo "${version}" > version
27 git update-index version
28 git commit
-m "Version ${version}" -- version
30 git tag
-m "NASM version ${version}" -f "nasm-${version}"
38 git clone
-s -l "$HERE" nasm
39 rm -rf nasm
/.git nasm
/.gitignore
41 # Create files which are in the release but automatically generated
44 .
/configure
--prefix=/usr
/local
50 # Clean up any previous attempt
51 rm -f ..
/nasm-
"$version".
tar.gz ..
/nasm-
"$version"-xdoc.
tar.gz
52 rm -f ..
/nasm-
"$version".
tar.bz2 ..
/nasm-
"$version"-xdoc.
tar.bz2
53 rm -f ..
/nasm-
"$version".
tar.xz ..
/nasm-
"$version"-xdoc.
tar.xz
54 rm -f ..
/nasm-
"$version".
zip ..
/nasm-
"$version"-xdoc.
zip
56 # Create tarfile (Unix convention: file includes prefix)
57 mv nasm nasm-
"$version"
58 tar cvvf nasm-
"$version".
tar nasm-
"$version"
59 xz
-9ek nasm-
"$version".
tar
60 bzip2 -9k nasm-
"$version".
tar
61 gzip -9 nasm-
"$version".
tar
62 mv nasm-
"$version".
tar.gz nasm-
"$version".
tar.bz2 nasm-
"$version".
tar.xz ..
64 # Create zipfile (DOS convention: no prefix, convert file endings)
66 zip -9Dlr ..
/..
/nasm-
"$version".
zip * -x \
*.jpg
-x \
*.
zip -x \
*.ico
# Text files
67 zip -9Dgr ..
/..
/nasm-
"$version".
zip * -i \
*.jpg
-i \
*.
zip -i \
*.ico
# Binary files
70 # Record what we have already generated
71 find nasm-
"$version" -not -type d
-print > main
73 # Create documentation
75 .
/configure
--prefix=/usr
/local
77 # Remove intermediate files.
81 # Remove non-documentation
82 cat main |
xargs rm -f
83 # Delete empty subdirectories
84 find nasm-
"$version"/doc
-type d
-exec rmdir '{}' \
; 2>/dev
/null || true
87 tar cvvf nasm-
"$version"-xdoc.
tar nasm-
"$version"/doc
88 xz
-9ek nasm-
"$version"-xdoc.
tar
89 bzip2 -9k nasm-
"$version"-xdoc.
tar
90 gzip -9 nasm-
"$version"-xdoc.
tar
91 mv nasm-
"$version"-xdoc.
tar.gz nasm-
"$version"-xdoc.
tar.bz2 nasm-
"$version"-xdoc.
tar.xz ..
93 # Create doc zipfile (DOS convention: no prefix, convert file endings)
94 # (Note: generating Win .hlp files requires additional tools)
96 zip -9Dlr ..
/..
/nasm-
"$version"-xdoc.
zip doc
-x \
*.pdf
-x \
*.info\
*
97 zip -9Dgr ..
/..
/nasm-
"$version"-xdoc.
zip doc
-i \
*.pdf
-i \
*.info\
*