Skip to content

Commit

Permalink
Merge branch 'packaging'
Browse files Browse the repository at this point in the history
  • Loading branch information
rilla committed Jan 30, 2015
2 parents 212a1e0 + 205d0ea commit 9f948ec
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 9 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -26,6 +26,7 @@ gem 'sdoc', '~> 0.4.0', group: :doc
gem 'bcrypt', '3.1.9'
gem 'sqlite3', '1.3.9'
gem 'nokogiri', '1.6.5'
gem 'RedCloth', '4.2.9'

# --------------------------------------------------------- Dradis dependencies

Expand Down
1 change: 1 addition & 0 deletions Gemfile.lock
Expand Up @@ -245,6 +245,7 @@ PLATFORMS
ruby

DEPENDENCIES
RedCloth (= 4.2.9)
acts_as_tree (~> 1.6)
bcrypt (= 3.1.9)
builder
Expand Down
29 changes: 20 additions & 9 deletions packaging/rake_rules.rb
Expand Up @@ -3,12 +3,13 @@

PACKAGE_NAME = "dradisframework"
VERSION = "3.0.0"
TRAVELING_RUBY_VERSION = "20141215-2.1.5"
TRAVELING_RUBY_VERSION = "20150130-2.1.5"

# Must match Gemfile:
SQLITE3_VERSION = "1.3.9"
NOKOGIRI_VERSION = "1.6.5"
BCRYPT_VERSION = "3.1.9"
REDCLOTH_VERSION = "4.2.9"

namespace :assets do
namespace :precompile do
Expand All @@ -30,7 +31,8 @@
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86.tar.gz",
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86-sqlite3-#{SQLITE3_VERSION}.tar.gz",
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86-nokogiri-#{NOKOGIRI_VERSION}.tar.gz",
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86-bcrypt-#{BCRYPT_VERSION}.tar.gz"
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86-bcrypt-#{BCRYPT_VERSION}.tar.gz",
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86-RedCloth-#{REDCLOTH_VERSION}.tar.gz"
] do
create_package("linux-x86")
end
Expand All @@ -41,7 +43,8 @@
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86_64.tar.gz",
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86_64-sqlite3-#{SQLITE3_VERSION}.tar.gz",
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86_64-nokogiri-#{NOKOGIRI_VERSION}.tar.gz",
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86_64-bcrypt-#{BCRYPT_VERSION}.tar.gz"
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86_64-bcrypt-#{BCRYPT_VERSION}.tar.gz",
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86_64-RedCloth-#{REDCLOTH_VERSION}.tar.gz"
] do
create_package("linux-x86_64")
end
Expand All @@ -53,7 +56,8 @@
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-osx.tar.gz",
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-osx-sqlite3-#{SQLITE3_VERSION}.tar.gz",
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-osx-nokogiri-#{NOKOGIRI_VERSION}.tar.gz",
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-osx-bcrypt-#{BCRYPT_VERSION}.tar.gz"
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-osx-bcrypt-#{BCRYPT_VERSION}.tar.gz",
"packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-osx-RedCloth-#{REDCLOTH_VERSION}.tar.gz"
] do
create_package("osx")
end
Expand Down Expand Up @@ -137,6 +141,18 @@
download_native_extension("osx", "bcrypt-#{BCRYPT_VERSION}")
end

file "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86-RedCloth-#{REDCLOTH_VERSION}.tar.gz" do
download_native_extension("linux-x86", "RedCloth-#{REDCLOTH_VERSION}")
end

file "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-linux-x86_64-RedCloth-#{REDCLOTH_VERSION}.tar.gz" do
download_native_extension("linux-x86_64", "RedCloth-#{REDCLOTH_VERSION}")
end

file "packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-osx-RedCloth-#{REDCLOTH_VERSION}.tar.gz" do
download_native_extension("osx", "RedCloth-#{REDCLOTH_VERSION}")
end

def create_package(target)
puts "\nCreating package #{ target }..."

Expand Down Expand Up @@ -174,11 +190,6 @@ def create_package(target)
sh "cp -r engines/core #{package_dir}/lib/vendor/engines"
sh "cp -r engines/frontend #{package_dir}/lib/vendor/engines"

# Temporarily disable RedCloth
# TODO: Remove when RedCloth packages are available
File.write(f = "#{package_dir}/lib/vendor/engines/frontend/dradis_frontend.gemspec", File.read(f).gsub("s.add_dependency 'RedCloth'","# s.add_dependency 'RedCloth'"))
File.write("#{package_dir}/lib/vendor/engines/frontend/lib/redcloth.rb", "class RedCloth;def initialize(*args);end;end")

sh "mkdir #{package_dir}/lib/vendor/.bundle"
sh "cp packaging/bundler-config #{package_dir}/lib/vendor/.bundle/config"
sh "tar -xzf packaging/traveling-ruby-#{TRAVELING_RUBY_VERSION}-#{target}-sqlite3-#{SQLITE3_VERSION}.tar.gz " +
Expand Down

0 comments on commit 9f948ec

Please sign in to comment.