| 1 | 1 |
new file mode 100644 |
| ... | ... |
@@ -0,0 +1,39 @@ |
| 1 |
+# This builds sodium-compat.phar. To run this Makefile, `box` and `composer` |
|
| 2 |
+# must be installed and in your $PATH. Run it from inside the dist/ directory. |
|
| 3 |
+ |
|
| 4 |
+box := $(shell which box) |
|
| 5 |
+composer := "composer" |
|
| 6 |
+gitcommit := $(shell git rev-parse HEAD) |
|
| 7 |
+ |
|
| 8 |
+.PHONY: all |
|
| 9 |
+all: build-phar |
|
| 10 |
+ |
|
| 11 |
+.PHONY: sign-phar |
|
| 12 |
+sign-phar: |
|
| 13 |
+ gpg -u 7F52D5C61D1255C731362E826B97A1C2826404DA --armor --output sodium-compat.phar.sig --detach-sig sodium-compat.phar |
|
| 14 |
+ |
|
| 15 |
+# ensure we run in clean tree. export git tree and run there. |
|
| 16 |
+.PHONY: build-phar |
|
| 17 |
+build-phar: |
|
| 18 |
+ @echo "Creating .phar from revision $(shell git rev-parse HEAD)." |
|
| 19 |
+ rm -rf worktree |
|
| 20 |
+ install -d worktree |
|
| 21 |
+ (cd $(CURDIR)/..; git archive HEAD) | tar -x -C worktree |
|
| 22 |
+ $(MAKE) -f $(CURDIR)/Makefile -C worktree sodium-compat.phar |
|
| 23 |
+ mv worktree/*.phar . |
|
| 24 |
+ rm -rf worktree |
|
| 25 |
+ |
|
| 26 |
+.PHONY: clean |
|
| 27 |
+clean: |
|
| 28 |
+ rm -vf sodium-compat.phar sodium-compat.phar.sig |
|
| 29 |
+ |
|
| 30 |
+# Inside workdir/: |
|
| 31 |
+ |
|
| 32 |
+sodium-compat.phar: dist/box.json composer.lock |
|
| 33 |
+ cp dist/box.json . |
|
| 34 |
+ php -d phar.readonly=0 $(box) build -c box.json -v |
|
| 35 |
+ |
|
| 36 |
+composer.lock: |
|
| 37 |
+ $(composer) config autoloader-suffix $(gitcommit) |
|
| 38 |
+ $(composer) install --no-dev |
|
| 39 |
+ |