From: Loup Vaillant Date: Wed, 27 Jun 2018 09:16:56 +0000 (+0200) Subject: Easier tarball generation X-Git-Url: https://git.codecow.com/?a=commitdiff_plain;h=29ce06e0c091c853d045c9478c8a0376975edc2b;p=Monocypher.git Easier tarball generation - TARBALL_VERSION now defaults to the contents of VERSION.md - TARBALL_DIR now defaults to the current directory - tarball_ignore is now included in the tarball (one can use the tarball to generate other tarballs). --- diff --git a/.gitignore b/.gitignore index 0f23b06..9f0a045 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,7 @@ *.profdata tests/formal-analysis/* tests/formal-analysis +*.tar.gz +monocypher-* doc/html/*.html tests/vectors.h diff --git a/README.md b/README.md index 6d3e600..4fc4938 100644 --- a/README.md +++ b/README.md @@ -152,16 +152,9 @@ that ship with the tarball releases: - The `test/vectors.h` header. Generating it requires Libsodium. Go to `test/gen/`, then run `make`. - - The html version of the manual, generated by the `doc/man2html.sh` script. You will need mandoc. -To generate a tarball, simply type `make tarball`. By default, it -will generate `../monocypher-master.tar.gz` (yes, in the parent -directory). You can override those defaults thus: - - make tarball TARBALL_VERSION=x.y.z TARBALL_DIR=../my_tarballs - -This will create a `../my_tarballs/monocypher-x.y.z.tar.gz`, archive -that contains a single `monocypher-x.y.z` folder with everything in -it. +To generate a tarball, simply type `make tarball`. It will make a +tarball with a name that matches the current version (as written in +VERSION.md), in the current directory. diff --git a/makefile b/makefile index 508a392..9d165e4 100644 --- a/makefile +++ b/makefile @@ -5,10 +5,8 @@ PREFIX=usr/local PKGCONFIG=$(DESTDIR)/$(PREFIX)/lib/pkgconfig MAN_DIR=$(DESTDIR)/$(PREFIX)/share/man/man3 -# override with x.y.z when making a proper tarball TARBALL_VERSION=$$(cat VERSION.md) -# avoids changing the current directory while we archive it -TARBALL_DIR=.. +TARBALL_DIR=. .PHONY: all library static-library dynamic-library \ install install-doc \ @@ -122,6 +120,7 @@ tests/vectors.h: tarball: tests/vectors.h doc/man2html.sh + touch $(TARBALL_DIR)/monocypher-$(TARBALL_VERSION).tar.gz tar -czvf $(TARBALL_DIR)/monocypher-$(TARBALL_VERSION).tar.gz \ -X tarball_ignore \ - --transform='flags=r;s|^.|monocypher-$(TARBALL_VERSION)|' . + --transform='flags=r;s|^.|monocypher-'$(TARBALL_VERSION)'|' . diff --git a/tarball_ignore b/tarball_ignore index 6f72ee6..32149b3 100644 --- a/tarball_ignore +++ b/tarball_ignore @@ -11,6 +11,7 @@ *.profdata tests/formal-analysis/* tests/formal-analysis -lib* +*.tar.gz +monocypher-* +lib/* .git* -tarball_ignore