disasm: introduce opy
[nasm/perl-rewrite.git] / misc / release
blobb5c43f84da862934e240fa2e308193865fe72b2c
1 #!/bin/bash -xe
3 # Generate a NASM release
5 # Usage: release version [destination]
8 version="$1"
9 if [ -z "$1" ]; then
10 echo "Usage: $0 version [destination]" 1>&2
11 exit 1
14 WHERE="$2"
15 if [ -z "$WHERE" ]; then
16 WHERE=/var/tmp
19 if [ -n "$GIT_DIR" ]; then
20 HERE="$GIT_DIR"
21 else
22 HERE=`pwd`
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}"
32 cd "$WHERE"
33 rm -rf nasm-release.*
34 work=nasm-release.$$
35 mkdir $work
36 cd $work
37 unset GIT_DIR
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
42 cd nasm
43 ./autogen.sh
44 ./configure --prefix=/usr/local
45 make perlreq spec
46 make alldeps
47 make distclean
48 cd ..
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".zip ../nasm-"$version"-xdoc.zip
55 # Create tarfile (Unix convention: file includes prefix)
56 mv nasm nasm-"$version"
57 tar cvvf nasm-"$version".tar nasm-"$version"
58 bzip2 -9k nasm-"$version".tar
59 gzip -9 nasm-"$version".tar
60 mv nasm-"$version".tar.gz nasm-"$version".tar.bz2 ..
62 # Create zipfile (DOS convention: no prefix, convert file endings)
63 cd nasm-"$version"
64 zip -9Dlr ../../nasm-"$version".zip * -x \*.jpg -x \*.zip # Text files
65 # zip -9Dgr ../../nasm-"$version".zip * -i \*.jpg -i \*.zip # Binary files
66 cd ..
68 # Record what we have already generated
69 find nasm-"$version" -not -type d -print > main
71 # Create documentation
72 cd nasm-"$version"
73 ./configure --prefix=/usr/local
74 make doc
75 # Remove intermediate files.
76 make cleaner
77 cd ..
79 # Remove non-documentation
80 cat main | xargs rm -f
82 # Create doc tarfile
83 tar cvvf nasm-"$version"-xdoc.tar nasm-"$version"/doc
84 bzip2 -9k nasm-"$version"-xdoc.tar
85 gzip -9 nasm-"$version"-xdoc.tar
86 mv nasm-"$version"-xdoc.tar.gz nasm-"$version"-xdoc.tar.bz2 ..
88 # Create doc zipfile (DOS convention: no prefix, convert file endings)
89 # (Note: generating Win .hlp files requires additional tools)
90 cd nasm-"$version"
91 zip -9Dlr ../../nasm-"$version"-xdoc.zip doc -x \*.pdf -x \*.info\*
92 zip -9Dgr ../../nasm-"$version"-xdoc.zip doc -i \*.pdf -i \*.info\*
94 # Clean up
95 cd ../..
96 rm -rf "$work"