]> Cypherpunks.ru repositories - gocheese.git/blobdiff - makedist.sh
Less hardcoded module name
[gocheese.git] / makedist.sh
index d43af8377ec6ca787ffecf3520e9c8e1c1eba3f7..b9e3d271f464a4a6fccd1a4216f8f9734f973045 100755 (executable)
@@ -4,12 +4,14 @@ cur=$(pwd)
 tmp=$(mktemp -d)
 release=$1
 [ -n "$release" ]
+MAKEINFO=${MAKEINFO:=makeinfo}
 
 git clone . $tmp/gocheese-$release
 cd $tmp/gocheese-$release
 git checkout v$release
 
-mod_name=$(sed -n 's/^module //p' go.mod)
+redo-ifchange module-name
+mod_name=`cat module-name`
 crypto_mod_path=$(sed -n 's#^require \(golang.org/x/crypto\) \(.*\)$#\1@\2#p' go.mod)
 mkdir -p src/$mod_name
 mv *.go go.mod go.sum src/$mod_name
@@ -65,14 +67,26 @@ rm -fr src/golang.org $tmp/includes
 mv $tmp/golang.org src
 
 cat > download.texi <<EOF
-@node Download
-@unnumbered Download
 You can obtain releases source code prepared tarballs on
-@url{http://gocheese.cypherpunks.ru/}.
+@url{http://www.gocheese.cypherpunks.ru/}.
 EOF
-make gocheese.info
+redo gocheese.info
 
-rm -rf .git .gitignore style.css makedist* www.mk
+texi=$(mktemp)
+cat > $texi <<EOF
+\input texinfo
+@documentencoding UTF-8
+@settitle INSTALL
+@include install.texi
+@bye
+EOF
+perl -i -p -e "s/.verbatiminclude PUBKEY.asc/Look in PUBKEY.asc file./" install.texi
+$MAKEINFO --plaintext -o INSTALL $texi
+rm $texi
+
+rm -rf .redo .git .gitignore style.css makedist.sh www.do module-name.do
+echo 'GOPATH=`pwd` ${GO:=go} build -o $3 -ldflags "-X main.Version=`cat VERSION`" `cat module-name`' > gocheese.do
+echo 'GOPATH=`pwd` ${GO:=go} test `cat module-name`/... >&2' > test.do
 
 find . -type d -exec chmod 755 {} \;
 find . -type f -exec chmod 644 {} \;
@@ -90,7 +104,7 @@ release_date=$(date "+%Y-%m-%d")
 
 cat <<EOF
 An entry for documentation:
-@item @ref{Release $release, $release} @tab $release_date @tab $size KiB
+@item $release @tab $release_date @tab $size KiB
 @tab @url{gocheese-${release}.tar.xz, link} @url{gocheese-${release}.tar.xz.sig, sign}
 @tab @code{$hash}
 EOF