diff options
author | H. Peter Anvin <hpa@zytor.com> | 2002-05-06 00:27:15 +0000 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2002-05-06 00:27:15 +0000 |
commit | c17471c38c8192d6f03fbeedbd754f3fb8a5b97a (patch) | |
tree | dee332d7312183e1bb28100d325ba38c8dbffcc3 /misc | |
parent | e388d5be4f08849c65fa6a3b0b55ede341ff27f0 (diff) | |
download | nasm-c17471c38c8192d6f03fbeedbd754f3fb8a5b97a.tar.gz |
Move the "makedist.sh" script to "misc"; label it with an "obsolete"
warning, and create new "release" script
Diffstat (limited to 'misc')
-rwxr-xr-x | misc/makedist.sh | 71 | ||||
-rwxr-xr-x | misc/release | 129 |
2 files changed, 200 insertions, 0 deletions
diff --git a/misc/makedist.sh b/misc/makedist.sh new file mode 100755 index 00000000..e24afdc1 --- /dev/null +++ b/misc/makedist.sh @@ -0,0 +1,71 @@ +#!/bin/sh +# * THIS SCRIPT IS OBSOLETE DO NOT USE * + +MAJORVER=`grep NASM_MAJOR_VER nasm.h | head -1 | cut -f3 -d' '` +MINORVER=`grep NASM_MINOR_VER nasm.h | head -1 | cut -f3 -d' '` +VERSION=`grep NASM_VER nasm.h | head -1 | cut -f3 -d' ' | sed s/\"//g` +DOSVERSION="${MAJORVER}${MINORVER}" +NASM_TAR_GZ=dist/nasm-${VERSION}.tar.gz +NASM_ZIP=dist/nasm${DOSVERSION}s.zip +NASM_DOS_ZIP=dist/nasm${DOSVERSION}.zip +NASM_DOC_ZIP=dist/nasm${DOSVERSION}d.zip + +if [ -d dist ]; then rm -rf dist; fi +if [ -d nasm-${VERSION} ]; then rm -rf nasm-${VERSION}; fi +if [ ! -d dist ]; then mkdir dist; fi +if [ -f dist/nasm.tar.gz ]; then rm dist/nasm.tar.gz; fi +mkdir nasm-${VERSION} +(cd nasm-${VERSION}; ln -s ../* .; + rm -f nasm-${VERSION} dist Checklist GNUmakefile) +find nasm-${VERSION}/ -follow -name GNUmakefile > tar-exclude +find nasm-${VERSION}/ -follow -name RCS >> tar-exclude +find nasm-${VERSION}/ -follow -name '*.exe' >> tar-exclude +find nasm-${VERSION}/ -follow -name '*.uu' >> tar-exclude +find nasm-${VERSION}/ -follow -name '*,v' >> tar-exclude +for i in nasm-${VERSION}/doc/{nasmdoc.hpj,nasmdoc.rtf,nasmdoc.texi,Readme}; + do echo $i; done >> tar-exclude +tar chvfX dist/nasm-${VERSION}.tar tar-exclude nasm-${VERSION} +rm -f tar-exclude +tar tf dist/nasm-${VERSION}.tar | (echo nasm.doc; sed \ + -e 's:^nasm-[^/]*/::' \ + -e 's:/$::' \ + -e '/install-sh/d' \ + -e '/makedist\.sh/d' \ + -e '/exasm\.zip/d' \ + -e '/config/d' \ + -e '/doc\/.*\.html/d' \ + -e '/doc\/Readme/d' \ + -e '/doc\/nasmdoc\.ps/d' \ + -e '/doc\/nasmdoc\.txt/d' \ + -e '/doc\/nasmdoc\.rtf/d' \ + -e '/doc\/nasmdoc\.hpj/d' \ + -e '/doc\/nasmdoc\.texi/d' \ + -e '/doc\/nasmdoc\.hlp/d' \ + -e '/doc\/nasm\.info/d' \ + ) | sort > zipfiles +sed \ + -e '/^[^\/]*\.\(c\|h\|pl\|bas\|dat\)$/d' \ + -e '/^doc\(\/.*\)\?/d' \ + -e '/standard\.mac/d' \ + -e '/Makefile/d' \ + -e '/rdoff/d' \ + < zipfiles > zipfiles.dos +gzip -9 dist/nasm-${VERSION}.tar +rm -rf nasm-${VERSION} +ln -s doc/nasmdoc.src nasm.doc +zip -l -k ${NASM_ZIP} `cat zipfiles` +zip -k ${NASM_ZIP} *.exe misc/exasm.zip +zip -l -k ${NASM_DOS_ZIP} `cat zipfiles.dos` +zip -k ${NASM_DOS_ZIP} *.exe misc/exasm.zip +rm -f nasm.doc +(cd doc; zip -l -k ../${NASM_DOC_ZIP} \ + Readme \ + nasmdoc.src rdsrc.pl \ + nasmdoc.txt \ + nasmdoc.ps \ + *.html + zip -k ../${NASM_DOC_ZIP} \ + nasmdoc.hlp \ + nasm.info) +rm -f zipfiles zipfiles.dos +echo Distributions complete. diff --git a/misc/release b/misc/release new file mode 100755 index 00000000..df782fc8 --- /dev/null +++ b/misc/release @@ -0,0 +1,129 @@ +#!/bin/bash -xe +# +# Generate a NASM release +# +# Usage: release {test|real} [branch] +# +# *** WARNING WARNING WARNING *** +# Make sure to execute this in an empty directory +# + +if [ -z "$SFUSER" ]; then + if [ -f "$HOME/.sfuser" ]; then + sfuser=`cat "$HOME/.sfuser"` + else + sfuser=`whoami` + fi +fi + +if [ -z "$1" ]; then + echo "Usage: $0 {test|real}" 1>&2 + exit 1 +fi + +if [ "$1" eq "real" ]; then + real=true +else + real=false +fi + +work=`pwd`/nasm-release.$$ +mkdir "$work" +cd "$work" + +if $real; then + # Need to tag the tree, use real account + CVS="cvs -z3 -d ${SFUSER}@cvs.nasm.sourceforge.net:/cvsroot/nasm" +else + # Don't need to tag the tree, can use anonymous + echo ':pserver:anonymous@cvs.nasm.sourceforge.net:/cvsroot/nasm A' > "$work"/cvspass + export CVS_PASSFILE="$work"/cvspass + CVS="cvs -z3 -d :pserver:anonymous@cvs.nasm.sourceforge.net:/cvsroot/nasm" +fi + +if [ -n "$2" ]; then + branchopt="-r $2" +fi + +rm -rf nasm* + +$CVS co $branchopt nasm +version=`cat nasm/version` +v1=`echo $version | cut -d. -f1` +v2=`echo $version | cut -d. -f2` +v3=`echo $version | cut -d. -f3` + +# Tag the tree as a release +if $real; then + cd nasm && $CVS tag -F -a nasm-`echo $version | sed -e 's/\./_/g'` +fi + +# Extract file names which have the -kb flag set, meaning they +# are binary files +bins="$work"/binaries +rm -f "$bins" +cd nasm +find . -type d -name CVS -print | ( + while read dir; do + xdir=`echo "$dir" | sed -e 's|^\./||' -e 's|/CVS$||'` + egrep '^/[^/]*/[^/]*/[^/]*/[^/]*-kb[^/]*/' < $dir/Entries | \ + cut -d/ -f2 | sed -e "s|^|$xdir/|" >> "$bins" + done +) +cd .. + +# We did "co" instead of "export" -- remove CVS directories +find nasm -type d -name CVS -print | xargs rm -rf + +# Create files which are in the release but automatically generated +cd nasm +autoconf +./configure --prefix=/usr/local +make dist +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}.zip ../nasm-${version}-xdoc.zip + +# Create tarfile (Unix convention: file includes prefix) +mv nasm nasm-$version +tar cvvf nasm-${version}.tar nasm-${version} +bzip2 -9k nasm-${version}.tar +gzip -9 nasm-${version}.tar +mv nasm-${version}.tar.gz nasm-${version}.tar.bz2 .. + +# Create zipfile (DOS convention: no prefix, convert file endings) +cd nasm-$version +zip -9Dlr ../../nasm-${version}.zip -x@"$bins" * # Text files +zip -9Dgr ../../nasm-${version}.zip -i@"$bins" * # 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 +cd .. + +# Remove non-documentation +cat main | xargs rm -f + +# Create doc tarfile +tar cvvf nasm-${version}-xdoc.tar nasm-${version}/doc +bzip2 -9k nasm-${version}-xdoc.tar +gzip -9 nasm-${version}-xdoc.tar +mv nasm-${version}-xdoc.tar.gz nasm-${version}-xdoc.tar.bz2 .. + +# Create doc zipfile (DOS convention: no prefix, convert file endings) +# (Note: generating Win .hlp files requires additional tools) +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" |