native-package-installer 1.1.2 → 1.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f81b6a31d687db3d8f2b8a18e81b1a5fcd89531561940774c31b115e2068d4ee
4
- data.tar.gz: 3f015fe58c1046a6db4adae8ca89487f136e2155ac3de47efe142fdd6b02c58f
3
+ metadata.gz: dde9205f957efd76f9694fdc3b5226ebcd9b69ad9523f91d7a72708656a884fa
4
+ data.tar.gz: 205dd85c056fb1a3e2083d09a5a53f3d40782075029f9346728c7f121b07d2fa
5
5
  SHA512:
6
- metadata.gz: e6ce52d9eb449fe1ec2a98a83d6e719eb9e301e00122dc676e18871c5d00660c1c5331dc9dfa5903eabebecef4fe891e60479b1893f96f95f50a4f9d992f2510
7
- data.tar.gz: feaa63f0b76edeea500b41ec03d442122763f63b7abbf8aa05cb47f614d301eb9eccbc36584568e86e60d3c294eb4e945aa97949515d0134f3d19f43ea95ba7f
6
+ metadata.gz: c75bdfd03e2ef20211d7fb2edff8d46da46478bcaf14fd29f80f27acdc79ce563a990fabe20a40a990e7be289e2bcfcfb3fc555f0849649da47b61c2cb52cc68
7
+ data.tar.gz: cb25f859a69b0a43adfc617e2de87c03ae8299cbbe69197d4e2680583151a44ee2112aed9348a8b627a0f26d58c7147a2209beef0e47e22eb9526d47d1fb861b
data/doc/text/news.md CHANGED
@@ -1,5 +1,34 @@
1
1
  # News
2
2
 
3
+ ## 1.1.5 - 2022-07-24
4
+
5
+ ### Improvements
6
+
7
+ * Added support for Red Hat Enterprise Linux 9.
8
+
9
+ * Added support for Gentoo Linux.
10
+
11
+ ## 1.1.4 - 2022-03-17
12
+
13
+ ### Improvements
14
+
15
+ * Added support for Amazon Linux.
16
+ [GitHub#14][Reported by docusend1]
17
+
18
+ * Renamed the key for Red Hat Enterprise Linux based system such as
19
+ AlmaLinux and CentOS to `:rhel` from `:redhat`. `:redhat` still
20
+ can be used to keep backward compatibility.
21
+
22
+ ### Thanks
23
+
24
+ * docusend1
25
+
26
+ ## 1.1.3 - 2022-01-18
27
+
28
+ ### Fixes
29
+
30
+ * Fixed wrong package install on Windows.
31
+
3
32
  ## 1.1.2 - 2022-01-18
4
33
 
5
34
  ### Improvements
@@ -1,6 +1,4 @@
1
- #!/usr/bin/env ruby
2
- #
3
- # Copyright (C) 2013 Ruby-GNOME Project Team
1
+ # Copyright (C) 2022 Ruby-GNOME Project Team
4
2
  #
5
3
  # This library is free software: you can redistribute it and/or modify
6
4
  # it under the terms of the GNU Lesser General Public License as published by
@@ -15,15 +13,27 @@
15
13
  # You should have received a copy of the GNU Lesser General Public License
16
14
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
17
15
 
18
- $VERBOSE = true
16
+ require_relative "red-hat-enterprise-linux"
19
17
 
20
- require "test-unit"
21
- require "test/unit/rr"
18
+ class NativePackageInstaller
19
+ module Platform
20
+ class AmazonLinux < RedHatEnterpriseLinux
21
+ Platform.register(self)
22
22
 
23
- base_dir = File.expand_path(File.join(File.dirname(__FILE__), ".."))
24
- lib_dir = File.join(base_dir, "lib")
25
- test_dir = File.join(base_dir, "test")
23
+ class << self
24
+ def current_platform?
25
+ os_release = OSRelease.new
26
+ os_release.id == "amzn"
27
+ end
28
+ end
26
29
 
27
- $LOAD_PATH.unshift(lib_dir)
30
+ def package(spec)
31
+ spec[:amazon_linux] || super
32
+ end
28
33
 
29
- exit(Test::Unit::AutoRunner.run(true, test_dir))
34
+ def install_command
35
+ "yum install -y"
36
+ end
37
+ end
38
+ end
39
+ end
@@ -26,7 +26,7 @@ class NativePackageInstaller
26
26
  end
27
27
 
28
28
  def package(spec)
29
- spec[:fedora] || spec[:redhat]
29
+ spec[:fedora] || spec[:rhel] || spec[:redhat]
30
30
  end
31
31
 
32
32
  def install_command
@@ -0,0 +1,47 @@
1
+ # Copyright (C) 2022 Ruby-GNOME Project Team
2
+ #
3
+ # This library is free software: you can redistribute it and/or modify
4
+ # it under the terms of the GNU Lesser General Public License as published by
5
+ # the Free Software Foundation, either version 3 of the License, or
6
+ # (at your option) any later version.
7
+ #
8
+ # This program is distributed in the hope that it will be useful,
9
+ # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
+ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
+ # GNU Lesser General Public License for more details.
12
+ #
13
+ # You should have received a copy of the GNU Lesser General Public License
14
+ # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
+
16
+ class NativePackageInstaller
17
+ module Platform
18
+ class GentooLinux
19
+ Platform.register(self)
20
+
21
+ class << self
22
+ def current_platform?
23
+ os_release = OSRelease.new
24
+ case os_release.id
25
+ when "gentoo"
26
+ return true
27
+ else
28
+ return true if os_release.id_like.include?("gentoo")
29
+ end
30
+ false
31
+ end
32
+ end
33
+
34
+ def package(spec)
35
+ spec[:gentoo_linux]
36
+ end
37
+
38
+ def install_command
39
+ "emerge --getbinpkg --usepkg"
40
+ end
41
+
42
+ def need_super_user_priviledge?
43
+ true
44
+ end
45
+ end
46
+ end
47
+ end
@@ -15,7 +15,7 @@
15
15
 
16
16
  class NativePackageInstaller
17
17
  module Platform
18
- class RedHat
18
+ class RedHatEnterpriseLinux
19
19
  Platform.register(self)
20
20
 
21
21
  class << self
@@ -26,11 +26,13 @@ class NativePackageInstaller
26
26
  end
27
27
 
28
28
  def package(spec)
29
- spec[:redhat]
29
+ spec[:rhel] || spec[:redhat]
30
30
  end
31
31
 
32
32
  def install_command
33
- if major_version >= 8
33
+ if major_version >= 9
34
+ "dnf install --enablerepo=crb -y"
35
+ elsif major_version >= 8
34
36
  "dnf install --enablerepo=powertools -y"
35
37
  else
36
38
  "yum install -y"
@@ -26,7 +26,7 @@ class NativePackageInstaller
26
26
  end
27
27
 
28
28
  def package(spec)
29
- spec[:suse] || spec[:fedora] || spec[:redhat]
29
+ spec[:suse] || spec[:fedora] || spec[:rhel] || spec[:redhat]
30
30
  end
31
31
 
32
32
  def install_command
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017-2021 Ruby-GNOME Project Team
1
+ # Copyright (C) 2017-2022 Ruby-GNOME Project Team
2
2
  #
3
3
  # This library is free software: you can redistribute it and/or modify
4
4
  # it under the terms of the GNU Lesser General Public License as published by
@@ -33,10 +33,6 @@ class NativePackageInstaller
33
33
  end
34
34
 
35
35
 
36
- # Windows
37
- require_relative "platform/msys2"
38
-
39
-
40
36
  # macOS
41
37
  require_relative "platform/macports"
42
38
 
@@ -49,6 +45,7 @@ require_relative "platform/freebsd"
49
45
 
50
46
  # Linux
51
47
  require_relative "platform/arch-linux"
48
+ require_relative "platform/gentoo-linux"
52
49
 
53
50
  require_relative "platform/debian"
54
51
  require_relative "platform/ubuntu"
@@ -56,11 +53,16 @@ require_relative "platform/alt-linux"
56
53
 
57
54
  require_relative "platform/pld-linux"
58
55
 
59
- require_relative "platform/redhat"
56
+ require_relative "platform/red-hat-enterprise-linux"
57
+ require_relative "platform/amazon-linux"
60
58
  require_relative "platform/fedora"
61
59
 
62
60
  require_relative "platform/suse"
63
61
 
64
62
 
63
+ # Windows
64
+ require_relative "platform/msys2"
65
+
66
+
65
67
  # Fallback
66
68
  require_relative "platform/unknown"
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2021 Ruby-GNOME Project Team
1
+ # Copyright (C) 2013-2022 Ruby-GNOME Project Team
2
2
  #
3
3
  # This library is free software: you can redistribute it and/or modify
4
4
  # it under the terms of the GNU Lesser General Public License as published by
@@ -14,5 +14,5 @@
14
14
  # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
15
 
16
16
  class NativePackageInstaller
17
- VERSION = "1.1.2"
17
+ VERSION = "1.1.5"
18
18
  end
metadata CHANGED
@@ -1,57 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: native-package-installer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-01-17 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: bundler
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - ">="
18
- - !ruby/object:Gem::Version
19
- version: '0'
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - ">="
25
- - !ruby/object:Gem::Version
26
- version: '0'
27
- - !ruby/object:Gem::Dependency
28
- name: rake
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - ">="
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - ">="
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: test-unit-rr
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ">="
46
- - !ruby/object:Gem::Version
47
- version: '0'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ">="
53
- - !ruby/object:Gem::Version
54
- version: '0'
11
+ date: 2022-07-24 00:00:00.000000000 Z
12
+ dependencies: []
55
13
  description: |-
56
14
  Users need to install native packages to install an extension library
57
15
  that depends on native packages. It bores users because users need to
@@ -76,21 +34,21 @@ files:
76
34
  - lib/native-package-installer/os-release.rb
77
35
  - lib/native-package-installer/platform.rb
78
36
  - lib/native-package-installer/platform/alt-linux.rb
37
+ - lib/native-package-installer/platform/amazon-linux.rb
79
38
  - lib/native-package-installer/platform/arch-linux.rb
80
39
  - lib/native-package-installer/platform/debian.rb
81
40
  - lib/native-package-installer/platform/fedora.rb
82
41
  - lib/native-package-installer/platform/freebsd.rb
42
+ - lib/native-package-installer/platform/gentoo-linux.rb
83
43
  - lib/native-package-installer/platform/homebrew.rb
84
44
  - lib/native-package-installer/platform/macports.rb
85
45
  - lib/native-package-installer/platform/msys2.rb
86
46
  - lib/native-package-installer/platform/pld-linux.rb
87
- - lib/native-package-installer/platform/redhat.rb
47
+ - lib/native-package-installer/platform/red-hat-enterprise-linux.rb
88
48
  - lib/native-package-installer/platform/suse.rb
89
49
  - lib/native-package-installer/platform/ubuntu.rb
90
50
  - lib/native-package-installer/platform/unknown.rb
91
51
  - lib/native-package-installer/version.rb
92
- - test/run-test.rb
93
- - test/test-executable-finder.rb
94
52
  homepage: https://github.com/ruby-gnome/native-package-installer
95
53
  licenses:
96
54
  - LGPL-3+
@@ -114,6 +72,4 @@ rubygems_version: 3.4.0.dev
114
72
  signing_key:
115
73
  specification_version: 4
116
74
  summary: native-package-installer helps to install native packages on "gem install"
117
- test_files:
118
- - test/run-test.rb
119
- - test/test-executable-finder.rb
75
+ test_files: []
@@ -1,90 +0,0 @@
1
- # Copyright (C) 2013 Ruby-GNOME Project Team
2
- #
3
- # This library is free software: you can redistribute it and/or modify
4
- # it under the terms of the GNU Lesser General Public License as published by
5
- # the Free Software Foundation, either version 3 of the License, or
6
- # (at your option) any later version.
7
- #
8
- # This program is distributed in the hope that it will be useful,
9
- # but WITHOUT ANY WARRANTY; without even the implied warranty of
10
- # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
- # GNU Lesser General Public License for more details.
12
- #
13
- # You should have received a copy of the GNU Lesser General Public License
14
- # along with this program. If not, see <http://www.gnu.org/licenses/>.
15
-
16
- require "fileutils"
17
-
18
- require "native-package-installer/executable-finder"
19
-
20
- class ExecutableFinderTest < Test::Unit::TestCase
21
- def setup
22
- @original_path = ENV["PATH"]
23
- setup_base_dir
24
- setup_path
25
- end
26
-
27
- def setup_base_dir
28
- @base_dir = File.join(File.dirname(__FILE__), "tmp")
29
- FileUtils.rm_rf(@base_dir)
30
- FileUtils.mkdir_p(@base_dir)
31
- end
32
-
33
- def teardown_base_dir
34
- FileUtils.rm_rf(@base_dir)
35
- end
36
-
37
- def setup_path
38
- paths = [
39
- File.join(@base_dir, "nonexistent"),
40
- File.join(@base_dir, "bin"),
41
- File.join(@base_dir, "sbin"),
42
- ]
43
- ENV["PATH"] = paths.join(File::PATH_SEPARATOR)
44
- end
45
-
46
- def teardown
47
- teardown_base_dir
48
- ENV["PATH"] = @original_path
49
- end
50
-
51
- private
52
- def create_finder(basename)
53
- NativePackageInstaller::ExecutableFinder.new(basename)
54
- end
55
-
56
- class TestFind < self
57
- def test_found
58
- finder = create_finder("ls")
59
- ls = File.join(@base_dir, "bin", "ls")
60
- stub(File).stat(ls) do
61
- stat = stub(Object.new)
62
- stat.file? {true}
63
- stat.executable? {true}
64
- stat
65
- end
66
- stub(File).stat.with_any_args do
67
- raise Errno::ENOENT
68
- end
69
- assert_equal(ls, finder.find)
70
- end
71
- end
72
-
73
- class TestExist < self
74
- def test_true
75
- finder = create_finder("ls")
76
- stub(finder).find do
77
- File.join(@base_dir, "bin", "ls")
78
- end
79
- assert_true(finder.exist?)
80
- end
81
-
82
- def test_false
83
- finder = create_finder("ls")
84
- stub(finder).find do
85
- nil
86
- end
87
- assert_false(finder.exist?)
88
- end
89
- end
90
- end