aboutsummaryrefslogtreecommitdiffstats
path: root/tools/release
blob: f7025f13eca992b713e0c2e722df6f96ddd3ea62 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#!/bin/bash -xe
#
# Generate a NASM release
#
# Usage: release version [destination]
#

version="$1"
if [ -z "$1" ]; then
    echo "Usage: $0 version [destination]" 1>&2
    exit 1
fi

WHERE="$2"
if [ -z "$WHERE" ]; then
    WHERE=/var/tmp
fi

if [ -n "$GIT_DIR" ]; then
    HERE="$GIT_DIR"
else
    HERE=`pwd`
fi

if [ x`cat version` != x"${version}" ]; then
    echo "${version}" > version
    git update-index version
    git commit -m "Version ${version}" -- version
fi
git tag -m "NASM version ${version}" -f "nasm-${version}" 

cd "$WHERE"
rm -rf nasm-release.*
work=nasm-release.$$
mkdir $work
cd $work
unset GIT_DIR
git clone -s -l "$HERE" nasm
rm -rf nasm/.git nasm/.gitignore

# Create files which are in the release but automatically generated
cd nasm
./autogen.sh
./configure --prefix=/usr/local
make perlreq spec manpages
make alldeps
make distclean
cd ..

# Clean up any previous attempt
rm -f ../nasm-"$version".tar.gz  ../nasm-"$version"-xdoc.tar.gz
rm -f ../nasm-"$version".tar.bz2 ../nasm-"$version"-xdoc.tar.bz2
rm -f ../nasm-"$version".tar.xz  ../nasm-"$version"-xdoc.tar.xz
rm -f ../nasm-"$version".zip     ../nasm-"$version"-xdoc.zip

# Create tarfile (Unix convention: file includes prefix)
mv nasm nasm-"$version"
tar cvvf  nasm-"$version".tar nasm-"$version"
xz    -9ek nasm-"$version".tar
bzip2 -9k  nasm-"$version".tar
gzip  -9   nasm-"$version".tar
mv nasm-"$version".tar.gz nasm-"$version".tar.bz2 nasm-"$version".tar.xz ..

# Create zipfile (DOS convention: no prefix, convert file endings)
cd nasm-"$version"
zip -9Dlr ../../nasm-"$version".zip * -x \*.jpg -x \*.zip -x \*.ico	# Text files
zip -9Dgr ../../nasm-"$version".zip * -i \*.jpg -i \*.zip -i \*.ico	# Binary files
cd ..

# Record what we have already generated
find nasm-"$version" -not -type d -print > main

# Create documentation
cd nasm-"$version"
./configure --prefix=/usr/local
make doc
# Remove intermediate files.
make cleaner
cd ..

# Remove non-documentation
cat main | xargs rm -f
# Delete empty subdirectories
find nasm-"$version"/doc -type d -exec rmdir '{}' \; 2>/dev/null || true

# Create doc tarfile
tar cvvf nasm-"$version"-xdoc.tar nasm-"$version"/doc
xz    -9ek nasm-"$version"-xdoc.tar
bzip2 -9k  nasm-"$version"-xdoc.tar
gzip  -9   nasm-"$version"-xdoc.tar
mv nasm-"$version"-xdoc.tar.gz nasm-"$version"-xdoc.tar.bz2 nasm-"$version"-xdoc.tar.xz ..

# Create doc zipfile (DOS convention: no prefix, convert file endings)
cd nasm-"$version"
zip -9Dlr ../../nasm-"$version"-xdoc.zip doc -x \*.pdf
zip -9Dgr ../../nasm-"$version"-xdoc.zip doc -i \*.pdf

# Clean up
cd ../..
rm -rf "$work"