albanpeignier-rake-debian-build 1.0.2 → 1.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Rakefile CHANGED
@@ -2,9 +2,10 @@
2
2
 
3
3
  # Generate all the Rake tasks
4
4
  # Run 'rake -T' to see list of generated tasks (from gem root directory)
5
- $hoe = Hoe.new('rake-debian-build', '1.0.2') do |p|
5
+ $hoe = Hoe.new('rake-debian-build', '1.0.5') do |p|
6
6
  p.developer("Alban Peignier", "alban.peignier@free.fr")
7
7
  p.summary = "Rake tasks to build debian packages"
8
+ p.url = "http://github.com/albanpeignier/rake-debian-build"
8
9
 
9
10
  p.rubyforge_name = p.name # TODO this is default value
10
11
 
@@ -24,7 +24,7 @@ module Debian::Build
24
24
 
25
25
  def self.ubuntu_distributions
26
26
  @@ubuntu_distributions ||=
27
- %w{hardy intrepid}.collect { |distribution| Distribution.new(:ubuntu, distribution) }
27
+ %w{hardy intrepid jaunty}.collect { |distribution| Distribution.new(:ubuntu, distribution) }
28
28
  end
29
29
 
30
30
  def source_result_directory
@@ -46,12 +46,12 @@ module Debian::Build
46
46
  end
47
47
 
48
48
  def unstable?
49
- [ :unstable, :intrepid ].include? distribution
49
+ [ :unstable, :jaunty ].include? distribution
50
50
  end
51
51
 
52
- @@local_names = { :stable => 'lenny', :testing => 'squeeze', :intrepid => 'ubuntu', :hardy => 'hardy' }
52
+ @@local_names = { :stable => 'lenny', :testing => 'squeeze' }
53
53
  def local_name
54
- @@local_names[distribution]
54
+ @@local_names.fetch(distribution,self.to_s)
55
55
  end
56
56
 
57
57
  def to_s
@@ -33,6 +33,10 @@ module Debian::Build
33
33
  end
34
34
  end
35
35
 
36
+ task "lintian" do
37
+ # TODO : implement lintian on ModulePackage
38
+ end
39
+
36
40
  # TODO : remove this mock
37
41
  namespace :source do
38
42
  task :all
@@ -34,18 +34,10 @@ module Debian::Build
34
34
 
35
35
  dch_options="--preserve --force-distribution"
36
36
  Dir.chdir(source_directory) do
37
- unless distribution.ubuntu?
38
- if distribution.unstable?
39
- sh "dch #{dch_options} --distribution 'unstable' --release ''"
40
- else
41
- sh "dch #{dch_options} --local #{distribution.local_name} --distribution #{distribution} 'Release from unstable'"
42
- end
37
+ if not distribution.ubuntu? and distribution.unstable?
38
+ sh "dch #{dch_options} --distribution 'unstable' --release ''"
43
39
  else
44
- if distribution.unstable?
45
- sh "dch #{dch_options} --local ubuntu --distribution #{distribution} 'Release from debian/unstable'"
46
- else
47
- sh "dch #{dch_options} --local #{distribution.local_name} --distribution #{distribution} 'Release from unstable'"
48
- end
40
+ sh "dch #{dch_options} --local #{local_name(distribution)} --distribution #{distribution} 'Release from unstable'"
49
41
  end
50
42
 
51
43
  dpkg_buildpackage_options = []
@@ -87,24 +79,15 @@ module Debian::Build
87
79
 
88
80
  desc "Upload packages for #{package} #{version}"
89
81
  task "upload" do
90
- changes_files = Dir.glob("#{sources_directory}/#{package}_#{debian_version}*_source.changes")
91
-
92
- Platform.each do |platform|
93
- platform_changes_files = Dir.glob("#{platform.build_result_directory}/#{package}_#{debian_version}*_#{platform.architecture}.changes")
94
-
95
- unless platform_changes_files.empty?
96
- # deb packages for architect all shouldn't be uploaded twice
97
- sh "sed -i '/_all.deb/ d' #{platform_changes_files.join(' ')}" if platform.architecture != 'i386'
98
-
99
- changes_files << platform_changes_files
100
- end
101
- end
102
-
103
- changes_files.flatten!
104
-
105
82
  Uploader.default.dupload changes_files
106
83
  end
107
84
 
85
+ desc "Run lintian on package #{package}"
86
+ task "lintian" do
87
+ redirect = ENV['LINTIAN_OUTPUT'] ? ">> #{ENV['LINTIAN_OUTPUT']}" : ""
88
+ sh "lintian #{changes_files.join(' ')} #{redirect}"
89
+ end
90
+
108
91
  desc "Clean files created for #{package} #{version}"
109
92
  task "clean" do
110
93
  Platform.each do |platform|
@@ -120,9 +103,17 @@ module Debian::Build
120
103
  end
121
104
  end
122
105
 
106
+ def local_name(distribution)
107
+ unless distribution.unstable?
108
+ distribution.local_name
109
+ else
110
+ "ubuntu" if distribution.ubuntu?
111
+ end
112
+ end
113
+
123
114
  def dsc_file(platform)
124
115
  suffix =
125
- if local_name = platform.local_name
116
+ if local_name = local_name(platform)
126
117
  "#{local_name}1"
127
118
  else
128
119
  ""
@@ -148,7 +139,25 @@ module Debian::Build
148
139
  end
149
140
 
150
141
  def debian_version
151
- "#{version}-#{debian_increment}"
142
+ "#{version}-#{debian_increment}"
143
+ end
144
+
145
+ def changes_files
146
+ changes_files = Dir.glob("#{sources_directory}/#{package}_#{debian_version}*_source.changes")
147
+
148
+ Platform.each do |platform|
149
+ platform_changes_files = Dir.glob("#{platform.build_result_directory}/#{package}_#{debian_version}*_#{platform.architecture}.changes")
150
+
151
+ unless platform_changes_files.empty?
152
+ # deb packages for architect all shouldn't be uploaded twice
153
+ sh "sed -i '/_all.deb/ d' #{platform_changes_files.join(' ')}" if platform.architecture != 'i386'
154
+
155
+ changes_files << platform_changes_files
156
+ end
157
+ end
158
+
159
+ changes_files.flatten!
160
+ changes_files
152
161
  end
153
162
 
154
163
  def package_files(directory = '.')
@@ -12,12 +12,15 @@ module Debian::Build
12
12
  end
13
13
  end
14
14
 
15
-
16
15
  def initialize(distribution, architecture)
17
16
  @distribution = distribution
18
17
  @architecture = architecture
19
18
  end
20
19
 
20
+ def self.find_by_name(name)
21
+ self.all.find { |p| p.to_s == name }
22
+ end
23
+
21
24
  def self.supported_architectures
22
25
  %w{i386 amd64}
23
26
  end
@@ -2,24 +2,26 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{rake-debian-build}
5
- s.version = "1.0.2"
5
+ s.version = "1.0.4"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
8
8
  s.authors = ["Alban Peignier"]
9
- s.date = %q{2009-04-19}
9
+ s.date = %q{2009-05-11}
10
+ s.description = %q{}
10
11
  s.email = ["alban.peignier@free.fr"]
11
12
  s.extra_rdoc_files = ["Manifest.txt"]
12
13
  s.files = ["Manifest.txt", "README.rdoc", "Rakefile", "lib/debian/build.rb", "lib/debian/build/abstract_package.rb", "lib/debian/build/build_directory_methods.rb", "lib/debian/build/config.rb", "lib/debian/build/distribution.rb", "lib/debian/build/helper_methods.rb", "lib/debian/build/module_package.rb", "lib/debian/build/package.rb", "lib/debian/build/pbuilder.rb", "lib/debian/build/platform.rb", "lib/debian/build/source_providers.rb", "lib/debian/build/tasks.rb", "lib/debian/build/uploader.rb", "lib/ruby_pbuilder.rb", "rake-debian-build.gemspec", "spec/debian/build/source_providers_spec.rb", "spec/debian/build/uploader_spec.rb", "spec/spec_helper.rb", "tasks/packages.rake", "tasks/pbuilder.rake", "tasks/setup.rake"]
13
14
  s.has_rdoc = true
15
+ s.homepage = %q{http://github.com/albanpeignier/rake-debian-build}
14
16
  s.rdoc_options = ["--main", "README.txt"]
15
17
  s.require_paths = ["lib"]
16
18
  s.rubyforge_project = %q{rake-debian-build}
17
- s.rubygems_version = %q{1.3.1}
19
+ s.rubygems_version = %q{1.3.2}
18
20
  s.summary = %q{Rake tasks to build debian packages}
19
21
 
20
22
  if s.respond_to? :specification_version then
21
23
  current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
22
- s.specification_version = 2
24
+ s.specification_version = 3
23
25
 
24
26
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
25
27
  s.add_development_dependency(%q<hoe>, [">= 1.12.2"])
data/tasks/packages.rake CHANGED
@@ -23,7 +23,14 @@ namespace "packages" do
23
23
  end
24
24
  end
25
25
  end
26
-
26
+
27
+ task :lintian do
28
+ lintian_sub_tasks = Debian::Build.packages.collect do |package|
29
+ "package:#{package}:lintian"
30
+ end
31
+ sh "rake #{lintian_sub_tasks.join(' ')} | sort -u > lintian-#{Time.now.strftime("%Y%m%d%H%M")}.txt"
32
+ end
33
+
27
34
  end
28
35
 
29
36
  task :packages => [ "packages:sources", "packages:binaries", "packages:upload" ]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: albanpeignier-rake-debian-build
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alban Peignier
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2009-04-19 00:00:00 -07:00
12
+ date: 2009-05-11 00:00:00 -07:00
13
13
  default_executable:
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
@@ -22,7 +22,7 @@ dependencies:
22
22
  - !ruby/object:Gem::Version
23
23
  version: 1.12.2
24
24
  version:
25
- description:
25
+ description: ""
26
26
  email:
27
27
  - alban.peignier@free.fr
28
28
  executables: []
@@ -57,7 +57,7 @@ files:
57
57
  - tasks/pbuilder.rake
58
58
  - tasks/setup.rake
59
59
  has_rdoc: true
60
- homepage:
60
+ homepage: http://github.com/albanpeignier/rake-debian-build
61
61
  post_install_message:
62
62
  rdoc_options:
63
63
  - --main
@@ -81,7 +81,7 @@ requirements: []
81
81
  rubyforge_project: rake-debian-build
82
82
  rubygems_version: 1.2.0
83
83
  signing_key:
84
- specification_version: 2
84
+ specification_version: 3
85
85
  summary: Rake tasks to build debian packages
86
86
  test_files: []
87
87