fpm-cookery 0.17.1 → 0.18.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- ZWMwNGZiYzMzOWE5Yzk2ODVhZmVhNjUyZWJlNjllNGYzMmRlYmY1Nw==
4
+ M2M5MjYyNTYzYzM3YjU4Njc4MTk1ZWZlODAxZDYzMTU5YzYwMjY3Yg==
5
5
  data.tar.gz: !binary |-
6
- ZmI4ZWU1OGUyMjAzNGI2MTk5MTcwODE5N2FjMTA0ZjQ0YTE2ZWQyZg==
6
+ NWU4YTk1NzJkNzljNzc5MmRlNDBkOGU5YTYwMmVlYTgzYzA3M2JjNQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- MjdlODY3MWUwMjE2M2ZjNjE3MTg5ZDE3NmY5M2M3MzkzN2ExMGRiOTIwZDM5
10
- NDY3YTBlMWQ5OGE3ZDk2YmMyNDMxMWFlZmU4N2M3MTc3NTI2OWM0OWE3MzZi
11
- MDI4YzE2YTRmNDkwZGNiN2FjNTRmMTFkYzdiN2M3Yjk4OTk5MTU=
9
+ OTA5YTI3Yjg3NTZhODgyMmZkNGNhZmQ0Mjg3Yjc0ODI4ZmMyZmRhNGYyODdh
10
+ MDJlN2QyOWQxZWY0ZGNjMmZjNjMxNzdmZjQwYjgzMTA1NTAxMDQ5ZGI4MzBi
11
+ YjQyZmEwNDJmMWYwMDBhY2U3OWFmYTEwYWJhMTc0ZTM2ZjYwMTM=
12
12
  data.tar.gz: !binary |-
13
- YmU0ODYxNzdlZTU0MDdmNzlhZjNlYTM4YjE1ZmRjMzA3N2Y0OGQ5NjQ2NTcz
14
- YjIzNmU4MGU5NTA3Mjk3NWRmZjI1YWE1MDZmNTkzNGZjNTkxM2IxYWY4MWM1
15
- YjgxYjg2NWYxNzY4NDIzNzUyYTkzM2YwMGNiMzU4Mzc5ZjI1YTQ=
13
+ MjAwMDhmMTQ5YmQzMWQ4ZWJmNDJhNjlkMTBiMzE0ZjBlM2EyN2EwOTdjOGFk
14
+ MDVmM2JmYzA5ODgyMWU1MWJkNWYxY2U3MDE0MDZjMjAzNTk3NzMyZjA1OWI2
15
+ ODM1MjY2YTY3NWFiNDcyZTM0MjE0MDJkZmFhMmQ2YzJjZWM4NDc=
data/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ # v0.18.0 (2014-03-01)
2
+ * Do not set a default value for the vendor attribute.
3
+ __WARNING__: This changes the default package names!
4
+ * Change package name computation regarding version, revision and vendor.
5
+ __WARNING__: This changes the default package names!
6
+ * Start default revision at 1.
7
+ * Unbreak omnibus packaging. (#64)
8
+ * Add support for npm recipes. (bracki / #65)
9
+
1
10
  # v0.17.1 (2014-02-07)
2
11
  * Unbreak deb package building.
3
12
 
@@ -8,8 +8,9 @@ module FPM
8
8
 
9
9
  attr_reader :packager, :recipe
10
10
 
11
- def initialize(packager)
11
+ def initialize(packager, config = {})
12
12
  @packager = packager
13
+ @config = config
13
14
  @recipe = packager.recipe
14
15
  @depends = []
15
16
  end
@@ -0,0 +1,22 @@
1
+ require 'fpm/package/npm'
2
+ require 'fpm/cookery/package/package'
3
+
4
+ module FPM
5
+ module Cookery
6
+ module Package
7
+ class NPM < FPM::Cookery::Package::Package
8
+ def fpm_object
9
+ FPM::Package::NPM.new
10
+ end
11
+
12
+ def package_setup
13
+ fpm.version = recipe.version
14
+ end
15
+
16
+ def package_input
17
+ fpm.input(recipe.name)
18
+ end
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,6 +1,10 @@
1
1
  module FPM
2
2
  module Cookery
3
3
  module Package
4
+ # See the following URLs for package naming conventions.
5
+ #
6
+ # * https://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version
7
+ # * https://fedoraproject.org/wiki/Packaging:NamingGuidelines?rd=Packaging/NamingGuidelines#Package_Versioning
4
8
  class Version
5
9
  VENDOR_DELIMITER = {
6
10
  :deb => '+',
@@ -28,7 +32,7 @@ module FPM
28
32
 
29
33
  def to_s
30
34
  if vendor
31
- "#{version}#{vendor_delimiter}#{vendor}#{revision}"
35
+ "#{version}-#{revision}#{vendor_delimiter}#{vendor}"
32
36
  else
33
37
  "#{version}-#{revision}"
34
38
  end
@@ -7,6 +7,7 @@ require 'fpm/cookery/utils'
7
7
  require 'fpm/cookery/path_helper'
8
8
  require 'fpm/cookery/package/dir'
9
9
  require 'fpm/cookery/package/gem'
10
+ require 'fpm/cookery/package/npm'
10
11
 
11
12
  module FPM
12
13
  module Cookery
@@ -80,8 +81,7 @@ module FPM
80
81
  @filename = Path.new(filename).expand_path
81
82
 
82
83
  # Set some defaults.
83
- vendor || self.class.vendor('fpm')
84
- revision || self.class.revision(0)
84
+ revision || self.class.revision(1)
85
85
  end
86
86
 
87
87
  def workdir=(value) @workdir = Path.new(value) end
@@ -145,5 +145,11 @@ module FPM
145
145
  FPM::Cookery::Package::Gem.new(self, config)
146
146
  end
147
147
  end
148
+
149
+ class NPMRecipe < BaseRecipe
150
+ def input(config)
151
+ FPM::Cookery::Package::NPM.new(self, config)
152
+ end
153
+ end
148
154
  end
149
155
  end
@@ -1,5 +1,5 @@
1
1
  module FPM
2
2
  module Cookery
3
- VERSION = '0.17.1'
3
+ VERSION = '0.18.0'
4
4
  end
5
5
  end
data/spec/package_spec.rb CHANGED
@@ -110,7 +110,7 @@ describe 'Package' do
110
110
  let(:attributes) { package.fpm.attributes }
111
111
 
112
112
  it 'sets deb_compression' do
113
- attributes[:deb_compression].must_equal 'gzip'
113
+ attributes[:deb_compression].must_equal 'gz'
114
114
  end
115
115
 
116
116
  it 'sets deb_user' do
@@ -90,10 +90,22 @@ describe 'Version' do
90
90
  describe '#to_s' do
91
91
  it 'returns a string representation of the version' do
92
92
  recipe.version = '2.1.3'
93
- recipe.vendor = 'testing'
93
+ recipe.vendor = 'testing1'
94
94
  recipe.revision = 5
95
95
 
96
- version.to_s.must_equal '2.1.3+testing5'
96
+ version.to_s.must_equal '2.1.3-5+testing1'
97
+ end
98
+
99
+ context 'with target rpm' do
100
+ def target; 'rpm'; end
101
+
102
+ it 'returns a string representation of the version' do
103
+ recipe.version = '2.1.3'
104
+ recipe.vendor = 'testing1'
105
+ recipe.revision = 5
106
+
107
+ version.to_s.must_equal '2.1.3-5.testing1'
108
+ end
97
109
  end
98
110
 
99
111
  context 'without vendor' do
@@ -103,6 +115,17 @@ describe 'Version' do
103
115
 
104
116
  version.to_s.must_equal '2.1.3-5'
105
117
  end
118
+
119
+ context 'with target rpm' do
120
+ def target; 'rpm'; end
121
+
122
+ it 'returns a string representation of the version' do
123
+ recipe.version = '2.1.3'
124
+ recipe.revision = 5
125
+
126
+ version.to_s.must_equal '2.1.3-5'
127
+ end
128
+ end
106
129
  end
107
130
  end
108
131
 
@@ -114,7 +137,7 @@ describe 'Version' do
114
137
  recipe.vendor = 'foo'
115
138
  recipe.revision = 1
116
139
 
117
- version.to_str.must_equal '1.3.foo1'
140
+ version.to_str.must_equal '1.3-1.foo'
118
141
  end
119
142
  end
120
143
  end
data/spec/recipe_spec.rb CHANGED
@@ -119,8 +119,8 @@ describe "Recipe" do
119
119
  check_attribute(:revision, '12')
120
120
  end
121
121
 
122
- it "sets a default revision" do
123
- recipe.revision.must_equal 0
122
+ it "sets a default revision of 1" do
123
+ recipe.revision.must_equal 1
124
124
  end
125
125
  end
126
126
 
@@ -141,8 +141,8 @@ describe "Recipe" do
141
141
  check_attribute(:vendor, 'myvendor')
142
142
  end
143
143
 
144
- it "sets a default vendor" do
145
- recipe.vendor.must_equal 'fpm'
144
+ it "does not set a default vendor" do
145
+ recipe.vendor.must_equal nil
146
146
  end
147
147
  end
148
148
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fpm-cookery
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.1
4
+ version: 0.18.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernd Ahlers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-02-07 00:00:00.000000000 Z
11
+ date: 2014-03-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: minitest
@@ -143,6 +143,7 @@ files:
143
143
  - lib/fpm/cookery/package/dir.rb
144
144
  - lib/fpm/cookery/package/gem.rb
145
145
  - lib/fpm/cookery/package/maintainer.rb
146
+ - lib/fpm/cookery/package/npm.rb
146
147
  - lib/fpm/cookery/package/package.rb
147
148
  - lib/fpm/cookery/package/version.rb
148
149
  - lib/fpm/cookery/packager.rb
@@ -228,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
228
229
  version: '0'
229
230
  requirements: []
230
231
  rubyforge_project: fpm-cookery
231
- rubygems_version: 2.2.0
232
+ rubygems_version: 2.2.2
232
233
  signing_key:
233
234
  specification_version: 4
234
235
  summary: A tool for building software packages with fpm.