native-package-installer 1.0.5 → 1.1.1

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
- SHA1:
3
- metadata.gz: 4ab9676006e47245974193589cc2dc1d7d2458ca
4
- data.tar.gz: dfe5a5ea8d47fe26cd6846a1927917d98a93dcc2
2
+ SHA256:
3
+ metadata.gz: 2aa12c4733223ecb4697821c92e0eaba5112bbfae5a555bfd1c3210d056f5395
4
+ data.tar.gz: ba2f24290c5a26fe092925136dd29965f9cc8bd803e9c18ad28343b01928f0ab
5
5
  SHA512:
6
- metadata.gz: c3afb0b87c15fa1568838bcebcb277a0022e027630f45ae6c3da340e5a710865328f3b581efd0d400a60dfccbd088006954c1818853251107ce7041067fd0097
7
- data.tar.gz: e6e0dbbfb96804dc170ad408a5a96a47347c94c43841f61ed7969b3acb6328d32e8c38353f808f0646816d91cde7ac92d933c622a1775c06664057187d8a9a9e
6
+ metadata.gz: 39a5ed187c1f0a687216ccdc18035c9e7ff9f13a963e788831d17c4d9667227cb8aa6e51d3948f08d10f4331c872879e9b8288bca86ea5331abe5e050458279a
7
+ data.tar.gz: 502a728e427413d0e41f747bad0b6ab4bd4ae0c4ab1578db3ac8c4daa86feaf893446aaaa29b1e6d529572795a3084d4300e375b00ed96bdc41dafc51ec14b69
data/README.md CHANGED
@@ -1,9 +1,16 @@
1
- # README
1
+ # native-package-installer
2
2
 
3
- TODO...
3
+ [![Gem Version](https://badge.fury.io/rb/native-package-installer.svg)](https://badge.fury.io/rb/native-package-installer)
4
+
5
+ Users need to install native packages to install an extension library
6
+ that depends on native packages. It bores users because users need to
7
+ install native packages and an extension library separately.
8
+ native-package-installer helps to install native packages on "gem install".
9
+ Users can install both native packages and an extension library by one action,
10
+ "gem install".
4
11
 
5
12
  ## License
6
13
 
7
- Copyright (C) 2013-2017 Ruby-GNOME2 Project Team
14
+ Copyright (C) 2013-2020 Ruby-GNOME Project Team
8
15
 
9
16
  LGPL-3 or later. See doc/text/lgpl-3.txt for details.
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
1
1
  # -*- ruby -*-
2
2
  #
3
- # Copyright (C) 2013 Ruby-GNOME2 Project Team
3
+ # Copyright (C) 2013 Ruby-GNOME Project Team
4
4
  #
5
5
  # This library is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published by
@@ -1,5 +1,68 @@
1
1
  # News
2
2
 
3
+ ## 1.1.1 - 2021-01-17
4
+
5
+ ### Improvements
6
+
7
+ * [CentOS 8] Followed the powertools repository name change.
8
+
9
+ ## 1.1.0 - 2020-04-12
10
+
11
+ ### Improvements
12
+
13
+ * Updated README.
14
+ [GitHub#11][Patch by kojix2]
15
+
16
+ * Added support for Raspbian.
17
+ [GitHub#12][Patch by xetum]
18
+
19
+ ### Thanks
20
+
21
+ * kojix2
22
+
23
+ * xetum
24
+
25
+ ## 1.0.9 - 2019-12-10
26
+
27
+ ### Improvements
28
+
29
+ * Added support for Ubuntu specific package.
30
+ [GitHub#9][Patch by İsmail Arılık]
31
+
32
+ ### Thanks
33
+
34
+ * İsmail Arılık
35
+
36
+ ## 1.0.8 - 2019-10-10
37
+
38
+ ### Improvements
39
+
40
+ * Enabled PowerTools repository on CentOS 8.
41
+
42
+ ## 1.0.7 - 2019-03-09
43
+
44
+ ### Fixes
45
+
46
+ * Fixed 32bit MSYS2 detection.
47
+
48
+ ## 1.0.6 - 2017-12-05
49
+
50
+ ### Improvements
51
+
52
+ * Added meta character support in package name.
53
+ [GitHub#8][Reported by Mamoru TASAKA]
54
+
55
+ ### Fixes
56
+
57
+ * Removed needless ArchLinux fallback from PLD Linux.
58
+ [GitHub#7][Reported by Elan Ruusamäe]
59
+
60
+ ### Thanks
61
+
62
+ * Elan Ruusamäe
63
+
64
+ * Mamoru TASAKA
65
+
3
66
  ## 1.0.5 - 2017-11-11
4
67
 
5
68
  ### Improvements
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017 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
@@ -37,7 +37,9 @@ class NativePackageInstaller
37
37
  return false if package.nil?
38
38
 
39
39
  package_name, *options = package
40
- package_command_line = [package_name, *options].join(" ")
40
+ package_command_line = [package_name, *options].collect do |component|
41
+ Shellwords.escape(component)
42
+ end.join(" ")
41
43
 
42
44
  install_command = "#{@platform.install_command} #{package_command_line}"
43
45
  if have_priviledge?
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013-2017 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
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017-2019 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
@@ -37,13 +37,14 @@ require "native-package-installer/platform/msys2"
37
37
 
38
38
  require "native-package-installer/platform/freebsd"
39
39
 
40
+ require "native-package-installer/platform/alt-linux"
41
+ require "native-package-installer/platform/arch-linux"
40
42
  require "native-package-installer/platform/debian"
41
43
  require "native-package-installer/platform/fedora"
44
+ require "native-package-installer/platform/pld-linux"
42
45
  require "native-package-installer/platform/redhat"
43
46
  require "native-package-installer/platform/suse"
44
- require "native-package-installer/platform/alt-linux"
45
- require "native-package-installer/platform/arch-linux"
46
- require "native-package-installer/platform/pld-linux"
47
+ require "native-package-installer/platform/ubuntu"
47
48
 
48
49
  require "native-package-installer/platform/homebrew"
49
50
 
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017 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
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017 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
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013-2019 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
@@ -20,7 +20,16 @@ class NativePackageInstaller
20
20
 
21
21
  class << self
22
22
  def current_platform?
23
- File.exist?("/etc/debian_version")
23
+ return false unless File.exist?("/etc/os-release")
24
+ File.readlines("/etc/os-release").each do |line|
25
+ case line.chomp
26
+ when "ID=debian"
27
+ return true
28
+ when "ID=raspbian"
29
+ return true
30
+ end
31
+ end
32
+ return false
24
33
  end
25
34
  end
26
35
 
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017 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
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017 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
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017 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
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017 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
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017-2019 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
@@ -27,7 +27,7 @@ class NativePackageInstaller
27
27
  def pacman_path
28
28
  finder = ExecutableFinder.new("pacman")
29
29
  case RUBY_PLATFORM
30
- when "x86-mingw32"
30
+ when "i386-mingw32"
31
31
  Dir.glob("c:/msys{64,32,*}/usr/bin") do |bin|
32
32
  finder.append_path(bin)
33
33
  end
@@ -41,7 +41,7 @@ class NativePackageInstaller
41
41
 
42
42
  def package_prefix
43
43
  case RUBY_PLATFORM
44
- when "x86-mingw32"
44
+ when "i386-mingw32"
45
45
  "mingw-w64-i686-"
46
46
  when "x64-mingw32"
47
47
  "mingw-w64-x86_64-"
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017 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
@@ -25,7 +25,7 @@ class NativePackageInstaller
25
25
  end
26
26
 
27
27
  def package(spec)
28
- spec[:pld_linux] || spec[:arch_linux]
28
+ spec[:pld_linux]
29
29
  end
30
30
 
31
31
  def install_command
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017-2019 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
@@ -29,12 +29,22 @@ class NativePackageInstaller
29
29
  end
30
30
 
31
31
  def install_command
32
- "yum install -y"
32
+ if major_version >= 8
33
+ "dnf install --enablerepo=powertools -y"
34
+ else
35
+ "yum install -y"
36
+ end
33
37
  end
34
38
 
35
39
  def need_super_user_priviledge?
36
40
  true
37
41
  end
42
+
43
+ private
44
+ def major_version
45
+ major_version_string = File.read("/etc/redhat-release")[/(\d+)/, 0]
46
+ Integer(major_version_string, 10)
47
+ end
38
48
  end
39
49
  end
40
50
  end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017 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
@@ -0,0 +1,37 @@
1
+ # Copyright (C) 2019 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 "native-package-installer/platform/debian"
17
+
18
+ class NativePackageInstaller
19
+ module Platform
20
+ class Ubuntu < Debian
21
+ Platform.register(self)
22
+
23
+ class << self
24
+ def current_platform?
25
+ return false unless File.exist?("/etc/lsb-release")
26
+ File.readlines("/etc/lsb-release").any? do |line|
27
+ line.chomp == "DISTRIB_ID=Ubuntu"
28
+ end
29
+ end
30
+ end
31
+
32
+ def package(spec)
33
+ spec[:ubuntu] || spec[:debian]
34
+ end
35
+ end
36
+ end
37
+ end
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2017 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
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013-2017 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013-2021 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.0.5"
17
+ VERSION = "1.1.1"
18
18
  end
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env ruby
2
2
  #
3
- # Copyright (C) 2013 Ruby-GNOME2 Project Team
3
+ # Copyright (C) 2013 Ruby-GNOME Project Team
4
4
  #
5
5
  # This library is free software: you can redistribute it and/or modify
6
6
  # it under the terms of the GNU Lesser General Public License as published by
@@ -1,4 +1,4 @@
1
- # Copyright (C) 2013 Ruby-GNOME2 Project Team
1
+ # Copyright (C) 2013 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
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: native-package-installer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kouhei Sutou
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-11-11 00:00:00.000000000 Z
11
+ date: 2021-01-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -85,11 +85,12 @@ files:
85
85
  - lib/native-package-installer/platform/pld-linux.rb
86
86
  - lib/native-package-installer/platform/redhat.rb
87
87
  - lib/native-package-installer/platform/suse.rb
88
+ - lib/native-package-installer/platform/ubuntu.rb
88
89
  - lib/native-package-installer/platform/unknown.rb
89
90
  - lib/native-package-installer/version.rb
90
91
  - test/run-test.rb
91
92
  - test/test-executable-finder.rb
92
- homepage: https://github.com/ruby-gnome2/native-package-installer
93
+ homepage: https://github.com/ruby-gnome/native-package-installer
93
94
  licenses:
94
95
  - LGPL-3+
95
96
  metadata: {}
@@ -108,11 +109,10 @@ required_rubygems_version: !ruby/object:Gem::Requirement
108
109
  - !ruby/object:Gem::Version
109
110
  version: '0'
110
111
  requirements: []
111
- rubyforge_project:
112
- rubygems_version: 2.5.2.1
112
+ rubygems_version: 3.3.0.dev
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: native-package-installer helps to install native packages on "gem install"
116
116
  test_files:
117
- - test/test-executable-finder.rb
118
117
  - test/run-test.rb
118
+ - test/test-executable-finder.rb