autobuild 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,10 @@
1
- = Autobuild ChangeLog
1
+ == Version 0.6.3
2
+
3
+ * CVS and SVN importing plugins check that the current working copy comes from
4
+ the right source
5
+ * the autotools and genom package are now reconfiguring if the flags
6
+ (configureflags and/or genomflags) changed
7
+ * bugfixes
2
8
 
3
9
  == Version 0.6.2
4
10
 
data/Manifest.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  bin/autobuild
2
- CHANGES
2
+ Changes.txt
3
3
  lib/autobuild/config.rb
4
4
  lib/autobuild/environment.rb
5
5
  lib/autobuild/exceptions.rb
data/README.txt CHANGED
@@ -1,3 +1,6 @@
1
+ Autobuild
2
+ http://autobuild.rubyforge.org
3
+
1
4
  = Introduction
2
5
 
3
6
  == WARNING for 0.5 users
@@ -5,9 +8,12 @@ Old configuration files used with autobuild 0.5 aren't accepted by Autobuild 0.6
5
8
  uses Ruby for configuration (just like rake does)
6
9
 
7
10
  == What's autobuild ?
8
- Autobuild is a builder for a set of software packages. It takes as input a yaml config file as input and
11
+ Autobuild imports, configures, builds and installs various kinds of software packages.
12
+ It can be used in software development to make sure that nothing is broken in the
13
+ build process of a set of packages, or can be used as an automated installation tool.
9
14
 
10
- * imports the package from a SCM or (optionnaly) updates it
15
+ Autobuild config files are Ruby scripts which configure rake to
16
+ * import the package from a SCM or (optionnaly) updates it
11
17
  * configures it. This phase can handle code generation, configuration (for instance for autotools-based
12
18
  packages), ...
13
19
  * build
@@ -119,7 +125,7 @@ Where +options+ is an option hash. See also Autobuild::SVNImporter and Autobuild
119
125
  * by default, no options are given to update. You can add some by giving a +svnup+ option
120
126
  svn url, :svnup => ['--my', '--svn', '--options']
121
127
 
122
- === *Darcs*
128
+ === Darcs
123
129
  package.importer = darcs(url[, options])
124
130
 
125
131
  Where +options+ is a hash. See also Autobuild::DarcsImporter and Autobuild.darcs
data/Rakefile CHANGED
@@ -1,20 +1,15 @@
1
- require 'rubygems'
2
1
  require 'hoe'
2
+ require './lib/autobuild'
3
3
 
4
- $:.unshift('lib')
5
-
6
- Hoe.new('autobuild', "0.6.2") do |p|
4
+ Hoe.new('autobuild', Autobuild::VERSION) do |p|
7
5
  p.author = "Sylvain Joyeux"
8
6
  p.email = "sylvain.joyeux@m4x.org"
7
+
9
8
  p.summary = 'Rake-based utility to build and install multiple packages with dependencies'
10
- p.url = "http://autobuild.rubyforge.org"
11
- p.description = <<-EOF
12
- Autobuild imports, configures, builds and installs various kinds of software packages.
13
- It can be used in software development to make sure that nothing is broken in the
14
- build process of a set of packages, or can be used as an automated installation tool.
15
- EOF
16
- p.changes = p.paragraphs_of("CHANGES", 1).join("\n\n")
17
- p.extra_deps << ['rake', '>= 0.7.0']
9
+ p.url = p.paragraphs_of('README.txt', 0).first.split(/\n/)[1..-1]
10
+ p.description = p.paragraphs_of('README.txt', 3..5).join("\n\n")
11
+ p.changes = p.paragraphs_of("Changes.txt", 1).join("\n\n")
12
+ p.extra_deps = [['rake', '>= 0.7.0']]
18
13
  p.extra_deps << ['rmail']
19
14
  p.extra_deps << ['daemons']
20
15
  end
data/lib/autobuild.rb CHANGED
@@ -1,3 +1,7 @@
1
+ module Autobuild
2
+ VERSION = "0.6.3"
3
+ end
4
+
1
5
  require 'autobuild/config'
2
6
  require 'autobuild/reporting'
3
7
  require 'autobuild/package'
@@ -24,11 +24,15 @@ module Autobuild
24
24
 
25
25
  def update(package)
26
26
  Dir.chdir(package.srcdir) do
27
+ if !File.exists?("#{package.srcdir}/CVS/Root")
28
+ raise ConfigException, "#{package.srcdir} does not look like a CVS checkout"
29
+ end
30
+
27
31
  root = File.open("#{package.srcdir}/CVS/Root") { |io| io.read }.chomp
28
32
  mod = File.open("#{package.srcdir}/CVS/Repository") { |io| io.read }.chomp
29
33
 
30
34
  if root != @root || mod != @module
31
- raise ArgumentError, "checkout in #{package.srcdir} is from #{root}:#{mod}, was expecting #{@root}:#{@mod}"
35
+ raise ConfigException, "checkout in #{package.srcdir} is from #{root}:#{mod}, was expecting #{@root}:#{@module}"
32
36
  end
33
37
  Subprocess.run(package.name, :import, @program, 'up', *@options_up)
34
38
  end
@@ -19,7 +19,7 @@ module Autobuild
19
19
  url =~ /URL: (.+)/
20
20
  source = $1
21
21
  if source != @source
22
- raise ArgumentError, "current checkout found at #{package.srcdir} is from #{source}, was expecting #{@source}"
22
+ raise ConfigException, "current checkout found at #{package.srcdir} is from #{source}, was expecting #{@source}"
23
23
  end
24
24
  Subprocess.run(package.name, :import, @program, 'up', *@options_up)
25
25
  }
@@ -3,6 +3,7 @@ require 'autobuild/timestamps'
3
3
  require 'autobuild/environment'
4
4
  require 'autobuild/package'
5
5
  require 'autobuild/subcommand'
6
+ require 'shellwords'
6
7
 
7
8
  module Autobuild
8
9
  def self.autotools(opts, &proc)
@@ -89,7 +90,26 @@ module Autobuild
89
90
  end
90
91
 
91
92
  def prepare
92
- file "#{builddir}/config.status" => regen do
93
+ # Check if config.status has been generated with the
94
+ # same options than the ones in configureflags
95
+ config_status = "#{builddir}/config.status"
96
+
97
+ force_reconfigure = false
98
+ if File.exists?(config_status)
99
+ output = IO.popen("#{config_status} --version").readlines.grep(/with options/).first.chomp
100
+ raise "invalid output of config.status --version" unless output =~ /with options "(.*)"$/
101
+ options = Shellwords.shellwords($1)
102
+
103
+ # Add the --prefix option to the configureflags array
104
+ testflags = ["--prefix=#{prefix}"] + Array[*configureflags]
105
+ old_opt = options.find { |o| !testflags.include?(o) }
106
+ new_opt = testflags.find { |o| !options.include?(o) }
107
+ if old_opt || new_opt
108
+ File.rm_f config_status # to force reconfiguration
109
+ end
110
+ end
111
+
112
+ file config_status => regen do
93
113
  ensure_dependencies_installed
94
114
  configure
95
115
  end
@@ -109,13 +129,15 @@ module Autobuild
109
129
 
110
130
  private
111
131
  # Adds a target to rebuild the autotools environment
112
- def regen
113
- conffile = "#{srcdir}/configure"
114
- if confext = %w{.ac .in}.find { |ext| File.exists?("#{conffile}#{ext}") }
115
- file conffile => "#{conffile}#{confext}"
116
- else
117
- raise PackageException.new(name), "neither configure.ac nor configure.in present in #{srcdir}"
118
- end
132
+ def regen(confsource = nil)
133
+ conffile = "#{srcdir}/configure"
134
+ if confsource
135
+ file conffile => confsource
136
+ elsif confext = %w{.ac .in}.find { |ext| File.exists?("#{conffile}#{ext}") }
137
+ file conffile => "#{conffile}#{confext}"
138
+ else
139
+ raise PackageException.new(name), "neither configure.ac nor configure.in present in #{srcdir}"
140
+ end
119
141
 
120
142
  file conffile do
121
143
  Dir.chdir(srcdir) {
@@ -162,7 +184,7 @@ module Autobuild
162
184
  FileUtils.mkdir_p builddir if !File.directory?(builddir)
163
185
  Dir.chdir(builddir) {
164
186
  command = [ "#{srcdir}/configure", "--no-create", "--prefix=#{prefix}" ]
165
- command |= Array[*configureflags]
187
+ command += Array[*configureflags]
166
188
 
167
189
  Subprocess.run(name, 'configure', *command)
168
190
  }
@@ -17,13 +17,16 @@ module Autobuild
17
17
  use :autogen => 'autogen'
18
18
  end
19
19
 
20
+ def import
21
+ super
22
+ get_provides
23
+ end
24
+
20
25
  # Called before running the rake tasks and
21
26
  # after all imports have been made
22
27
  def prepare
23
-
24
28
  super
25
- get_requires
26
- get_provides
29
+ get_requires
27
30
  end
28
31
 
29
32
  # The file touched by genom on successful generation
@@ -97,6 +100,19 @@ module Autobuild
97
100
  def regen
98
101
  cmdline = [ 'genom', "#{name}.gen", *genomflags ]
99
102
 
103
+ # Check that the module has been generated with the same flags
104
+ genom_mk = "#{srcdir}/autoconf/genom.mk"
105
+ if File.exists?(genom_mk)
106
+ contents = File.open(genom_mk).readlines
107
+ old_file = contents.find { |l| l =~ /^GENFILE/ }.gsub('GENFILE=', '').strip
108
+ old_flags = Shellwords.shellwords(
109
+ contents.find { |l| l =~ /^GENFLAGS/ }.gsub('GENFLAGS=', ''))
110
+
111
+ if old_file != "#{name}.gen" || !(old_flags - genomflags).empty? || !(genomflags - old_flags).empty?
112
+ File.rm_f genomstamp
113
+ end
114
+ end
115
+
100
116
  file buildstamp => genomstamp
101
117
  file genomstamp => genom_dependencies
102
118
  file genomstamp => srcdir do
@@ -112,6 +128,8 @@ module Autobuild
112
128
  # if .gen has changed
113
129
  Dir.chdir(srcdir) { Subprocess.run(name, 'genom', File.expand_path('autogen')) }
114
130
  end
131
+
132
+ super("#{srcdir}/autoconf/configure.ac")
115
133
  end
116
134
  end
117
135
  end
@@ -22,7 +22,6 @@ module Autobuild
22
22
  begin
23
23
  yield
24
24
  rescue Autobuild::Exception => e
25
- raise unless e.kind_of?(Autobuild::Exception)
26
25
  error(e)
27
26
  exit(1) if e.fatal?
28
27
  end
metadata CHANGED
@@ -1,18 +1,17 @@
1
1
  --- !ruby/object:Gem::Specification
2
- rubygems_version: 0.8.11
2
+ rubygems_version: 0.9.0
3
3
  specification_version: 1
4
4
  name: autobuild
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.6.2
7
- date: 2006-10-15 00:00:00 +02:00
6
+ version: 0.6.3
7
+ date: 2006-11-22 00:00:00 +01:00
8
8
  summary: Rake-based utility to build and install multiple packages with dependencies
9
9
  require_paths:
10
10
  - lib
11
- - test
12
11
  email: sylvain.joyeux@m4x.org
13
- homepage: http://autobuild.rubyforge.org
12
+ homepage: " http://autobuild.rubyforge.org"
14
13
  rubyforge_project: autobuild
15
- description: Autobuild imports, configures, builds and installs various kinds of software packages. It can be used in software development to make sure that nothing is broken in the build process of a set of packages, or can be used as an automated installation tool.
14
+ description: == What's autobuild ? Autobuild imports, configures, builds and installs various kinds of software packages. It can be used in software development to make sure that nothing is broken in the build process of a set of packages, or can be used as an automated installation tool. Autobuild config files are Ruby scripts which configure rake to * import the package from a SCM or (optionnaly) updates it * configures it. This phase can handle code generation, configuration (for instance for autotools-based packages), ... * build * install It takes the dependencies between packages into account in its build process, updates the needed environment variables (+PKG_CONFIG_PATH+, +PATH+, +LD_LIBRARY_PATH+, ...)
16
15
  autorequire:
17
16
  default_executable:
18
17
  bindir: bin
@@ -26,11 +25,12 @@ required_ruby_version: !ruby/object:Gem::Version::Requirement
26
25
  platform: ruby
27
26
  signing_key:
28
27
  cert_chain:
28
+ post_install_message:
29
29
  authors:
30
30
  - Sylvain Joyeux
31
31
  files:
32
32
  - bin/autobuild
33
- - CHANGES
33
+ - Changes.txt
34
34
  - lib/autobuild/config.rb
35
35
  - lib/autobuild/environment.rb
36
36
  - lib/autobuild/exceptions.rb
@@ -63,8 +63,11 @@ files:
63
63
  - test/test_subcommand.rb
64
64
  - test/tools.rb
65
65
  - TODO
66
- test_files: []
67
-
66
+ test_files:
67
+ - test/test_import_tar.rb
68
+ - test/test_subcommand.rb
69
+ - test/test_import_svn.rb
70
+ - test/test_import_cvs.rb
68
71
  rdoc_options: []
69
72
 
70
73
  extra_rdoc_files: []
@@ -76,15 +79,6 @@ extensions: []
76
79
  requirements: []
77
80
 
78
81
  dependencies:
79
- - !ruby/object:Gem::Dependency
80
- name: hoe
81
- version_requirement:
82
- version_requirements: !ruby/object:Gem::Version::Requirement
83
- requirements:
84
- - - ">="
85
- - !ruby/object:Gem::Version
86
- version: 1.1.1
87
- version:
88
82
  - !ruby/object:Gem::Dependency
89
83
  name: rake
90
84
  version_requirement: