vault-tree 0.3.4 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +3 -0
- data/.rspec +1 -0
- data/CHANGE_LOG.md +27 -0
- data/README.md +15 -73
- data/features/contracts/asymmetric_vault.feature +69 -2
- data/features/contracts/block_chain_key_transfer.feature +59 -0
- data/features/contracts/one_two_three.feature +109 -1
- data/features/contracts/readme.md +5 -6
- data/features/contracts_and_vaults.md +19 -24
- data/features/decision_tree.md +1 -1
- data/features/exceptions.feature +54 -43
- data/features/install_and_usage.md +38 -33
- data/features/keywords/assembled_shamir_key.feature +17 -17
- data/features/keywords/dh_key.feature +5 -5
- data/features/keywords/external_input.feature +35 -0
- data/features/keywords/external_key.feature +24 -0
- data/features/keywords/key.feature +3 -3
- data/features/keywords/random_number.feature +3 -3
- data/features/keywords/shamir_key_shares.feature +29 -0
- data/features/keywords/shamir_share.feature +40 -0
- data/features/keywords/split_key.feature +10 -9
- data/features/keywords/unlocked.feature +3 -3
- data/features/readme.md +1 -1
- data/features/steps/asymmetric_vault.steps.rb +14 -21
- data/features/steps/block_chain_key_transfer.steps.rb +17 -22
- data/features/steps/core.steps.rb +60 -71
- data/features/steps/exceptions.steps.rb +27 -64
- data/features/steps/external_input.steps.rb +17 -0
- data/features/steps/one_two_three.steps.rb +21 -27
- data/features/steps/secret_sharing.steps.rb +36 -19
- data/lib/vault-tree.rb +1 -1
- data/lib/vault-tree/contract/content_ciphertext.rb +33 -0
- data/lib/vault-tree/contract/content_plaintext.rb +33 -0
- data/lib/vault-tree/contract/contract.rb +15 -72
- data/lib/vault-tree/contract/contract_header.rb +11 -0
- data/lib/vault-tree/contract/vault.rb +24 -74
- data/lib/vault-tree/contract/vault_key.rb +21 -0
- data/lib/vault-tree/contract/vault_list.rb +56 -0
- data/lib/vault-tree/exceptions/empty_vault.rb +18 -3
- data/lib/vault-tree/exceptions/failed_lock_attempt.rb +18 -0
- data/lib/vault-tree/exceptions/failed_unlock_attempt.rb +23 -1
- data/lib/vault-tree/exceptions/invalid_external_input.rb +16 -0
- data/lib/vault-tree/exceptions/{missing_passphrase.rb → invalid_shamir_split.rb} +2 -1
- data/lib/vault-tree/exceptions/library_exception.rb +64 -0
- data/lib/vault-tree/exceptions/missing_partner_decryption_key.rb +11 -1
- data/lib/vault-tree/exceptions/unsupported_keyword.rb +17 -1
- data/lib/vault-tree/exceptions/vault_does_not_exist.rb +8 -1
- data/lib/vault-tree/keywords/assembled_shamir_key.rb +1 -1
- data/lib/vault-tree/keywords/contents.rb +1 -1
- data/lib/vault-tree/keywords/dh_key.rb +2 -2
- data/lib/vault-tree/keywords/external_input.rb +58 -0
- data/lib/vault-tree/keywords/external_key.rb +20 -0
- data/lib/vault-tree/keywords/key.rb +7 -1
- data/lib/vault-tree/keywords/keyword_interpreter.rb +5 -3
- data/lib/vault-tree/keywords/public_encryption_key.rb +1 -5
- data/lib/vault-tree/keywords/shamir_key_shares.rb +18 -0
- data/lib/vault-tree/keywords/shamir_share.rb +18 -0
- data/lib/vault-tree/keywords/split_key.rb +1 -1
- data/lib/vault-tree/lock_smith.rb +7 -8
- data/lib/vault-tree/lock_smith/{generated_shamir_key.rb → shamir_key_shares.rb} +22 -21
- data/lib/vault-tree/lock_smith/{split_key.rb → split_key_crypto.rb} +0 -0
- data/lib/vault-tree/version.rb +1 -1
- data/spec/assembled_shamir_key_spec.rb +0 -1
- data/spec/custom_exception_spec.rb +81 -0
- data/spec/lock_smith_spec.rb +0 -48
- data/spec/secret_sharing_spec.rb +0 -1
- data/spec/shamir_key_shares_spec.rb +27 -0
- data/vault-tree.gemspec +1 -1
- metadata +33 -139
- data/Gemfile.lock +0 -53
- data/VagrantFile +0 -30
- data/features/keywords/external_data.feature +0 -11
- data/features/keywords/generated_shamir_key.feature +0 -55
- data/features/keywords/master_passphrase.feature +0 -68
- data/features/manipulating_contracts.md +0 -84
- data/features/support/contract_fixtures/asymmetric_vault.0.1.0.json +0 -69
- data/features/support/contract_fixtures/blank_simple_test_contract.json +0 -14
- data/features/support/contract_fixtures/block_chain_key_transfer.0.1.0.json +0 -59
- data/features/support/contract_fixtures/broken_contract.json +0 -55
- data/features/support/contract_fixtures/one_two_three.0.7.0.json +0 -108
- data/features/support/contract_fixtures/simple_test_contract.json +0 -14
- data/features/support/contract_fixtures/template.json +0 -33
- data/lib/vault-tree/contract/close_validator.rb +0 -28
- data/lib/vault-tree/contract/doorman.rb +0 -113
- data/lib/vault-tree/contract/open_validator.rb +0 -20
- data/lib/vault-tree/exceptions/exception_template.erb +0 -0
- data/lib/vault-tree/exceptions/fill_attempt_master_password.rb +0 -6
- data/lib/vault-tree/exceptions/missing_external_data.rb +0 -6
- data/lib/vault-tree/exceptions/vault_tree_exception.rb +0 -25
- data/lib/vault-tree/keywords/external_data.rb +0 -32
- data/lib/vault-tree/keywords/generated_shamir_key.rb +0 -57
- data/lib/vault-tree/keywords/master_passphrase.rb +0 -9
- data/spec/generated_shamir_key_spec.rb +0 -52
- data/support/cookbooks/ark/.gitignore +0 -12
- data/support/cookbooks/ark/.kitchen.yml +0 -34
- data/support/cookbooks/ark/.travis.yml +0 -6
- data/support/cookbooks/ark/Berksfile +0 -9
- data/support/cookbooks/ark/CHANGELOG.md +0 -87
- data/support/cookbooks/ark/CONTRIBUTING.md +0 -257
- data/support/cookbooks/ark/README.md +0 -301
- data/support/cookbooks/ark/Rakefile +0 -36
- data/support/cookbooks/ark/TESTING.md +0 -25
- data/support/cookbooks/ark/Toftfile +0 -15
- data/support/cookbooks/ark/attributes/default.rb +0 -6
- data/support/cookbooks/ark/chefignore +0 -96
- data/support/cookbooks/ark/files/default/foo.tar.gz +0 -0
- data/support/cookbooks/ark/files/default/foo.tbz +0 -0
- data/support/cookbooks/ark/files/default/foo.tgz +0 -0
- data/support/cookbooks/ark/files/default/foo.zip +0 -0
- data/support/cookbooks/ark/files/default/tests/minitest/default_test.rb +0 -0
- data/support/cookbooks/ark/files/default/tests/minitest/support/helpers.rb +0 -0
- data/support/cookbooks/ark/files/default/tests/minitest/test_test.rb +0 -94
- data/support/cookbooks/ark/libraries/default.rb +0 -167
- data/support/cookbooks/ark/metadata.rb +0 -13
- data/support/cookbooks/ark/providers/default.rb +0 -370
- data/support/cookbooks/ark/recipes/default.rb +0 -31
- data/support/cookbooks/ark/recipes/test.rb +0 -138
- data/support/cookbooks/ark/resources/default.rb +0 -54
- data/support/cookbooks/ark/templates/default/add_to_path.sh.erb +0 -1
- data/support/cookbooks/ark/test/support/Gemfile +0 -4
- data/support/cookbooks/build-essential/README.md +0 -24
- data/support/cookbooks/build-essential/metadata.rb +0 -10
- data/support/cookbooks/build-essential/recipes/default.rb +0 -45
- data/support/cookbooks/chruby/.gitignore +0 -15
- data/support/cookbooks/chruby/.kitchen.yml +0 -26
- data/support/cookbooks/chruby/.ruby_version +0 -1
- data/support/cookbooks/chruby/Berksfile +0 -3
- data/support/cookbooks/chruby/Gemfile +0 -7
- data/support/cookbooks/chruby/LICENSE +0 -14
- data/support/cookbooks/chruby/README.md +0 -92
- data/support/cookbooks/chruby/Rakefile +0 -7
- data/support/cookbooks/chruby/Thorfile +0 -6
- data/support/cookbooks/chruby/Vagrantfile +0 -86
- data/support/cookbooks/chruby/attributes/default.rb +0 -10
- data/support/cookbooks/chruby/chefignore +0 -96
- data/support/cookbooks/chruby/metadata.rb +0 -11
- data/support/cookbooks/chruby/recipes/default.rb +0 -43
- data/support/cookbooks/chruby/recipes/system.rb +0 -25
- data/support/cookbooks/chruby/templates/default/chruby.sh.erb +0 -22
- data/support/cookbooks/chruby/test/integration/default/bash/embedded_test.sh +0 -1
- data/support/cookbooks/git/.gitignore +0 -14
- data/support/cookbooks/git/.kitchen.yml +0 -46
- data/support/cookbooks/git/Berksfile +0 -8
- data/support/cookbooks/git/CHANGELOG.md +0 -87
- data/support/cookbooks/git/CONTRIBUTING +0 -29
- data/support/cookbooks/git/Gemfile +0 -3
- data/support/cookbooks/git/LICENSE +0 -201
- data/support/cookbooks/git/README.md +0 -115
- data/support/cookbooks/git/TESTING.md +0 -25
- data/support/cookbooks/git/attributes/default.rb +0 -40
- data/support/cookbooks/git/metadata.rb +0 -35
- data/support/cookbooks/git/recipes/default.rb +0 -53
- data/support/cookbooks/git/recipes/server.rb +0 -58
- data/support/cookbooks/git/recipes/source.rb +0 -49
- data/support/cookbooks/git/recipes/windows.rb +0 -37
- data/support/cookbooks/git/templates/default/git-xinetd.d.erb +0 -10
- data/support/cookbooks/git/templates/default/sv-git-daemon-log-run.erb +0 -2
- data/support/cookbooks/git/templates/default/sv-git-daemon-run.erb +0 -3
- data/support/cookbooks/install_ruby/README.md +0 -3
- data/support/cookbooks/install_ruby/metadata.rb +0 -10
- data/support/cookbooks/install_ruby/recipes/default.rb +0 -14
- data/support/cookbooks/ruby_build/.gitignore +0 -6
- data/support/cookbooks/ruby_build/.kitchen.yml +0 -31
- data/support/cookbooks/ruby_build/.travis.yml +0 -4
- data/support/cookbooks/ruby_build/Berksfile +0 -10
- data/support/cookbooks/ruby_build/CHANGELOG.md +0 -72
- data/support/cookbooks/ruby_build/Gemfile +0 -14
- data/support/cookbooks/ruby_build/README.md +0 -338
- data/support/cookbooks/ruby_build/Rakefile +0 -21
- data/support/cookbooks/ruby_build/attributes/default.rb +0 -67
- data/support/cookbooks/ruby_build/chefignore +0 -53
- data/support/cookbooks/ruby_build/libraries/ruby_build_recipe_helpers.rb +0 -40
- data/support/cookbooks/ruby_build/metadata.rb +0 -18
- data/support/cookbooks/ruby_build/providers/ruby.rb +0 -88
- data/support/cookbooks/ruby_build/recipes/default.rb +0 -69
- data/support/cookbooks/ruby_build/resources/ruby.rb +0 -33
- data/support/cookbooks/ruby_build/test/cookbooks/alltherubies/metadata.rb +0 -10
- data/support/cookbooks/ruby_build/test/cookbooks/alltherubies/recipes/default.rb +0 -59
- data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/_verify_tests.bash +0 -33
- data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_1.8.7.bats +0 -29
- data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_1.9.2.bats +0 -18
- data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_1.9.3.bats +0 -18
- data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_2.0.0.bats +0 -18
- data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_jruby.bats +0 -20
- data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_rbx.bats +0 -18
- data/support/cookbooks/ruby_build/test/integration/alltherubies/bats/verify_ree.bats +0 -19
- data/support/cookbooks/ruby_build/test/integration/installation/bats/installation.bats +0 -6
- data/support/scripts/libsodium_ubuntu.sh +0 -80
- data/support/tasks/.gitkeep +0 -0
- data/support/tasks/libsodium_install.rb +0 -57
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
setup() {
|
|
2
|
-
export HOME=/root
|
|
3
|
-
export PATH="$ruby_root/bin:$PATH"
|
|
4
|
-
eval `$ruby_root/bin/ruby - <<EOF
|
|
5
|
-
require 'rubygems'
|
|
6
|
-
puts "export RUBY_ENGINE=#{defined?(RUBY_ENGINE) ? RUBY_ENGINE : 'ruby'};"
|
|
7
|
-
puts "export RUBY_VERSION=#{RUBY_VERSION};"
|
|
8
|
-
puts "export GEM_ROOT=#{Gem.default_dir.inspect};"
|
|
9
|
-
EOF`
|
|
10
|
-
export GEM_HOME="$HOME/.gem/$RUBY_ENGINE/$RUBY_VERSION"
|
|
11
|
-
export GEM_PATH="$GEM_HOME:$GEM_ROOT"
|
|
12
|
-
export PATH="$GEM_HOME/bin:$GEM_ROOT/bin:$PATH"
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
run_openssl_test() {
|
|
16
|
-
local script="puts OpenSSL::PKey::RSA.new(512).to_pem"
|
|
17
|
-
|
|
18
|
-
run ruby -ropenssl -e "$script"
|
|
19
|
-
[ $status -eq 0 ]
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
run_nokogiri_install_test() {
|
|
23
|
-
run gem install nokogiri --no-ri --no-rdoc
|
|
24
|
-
[ $status -eq 0 ]
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
run_nokogiri_openssl_test() {
|
|
28
|
-
local https_url="https://google.com"
|
|
29
|
-
local script="puts Nokogiri::HTML(open('$https_url')).css('input')"
|
|
30
|
-
|
|
31
|
-
run ruby -rrubygems -ropen-uri -rnokogiri -e "$script"
|
|
32
|
-
[ $status -eq 0 ]
|
|
33
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
export ruby_root="/home/app/.rubies/ruby-1.8.7-p371"
|
|
4
|
-
export def="$(basename $ruby_root)"
|
|
5
|
-
|
|
6
|
-
load _verify_tests
|
|
7
|
-
|
|
8
|
-
user_setup() {
|
|
9
|
-
export HOME="/home/app"
|
|
10
|
-
export GEM_HOME="$HOME/.gem/$RUBY_ENGINE/$RUBY_VERSION"
|
|
11
|
-
export GEM_PATH="$GEM_HOME:$GEM_ROOT"
|
|
12
|
-
export PATH="$GEM_HOME/bin:$GEM_ROOT/bin:$PATH"
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
@test "ruby $def can use openssl from stdlib" {
|
|
16
|
-
user_setup
|
|
17
|
-
run_openssl_test
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
@test "ruby $def can install nokogiri gem" {
|
|
21
|
-
user_setup
|
|
22
|
-
run_nokogiri_install_test
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
# pending
|
|
26
|
-
# @test "ruby $def can use nokogiri with openssl" {
|
|
27
|
-
# user_setup
|
|
28
|
-
# run_nokogiri_openssl_test
|
|
29
|
-
# }
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
export ruby_root="/usr/local/ruby/1.9.2-p320"
|
|
4
|
-
export def="$(basename $ruby_root)"
|
|
5
|
-
|
|
6
|
-
load _verify_tests
|
|
7
|
-
|
|
8
|
-
@test "Ruby $def can use openssl from stdlib" {
|
|
9
|
-
run_openssl_test
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@test "Ruby $def can install nokogiri gem" {
|
|
13
|
-
run_nokogiri_install_test
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@test "Ruby $def can use nokogiri with openssl" {
|
|
17
|
-
run_nokogiri_openssl_test
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
export ruby_root="/usr/local/ruby/1.9.3-p362"
|
|
4
|
-
export def="$(basename $ruby_root)"
|
|
5
|
-
|
|
6
|
-
load _verify_tests
|
|
7
|
-
|
|
8
|
-
@test "Ruby $def can use openssl from stdlib" {
|
|
9
|
-
run_openssl_test
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@test "Ruby $def can install nokogiri gem" {
|
|
13
|
-
run_nokogiri_install_test
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@test "Ruby $def can use nokogiri with openssl" {
|
|
17
|
-
run_nokogiri_openssl_test
|
|
18
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
export ruby_root="/usr/local/ruby/2.0.0-preview2"
|
|
4
|
-
export def="$(basename $ruby_root)"
|
|
5
|
-
|
|
6
|
-
load _verify_tests
|
|
7
|
-
|
|
8
|
-
@test "Ruby $def can use openssl from stdlib" {
|
|
9
|
-
run_openssl_test
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@test "Ruby $def can install nokogiri gem" {
|
|
13
|
-
run_nokogiri_install_test
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@test "Ruby $def can use nokogiri with openssl" {
|
|
17
|
-
run_nokogiri_openssl_test
|
|
18
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
export ruby_root="/usr/local/ruby/jruby-1.7.1"
|
|
4
|
-
export def="$(basename $ruby_root)"
|
|
5
|
-
|
|
6
|
-
load _verify_tests
|
|
7
|
-
|
|
8
|
-
@test "Ruby $def can use openssl from stdlib" {
|
|
9
|
-
run gem install jruby-openssl --no-ri --no-rdoc
|
|
10
|
-
[ $status -eq 0 ]
|
|
11
|
-
run_openssl_test
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
@test "Ruby $def can install nokogiri gem" {
|
|
15
|
-
run_nokogiri_install_test
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
@test "Ruby $def can use nokogiri with openssl" {
|
|
19
|
-
run_nokogiri_openssl_test
|
|
20
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
export ruby_root="/usr/local/ruby/rbx-2.0.0-rc1"
|
|
4
|
-
export def="$(basename $ruby_root)"
|
|
5
|
-
|
|
6
|
-
load _verify_tests
|
|
7
|
-
|
|
8
|
-
@test "ruby $def can use openssl from stdlib" {
|
|
9
|
-
run_openssl_test
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@test "ruby $def can install nokogiri gem" {
|
|
13
|
-
run_nokogiri_install_test
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
@test "ruby $def can use nokogiri with openssl" {
|
|
17
|
-
run_nokogiri_openssl_test
|
|
18
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bats
|
|
2
|
-
|
|
3
|
-
export ruby_root="/usr/local/ruby/ree-1.8.7-2012.02"
|
|
4
|
-
export def="$(basename $ruby_root)"
|
|
5
|
-
|
|
6
|
-
load _verify_tests
|
|
7
|
-
|
|
8
|
-
@test "ruby $def can use openssl from stdlib" {
|
|
9
|
-
run_openssl_test
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
@test "ruby $def can install nokogiri gem" {
|
|
13
|
-
run_nokogiri_install_test
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
# pending
|
|
17
|
-
# @test "ruby $def can use nokogiri with openssl" {
|
|
18
|
-
# run_nokogiri_openssl_test
|
|
19
|
-
# }
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
#Revision 1
|
|
3
|
-
#(c)2013 Uli Koehler. Licensed as CC-By-SA 3.0 DE.
|
|
4
|
-
# http://techoverflow.net/blog/2013/08/01/how-to-create-libsodium-nacl-deb-packages/
|
|
5
|
-
|
|
6
|
-
## ## ## ## ## ##
|
|
7
|
-
# INSTALL LIBSODIUM
|
|
8
|
-
# This is meant to be run in a Ubuntu Development VM.
|
|
9
|
-
#
|
|
10
|
-
# Don't run this on your development machine
|
|
11
|
-
# unless you've studied the script and you know what you are doing
|
|
12
|
-
## ## ## ## ## ##
|
|
13
|
-
|
|
14
|
-
# Make sure you have the latest packages
|
|
15
|
-
sudo apt-get update
|
|
16
|
-
|
|
17
|
-
# Before building it, you need to install the DEB build toolchain
|
|
18
|
-
sudo apt-get install devscripts debhelper build-essential
|
|
19
|
-
|
|
20
|
-
# Build and Install libsodium
|
|
21
|
-
export NAME=libsodium
|
|
22
|
-
export VERSION=0.4.3
|
|
23
|
-
export DEBVERSION=${VERSION}-1
|
|
24
|
-
#Download and extract the archive
|
|
25
|
-
if [ ! -f ${NAME}_${VERSION}.orig.tar.gz ]
|
|
26
|
-
then
|
|
27
|
-
wget "https://download.libsodium.org/libsodium/releases/${NAME}-${VERSION}.tar.gz" -O ${NAME}_${VERSION}.orig.tar.gz
|
|
28
|
-
fi
|
|
29
|
-
tar xzvf ${NAME}_${VERSION}.orig.tar.gz
|
|
30
|
-
cd ${NAME}-${VERSION}
|
|
31
|
-
rm -rf debian
|
|
32
|
-
mkdir -p debian
|
|
33
|
-
#Use the existing COPYING file
|
|
34
|
-
cp COPYING debian/copyright
|
|
35
|
-
#Create the changelog (no messages - dummy)
|
|
36
|
-
dch --create -v $DEBVERSION --package ${NAME} ""
|
|
37
|
-
#Create copyright file
|
|
38
|
-
cp COPYING debian/copyright
|
|
39
|
-
#Create control file
|
|
40
|
-
echo "Source: $NAME" > debian/control
|
|
41
|
-
echo "Maintainer: None <none@example.com>" >> debian/control
|
|
42
|
-
echo "Section: misc" >> debian/control
|
|
43
|
-
echo "Priority: optional" >> debian/control
|
|
44
|
-
echo "Standards-Version: 3.9.2" >> debian/control
|
|
45
|
-
echo "Build-Depends: debhelper (>= 8), devscripts, build-essential" >> debian/control
|
|
46
|
-
#Main library package
|
|
47
|
-
echo "" >> debian/control
|
|
48
|
-
echo "Package: $NAME" >> debian/control
|
|
49
|
-
echo "Architecture: any" >> debian/control
|
|
50
|
-
echo "Depends: ${shlibs:Depends}, ${misc:Depends}" >> debian/control
|
|
51
|
-
echo "Homepage: https://libsodium.org" >> debian/control
|
|
52
|
-
echo "Description: libsodium" >> debian/control
|
|
53
|
-
#dev package
|
|
54
|
-
echo "" >> debian/control
|
|
55
|
-
echo "Package: $NAME-dev" >> debian/control
|
|
56
|
-
echo "Architecture: all" >> debian/control
|
|
57
|
-
echo "Depends: ${shlibs:Depends}, ${misc:Depends}, libsodium(= $DEBVERSION)" >> debian/control
|
|
58
|
-
echo "Homepage: https://libsodium.org" >> debian/control
|
|
59
|
-
echo "Description: libsodium development files" >> debian/control
|
|
60
|
-
#Rules files
|
|
61
|
-
echo '#!/usr/bin/make -f' > debian/rules
|
|
62
|
-
echo '%:' >> debian/rules
|
|
63
|
-
echo -e '\tdh $@' >> debian/rules
|
|
64
|
-
echo 'override_dh_auto_configure:' >> debian/rules
|
|
65
|
-
echo -e "\t./configure --prefix=$(pwd)/debian/$NAME/usr" >> debian/rules
|
|
66
|
-
echo 'override_dh_auto_build:' >> debian/rules
|
|
67
|
-
echo -e '\tmake' >> debian/rules
|
|
68
|
-
echo 'override_dh_auto_install:' >> debian/rules
|
|
69
|
-
echo -e "\tmkdir -p debian/$NAME/usr debian/$NAME-dev/usr" >> debian/rules
|
|
70
|
-
echo -e "\tmake install" >> debian/rules
|
|
71
|
-
echo -e "\tmv debian/$NAME/usr/include debian/$NAME-dev/usr" >> debian/rules
|
|
72
|
-
#Create some misc files
|
|
73
|
-
mkdir -p debian/source
|
|
74
|
-
echo "8" > debian/compat
|
|
75
|
-
echo "3.0 (quilt)" > debian/source/format
|
|
76
|
-
#Build it
|
|
77
|
-
debuild -us -uc
|
|
78
|
-
|
|
79
|
-
#Install with the newly built package
|
|
80
|
-
sudo dpkg --install libsodium_0.4.2-1_amd64.deb
|
data/support/tasks/.gitkeep
DELETED
|
File without changes
|
|
@@ -1,57 +0,0 @@
|
|
|
1
|
-
# encoding: binary
|
|
2
|
-
require 'rake'
|
|
3
|
-
require 'rake/clean'
|
|
4
|
-
require 'digest/sha2'
|
|
5
|
-
|
|
6
|
-
LIBSODIUM_VERSION = "0.4.5"
|
|
7
|
-
LIBSODIUM_DIGEST = "7ad5202df53eeac0eb29b064ae5d05b65d82b2fc1c082899c9c6a09b0ee1ac32"
|
|
8
|
-
|
|
9
|
-
def sh_hidden(command)
|
|
10
|
-
STDERR.puts("*** Executing: #{command}")
|
|
11
|
-
output = `#{command}`
|
|
12
|
-
|
|
13
|
-
if !$?.success?
|
|
14
|
-
STDERR.puts "!!! Error executing: #{command}"
|
|
15
|
-
STDERR.puts output
|
|
16
|
-
exit 1
|
|
17
|
-
end
|
|
18
|
-
end
|
|
19
|
-
|
|
20
|
-
libsodium_tarball = "libsodium-#{LIBSODIUM_VERSION}.tar.gz"
|
|
21
|
-
|
|
22
|
-
file libsodium_tarball do
|
|
23
|
-
sh "curl -L -O https://github.com/jedisct1/libsodium/releases/download/#{LIBSODIUM_VERSION}/#{libsodium_tarball}"
|
|
24
|
-
|
|
25
|
-
digest = Digest::SHA256.hexdigest(File.read(libsodium_tarball))
|
|
26
|
-
if digest != LIBSODIUM_DIGEST
|
|
27
|
-
rm libsodium_tarball
|
|
28
|
-
raise "#{libsodium_tarball} failed checksum! Got #{digest}"
|
|
29
|
-
end
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
file "libsodium" => libsodium_tarball do
|
|
33
|
-
sh "tar -zxf #{libsodium_tarball}"
|
|
34
|
-
mv "libsodium-#{LIBSODIUM_VERSION}", "libsodium"
|
|
35
|
-
end
|
|
36
|
-
|
|
37
|
-
file "libsodium/Makefile" => "libsodium" do
|
|
38
|
-
sh_hidden "cd libsodium && ./configure"
|
|
39
|
-
end
|
|
40
|
-
|
|
41
|
-
file "libsodium/src/libsodium/.libs/libsodium.a" => "libsodium/Makefile" do
|
|
42
|
-
sh_hidden "cd libsodium && make"
|
|
43
|
-
end
|
|
44
|
-
|
|
45
|
-
if `uname` == 'Darwin'
|
|
46
|
-
libsodium_lib = "libsodium.bundle"
|
|
47
|
-
else
|
|
48
|
-
libsodium_lib = "libsodium.so"
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
file "libsodium/src/libsodium/.libs/#{libsodium_lib}" => "libsodium/src/libsodium/.libs/libsodium.a"
|
|
52
|
-
|
|
53
|
-
task :build_libsodium => "libsodium/src/libsodium/.libs/#{libsodium_lib}" do
|
|
54
|
-
$LIBSODIUM_PATH = "libsodium/src/libsodium/.libs/#{libsodium_lib}"
|
|
55
|
-
end
|
|
56
|
-
|
|
57
|
-
CLEAN.add "libsodium", "libsodium-*.tar.gz"
|