Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,7 @@
test/unit/File/big-generated-file
*~
/test/unit/File/big-generated-file
/composer.lock
/vendor
defuse-crypto.phar
composer.phar
box.phar
7 changes: 4 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@
}
],
"autoload": {
"files": ["autoload.php"]
"classmap": ["src"]
},
"require": {
"php": ">=5.4.0",
"ext-openssl": "*"
"paragonie/random_compat": "~2.0",
"ext-openssl": "*",
"php": ">=5.4.0"
},
"require-dev": {
"nikic/php-parser": "^2.0"
Expand Down
38 changes: 38 additions & 0 deletions dist/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
TARGETS := defuse-crypto.phar

define install_tool
@echo 'Required tool \"$1\" not installed, see docs/InstallingAndVerifying.md'; false
endef
define which
$(shell PATH=$$PATH:. which $1.phar 2>/dev/null || which $1 2>/dev/null || { echo "$(call install_tool,$(1))"; })
endef
define find_tool
$(call which,$1)
endef

box := $(call find_tool,box)
composer := $(call find_tool,composer)
php := $(call find_tool,php)

all: dist-phar

phar: $(TARGETS)

composer.lock:
$(composer) install --no-dev

%.phar: dist/Makefile dist/box.json composer.lock
cp dist/box.json .
$(php) -d phar.readonly=0 $(box) build -c box.json -v

# ensure we run in clean tree. export git tree and run there.
dist-phar:
rm -rf worktree
install -d worktree
(cd $(CURDIR)/..; git archive HEAD) | tar -x -C worktree
$(MAKE) -f $(CURDIR)/Makefile -C worktree phar
mv worktree/*.phar .
rm -rf worktree

clean:
rm -vf $(TARGETS)
27 changes: 27 additions & 0 deletions dist/box.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"chmod": "0755",
"finder": [
{
"in": "src",
"name": "*.php",
"exclude": "random_compat"
},
{
"in": "vendor/composer",
"name": "*.php",
"exclude": "other"
},
{
"in": "vendor/paragonie",
"name": "*.php",
"exclude": "other"
}
],
"compactors": [
"Herrera\\Box\\Compactor\\Php"
],
"compression": "GZ",
"main": "vendor/autoload.php",
"output": "defuse-crypto.phar",
"stub": true
}