autobuild 0.6.6 → 0.6.7

Sign up to get free protection for your applications and to get access to all the features.
data/Changes.txt CHANGED
@@ -1,3 +1,20 @@
1
+ == Version 0.6.7
2
+
3
+ * put install-stamp files into logdir, to clean up the installation prefix
4
+ * added Autobuild.post_install: run an external program or call a block after
5
+ all packages have been successfully built
6
+ * bugfix: darcs get expects that the path to the destination directory already
7
+ exists. Create it ourselves if it does not exist.
8
+ * bugfix: when computing the timestamp of a source tree, exclude .svn and _darcs
9
+ directories
10
+ * bugfix: 'opencv.pc' were searched in PkgConfig packages instead of the
11
+ actual .pc file ...
12
+ * bugfix: installed_pkgconfig is supposed to be a singleton method of Autobuild
13
+ * bugfix: "darcs get" expects that the path leading to the destination
14
+ directory exists. Create it.
15
+ * bugfix: fix handling of Genom's requires lists: we were previously expecting
16
+ packages to be exactly separated by ', '
17
+
1
18
  == Version 0.6.6
2
19
 
3
20
  * add Package#post_install: executes either a block or an external
data/README.txt CHANGED
@@ -1,8 +1,6 @@
1
- Autobuild
2
- http://autobuild.rubyforge.org
3
-
4
- Copyright (c) 2006-2007
5
- Sylvain Joyeux <sylvain.joyeux@m4x.org>
1
+ Copyright (c) 2006-2007 Sylvain Joyeux <sylvain.joyeux@m4x.org>
2
+ * http://www.rubyforge.org/projects/autobuild [project page]
3
+ * http://autobuild.rubyforge.org/autobuild [API documentation]
6
4
 
7
5
  This work is licensed under the GPLv2 license. See License.txt for details
8
6
 
data/lib/autobuild.rb CHANGED
@@ -3,6 +3,6 @@ require 'autobuild/reporting'
3
3
  require 'autobuild/package'
4
4
 
5
5
  module Autobuild
6
- VERSION = "0.6.6" unless defined? Autobuild::VERSION
6
+ VERSION = "0.6.7" unless defined? Autobuild::VERSION
7
7
  end
8
8
 
@@ -46,6 +46,31 @@ module Autobuild
46
46
  send("#{name}=", value)
47
47
  end
48
48
 
49
+ def self.post_install(*args, &block)
50
+ if args.empty?
51
+ @post_install_handler = block
52
+ elsif !block
53
+ @post_install_handler = args
54
+ else
55
+ raise ArgumentError, "cannot set both arguments and block"
56
+ end
57
+ end
58
+ attr_reader :post_install_handler
59
+
60
+ def self.apply_post_install(info)
61
+ return unless info
62
+
63
+ case info
64
+ when Array
65
+ args = info.dup
66
+ tool = Autobuild.tool(args.shift)
67
+
68
+ Autobuild::Subprocess.run name, 'post-install', tool, *args
69
+ when Proc
70
+ info.call
71
+ end
72
+ end
73
+
49
74
  @mail = Hash.new
50
75
  class << self
51
76
  # Mailing configuration. It is a hash with the following keys (as symbols)
@@ -32,6 +32,11 @@ module Autobuild
32
32
  end
33
33
 
34
34
  def checkout(package) # :nodoc:
35
+ basedir = File.dirname(package.srcdir)
36
+ unless File.directory?(basedir)
37
+ FileUtils.mkdir_p(basedir)
38
+ end
39
+
35
40
  Subprocess.run(package.name, :import, @program,
36
41
  'get', '--set-scripts-executable', @source, package.srcdir, *@get)
37
42
  end
@@ -45,7 +45,7 @@ class Autobuild::Package
45
45
  # has finished. The path is absolute
46
46
  #
47
47
  # A package is sucessfully built when it is installed
48
- def installstamp; "#{prefix}/#{name}-#{STAMPFILE}" end
48
+ def installstamp; "#{Autobuild.logdir}/#{name}-#{STAMPFILE}" end
49
49
 
50
50
  def initialize(spec)
51
51
  @dependencies = Array.new
@@ -68,15 +68,7 @@ class Autobuild::Package
68
68
  # Declare the installation stampfile
69
69
  file installstamp do
70
70
  Dir.chdir(srcdir) do
71
- case @post_install
72
- when Array
73
- args = @post_install.dup
74
- tool = Autobuild.tool(args.shift)
75
-
76
- Autobuild::Subprocess.run name, 'post-install', tool, *args
77
- when Proc
78
- @post_install.call
79
- end
71
+ Autobuild.apply_post_install(@post_install)
80
72
  end
81
73
  end
82
74
  task "#{name}-build" => installstamp
@@ -48,7 +48,7 @@ module Autobuild
48
48
  if line =~ /^\s*(codels_)?requires\s*:\s*([\w\-]+(?:\s*,\s*[\w\-]+)*);/
49
49
  # Remove the codels_requires lines if -a is given to genom
50
50
  unless $1 == "codels_" && apionly
51
- $2.split(/, /).each { |name| depends_on name }
51
+ $2.split(/,/).each { |name| depends_on name.strip }
52
52
  end
53
53
  elsif line =~ /^\s*(?:codels_)?requires/
54
54
  # Check that the regexp is not too strict
@@ -15,14 +15,14 @@ module Autobuild
15
15
  std_stamp = super
16
16
  return std_stamp if File.file?(std_stamp)
17
17
 
18
- pcfile = File.join(pkgconfig.prefix, "lib", "pkgconfig", "opencv.pc")
18
+ pcfile = File.join(pkgconfig.prefix, "lib", "pkgconfig", "#{name}.pc")
19
19
  if !File.file?(pcfile)
20
20
  raise "cannot find the .pc file for #{name}, tried #{pcfile}"
21
21
  end
22
22
  pcfile
23
23
  end
24
24
  end
25
- def installed_pkgconfig(name, &block)
25
+ def self.installed_pkgconfig(name, &block)
26
26
  InstalledPkgConfig.new(name, &block)
27
27
  end
28
28
  end
@@ -39,7 +39,7 @@ module Autobuild
39
39
  class SourceTreeTask < Rake::Task
40
40
  attr_accessor :exclude
41
41
  def timestamp
42
- tree_timestamp(name, %r#(?:^|/)CVS$#, *@exclude)
42
+ tree_timestamp(name, %r#(?:^|/)(?:CVS|_darcs|\.svn)$#, *@exclude)
43
43
  end
44
44
  end
45
45
  def source_tree(path, exclude = [], &block)
metadata CHANGED
@@ -3,15 +3,15 @@ rubygems_version: 0.9.2
3
3
  specification_version: 1
4
4
  name: autobuild
5
5
  version: !ruby/object:Gem::Version
6
- version: 0.6.6
7
- date: 2007-04-24 00:00:00 +02:00
6
+ version: 0.6.7
7
+ date: 2007-05-05 00:00:00 +02:00
8
8
  summary: Rake-based utility to build and install multiple packages with dependencies
9
9
  require_paths:
10
10
  - lib
11
11
  email: sylvain.joyeux@m4x.org
12
- homepage: " http://autobuild.rubyforge.org"
12
+ homepage: "* http://www.rubyforge.org/projects/autobuild [project page]"
13
13
  rubyforge_project: autobuild
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 * imports 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+, ...)
14
+ description: Autobuild config files are Ruby scripts which configure rake to * imports 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+, ...) == WARNING for 0.5 users Old configuration files used with autobuild 0.5 aren't accepted by Autobuild 0.6. Since 0.6, Autobuild uses Ruby for configuration (just like rake does)
15
15
  autorequire:
16
16
  default_executable:
17
17
  bindir: bin