[Ovirt-devel] [PATCH PuppetInstaller] Add a rake file to build the rpms

Joey Boggs jboggs at redhat.com
Tue Dec 23 00:22:15 UTC 2008


ack'd all, tested and applied

Joey Boggs wrote:
> I applied this one earlier but since it didn't add the rakefile into 
> the repo it got ignored, but fixed that a few mins ago.
>
>
> Bryan Kearney wrote:
>> ---
>>  .gitignore  |    1 +
>>  rakefile.rb |   53 
>> +++++++++++++++++++++++++++++++++++++++++++++++++++++
>>  2 files changed, 54 insertions(+), 0 deletions(-)
>>  create mode 100644 .gitignore
>>  create mode 100644 rakefile.rb
>>
>> diff --git a/.gitignore b/.gitignore
>> new file mode 100644
>> index 0000000..5fff1d9
>> --- /dev/null
>> +++ b/.gitignore
>> @@ -0,0 +1 @@
>> +pkg
>> diff --git a/rakefile.rb b/rakefile.rb
>> new file mode 100644
>> index 0000000..a2fae18
>> --- /dev/null
>> +++ b/rakefile.rb
>> @@ -0,0 +1,53 @@
>> +# -*- ruby -*-
>> +# Rakefile: build appliance configuration engine rpms
>> +#
>> +# Copyright (C) 2007 Red Hat, Inc.
>> +#
>> +# Distributed under the GNU Lesser General Public License v2.1 or 
>> later.
>> +# See COPYING for details
>> +#
>> +# Bryan Kearney <bkearney at redhat.com>
>> +
>> +require 'rake/clean'
>> +require 'rake/rdoctask'
>> +require 'rake/testtask'
>> +require 'rake/packagetask'
>> +
>> +ROOT_DIR = File::expand_path(".")
>> +PKG_VERSION="0.0.94"
>> +PACKAGE_DIR = ROOT_DIR + "/pkg"
>> +
>> +#
>> +# Files to clean up
>> +#
>> +
>> +CLEAN.include("**/*~","pkg")
>> +
>> +
>> +# Packaging Tasks
>> +#
>> +Rake::PackageTask.new("ace-ovirt", PKG_VERSION) do |pkg|
>> +    pkg.need_tar_gz = true
>> +    pkg.package_files.include(Dir["ace-ovirt/**/*"])    +end +
>> +
>> +#
>> +# Tasks to build the rpms
>> +#
>> +
>> +# Set up the directories
>> +task :rpm => [ :package ] do |t|
>> +    Dir["*.spec"].each do |specfile|
>> +        spec = File.basename(specfile)
>> +        cp(specfile, "pkg")
>> +        puts("Building with spec file #{spec}")        +        
>> Dir::chdir("pkg") do |dir|
>> +            dir = File::expand_path(".")
>> +            system("rpmbuild --define '_topdir #{dir}' --define 
>> '_sourcedir #{dir}' --define '_srcrpmdir #{dir}' --define '_rpmdir 
>> #{dir}' --define '_builddir #{dir}' -ba #{spec} > 
>> #{spec}.rpmbuild.log 2>&1")
>> +            if $? != 0
>> +                raise "rpmbuild failed"
>> +            end
>> +        end
>> +    end
>> +end
>>   
>
> _______________________________________________
> Ovirt-devel mailing list
> Ovirt-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/ovirt-devel




More information about the ovirt-devel mailing list