]> git.codecow.com Git - Monocypher.git/commitdiff
Easier tarball generation
authorLoup Vaillant <loup@loup-vaillant.fr>
Wed, 27 Jun 2018 09:16:56 +0000 (11:16 +0200)
committerLoup Vaillant <loup@loup-vaillant.fr>
Wed, 27 Jun 2018 09:25:57 +0000 (11:25 +0200)
- 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).

.gitignore
README.md
makefile
tarball_ignore

index 0f23b068ce53945ee25cd0b2246518350d2cf39e..9f0a0455d213fb6eb331a05cbe6b927782f47457 100644 (file)
@@ -11,5 +11,7 @@
 *.profdata
 tests/formal-analysis/*
 tests/formal-analysis
+*.tar.gz
+monocypher-*
 doc/html/*.html
 tests/vectors.h
index 6d3e60080059c76c1bbf2e6a0a79b3b4dc6cb52c..4fc4938394192658c8b2d4f81598ff253ab62749 100644 (file)
--- 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.
index 508a392a4abc7f4ff9238c6e90a946bcec2b1429..9d165e48b9e0854f3122040a64af12418ebefe58 100644 (file)
--- 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)'|' .
index 6f72ee66b84b5af1d29ff2ac30bbc4de5581c040..32149b356af60b11345152545beaad3e8b743c1a 100644 (file)
@@ -11,6 +11,7 @@
 *.profdata
 tests/formal-analysis/*
 tests/formal-analysis
-lib*
+*.tar.gz
+monocypher-*
+lib/*
 .git*
-tarball_ignore