[PATCH aeolus-image 1/2] Fix Rakefile to work on non-rpm systems.
Jason Guiditta
jguiditt at redhat.com
Tue Aug 28 17:23:46 UTC 2012
---
Rakefile | 19 ++++++++++---------
1 files changed, 10 insertions(+), 9 deletions(-)
diff --git a/Rakefile b/Rakefile
index 7af1507..515c681 100644
--- a/Rakefile
+++ b/Rakefile
@@ -19,13 +19,8 @@ require 'rubygems/package_task'
require 'rdoc/task'
require 'rake/testtask'
require 'rspec/core/rake_task'
-require './rake/rpmtask'
-RPMBUILD_DIR = "#{File.expand_path('~')}/rpmbuild"
-RPM_SPEC = "rubygem-aeolus-image.spec"
-RPM_SPEC_IN = "rubygem-aeolus-image.spec.in"
PKG_VERSION = "0.6.0"
-
spec = eval(File.read('aeolus-image.gemspec'))
Gem::PackageTask.new(spec) do |p|
@@ -51,8 +46,14 @@ RSpec::Core::RakeTask.new do |t|
t.pattern = FileList['spec/**/*.rb']
end
-Rake::RpmTask.new(RPM_SPEC, {:suffix => '.in', :pkg_version => PKG_VERSION}) do |rpm|
- rpm.need_tar = true
- rpm.package_files.include("lib/*")
- rpm.topdir = "#{RPMBUILD_DIR}"
+if File.exist?('/etc/rpm/macros.dist')
+ require './rake/rpmtask'
+ RPMBUILD_DIR = "#{File.expand_path('~')}/rpmbuild"
+ RPM_SPEC = "rubygem-aeolus-image.spec"
+ RPM_SPEC_IN = "rubygem-aeolus-image.spec.in"
+ Rake::RpmTask.new(RPM_SPEC, {:suffix => '.in', :pkg_version => PKG_VERSION}) do |rpm|
+ rpm.need_tar = true
+ rpm.package_files.include("lib/*")
+ rpm.topdir = "#{RPMBUILD_DIR}"
+ end
end
--
1.7.7.6
More information about the aeolus-devel
mailing list