itamae-plugin-recipe-highlight 0.2.0 → 0.3.0
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2160685314e586f026eaf4e5f082bcb54e6b384f0b137ee7dc141825fe63c2ac
|
4
|
+
data.tar.gz: 212ac98b6198685f296f5f73ad047086b39b8e5bca74fc68a9a225dee7f03a95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ad25864df90cf5ff7c36eb0f02c9e417a4c8ccca1e1d440451c08d2b40ca6e778e1648e13d2cb9e16f8307b38ee4b7c50905ee09e1213e07efcd55de7db592f
|
7
|
+
data.tar.gz: e71483e9ab2c9b6396db6e76eb09a42a3d885c0c5d210e353a4dc1a22d38b9c085186219b2d371ad1e1ce15e3def2c367790f92594ea1f627d4b2e7fa02e4fe6
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,27 @@
|
|
1
|
-
|
1
|
+
# Change log for Itamae plugin recipe Highlight
|
2
2
|
|
3
|
-
##
|
3
|
+
## Unreleased
|
4
|
+
|
5
|
+
## 0.3.0 - 2023-11-14
|
6
|
+
|
7
|
+
### Changed
|
8
|
+
|
9
|
+
* Update Highlight version to v4.10.
|
10
|
+
* The role of `node[:highlight][:tmp]`.
|
11
|
+
It is now a prefix for temporary directory path, and the full path is auto generated.
|
12
|
+
|
13
|
+
### Added
|
14
|
+
|
15
|
+
* `highlight` / `commands` / `wget` node attribute.
|
16
|
+
[GNU Wget][wget] is used for downloading the archive file.
|
17
|
+
|
18
|
+
[wget]: https://www.gnu.org/software/wget/
|
19
|
+
|
20
|
+
### Fixed
|
21
|
+
|
22
|
+
* Changed to use GNU Wget instead of the Itamae's HTTP request resource since updating archive files might somehow fail.
|
23
|
+
|
24
|
+
## 0.2.0 - 2023-09-11
|
4
25
|
|
5
26
|
### Added
|
6
27
|
|
@@ -13,6 +34,6 @@
|
|
13
34
|
* Skip downloading the signature when it exists.
|
14
35
|
* Skip fetching the public key when it's already imported.
|
15
36
|
|
16
|
-
##
|
37
|
+
## 0.1.0 - 2023-09-10
|
17
38
|
|
18
39
|
- Initial release
|
@@ -1,28 +1,29 @@
|
|
1
1
|
require 'shellwords'
|
2
2
|
require 'uri'
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
4
|
+
node.reverse_merge!(
|
5
|
+
{
|
6
|
+
highlight: {
|
7
|
+
tmp: '/tmp',
|
8
|
+
version: '4.10',
|
9
|
+
command: 'highlight',
|
10
|
+
verify: true,
|
11
|
+
dependencies: {
|
12
|
+
lua: 'liblua5.4-dev',
|
13
|
+
boost: 'libboost-dev'
|
14
|
+
},
|
15
|
+
commands: {
|
16
|
+
gpg: 'gpg',
|
17
|
+
grep: 'grep',
|
18
|
+
make: 'make',
|
19
|
+
tar: 'tar',
|
20
|
+
test: 'test',
|
21
|
+
type: 'type',
|
22
|
+
wget: 'wget',
|
23
|
+
}
|
21
24
|
}
|
22
25
|
}
|
23
|
-
|
24
|
-
|
25
|
-
node.replace(defaults.merge(node))
|
26
|
+
)
|
26
27
|
|
27
28
|
node.validate! do
|
28
29
|
{
|
@@ -41,123 +42,107 @@ node.validate! do
|
|
41
42
|
make: string,
|
42
43
|
tar: string,
|
43
44
|
type: string,
|
45
|
+
wget: string,
|
44
46
|
}
|
45
47
|
}
|
46
48
|
}
|
47
49
|
end
|
48
50
|
|
49
|
-
|
51
|
+
command_exists = [node[:highlight][:commands][:type], node[:highlight][:command]].shelljoin
|
50
52
|
|
51
|
-
|
53
|
+
grep_version = [node[:highlight][:commands][:grep], "highlight version #{ node[:highlight][:version] }"].shelljoin
|
54
|
+
print_version = [node[:highlight][:command], '--version'].shelljoin
|
55
|
+
updated = "#{ print_version } | #{ grep_version }"
|
52
56
|
|
53
|
-
|
57
|
+
Dir.mktmpdir(node[:highlight][:tmp]) do |tmp_dir|
|
58
|
+
source_dir = File.join(tmp_dir, "highlight-#{ node[:highlight][:version] }")
|
59
|
+
makefile_exists = [node[:highlight][:commands][:test], '-f', File.join(source_dir, 'makefile')].shelljoin
|
54
60
|
|
55
|
-
|
61
|
+
archive_file_name = "highlight-#{ node[:highlight][:version] }.tar.bz2"
|
62
|
+
archive_file_path = File.join(tmp_dir, archive_file_name)
|
63
|
+
download_root_url = 'http://www.andre-simon.de/zip/'
|
56
64
|
|
57
|
-
|
65
|
+
directory tmp_dir
|
58
66
|
|
59
|
-
|
60
|
-
print_version = [command, '--version'].shelljoin
|
61
|
-
updated = "#{ print_version } | #{ grep_version }"
|
67
|
+
package 'wget'
|
62
68
|
|
63
|
-
|
69
|
+
execute 'download archive file' do
|
70
|
+
cwd tmp_dir
|
71
|
+
download = [node[:highlight][:commands][:wget], URI.join(download_root_url, archive_file_name).to_s].shelljoin
|
72
|
+
command download
|
64
73
|
|
65
|
-
|
66
|
-
|
67
|
-
makefile_exists
|
74
|
+
not_if command_exists
|
75
|
+
not_if updated
|
76
|
+
not_if makefile_exists
|
77
|
+
end
|
68
78
|
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
not_if makefile_exists
|
73
|
-
end
|
79
|
+
if node[:highlight][:verify]
|
80
|
+
signature_name = "highlight-#{ node[:highlight][:version] }.tar.bz2.asc"
|
81
|
+
signature_path = File.join(tmp_dir, signature_name)
|
74
82
|
|
75
|
-
|
76
|
-
|
77
|
-
download_root_url = 'http://www.andre-simon.de/zip/'
|
83
|
+
http_request signature_path do
|
84
|
+
url URI.join(download_root_url, signature_name).to_s
|
78
85
|
|
79
|
-
|
80
|
-
|
86
|
+
not_if command_exists
|
87
|
+
not_if updated
|
88
|
+
not_if [node[:highlight][:commands][:test], '-f', signature_path].shelljoin
|
89
|
+
end
|
81
90
|
|
82
|
-
|
83
|
-
|
84
|
-
not_if makefile_exists
|
85
|
-
end
|
91
|
+
execute 'receive key' do
|
92
|
+
key_id = 'D805A7C7'
|
86
93
|
|
87
|
-
|
88
|
-
|
89
|
-
signature_path = File.join(tmp, signature_name)
|
94
|
+
fetch_key = [node[:highlight][:commands][:gpg], '--keyserver', 'pgp.mit.edu', '--recv-key', key_id].shelljoin
|
95
|
+
command fetch_key
|
90
96
|
|
91
|
-
|
92
|
-
|
97
|
+
not_if command_exists
|
98
|
+
not_if updated
|
93
99
|
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
100
|
+
export_public_key = [node[:highlight][:commands][:gpg], '--export', '--armor', key_id].shelljoin
|
101
|
+
check_not_yet_imported = [node[:highlight][:commands][:grep], 'nothing exported'].shelljoin
|
102
|
+
only_if "#{ export_public_key } | #{ check_not_yet_imported }"
|
103
|
+
end
|
98
104
|
|
99
|
-
|
105
|
+
execute 'verify' do
|
106
|
+
verify_archive = [node[:highlight][:commands][:gpg], '--verify', signature_path, archive_file_path].shelljoin
|
107
|
+
command verify_archive
|
100
108
|
|
101
|
-
|
102
|
-
|
109
|
+
not_if command_exists
|
110
|
+
not_if updated
|
111
|
+
end
|
112
|
+
end
|
103
113
|
|
104
|
-
|
105
|
-
|
114
|
+
execute 'extract' do
|
115
|
+
extract_archive = [node[:highlight][:commands][:tar], 'axf', archive_file_path].shelljoin
|
116
|
+
command extract_archive
|
117
|
+
cwd tmp_dir
|
106
118
|
|
107
119
|
not_if command_exists
|
108
120
|
not_if updated
|
121
|
+
not_if makefile_exists
|
122
|
+
end
|
109
123
|
|
110
|
-
|
111
|
-
|
112
|
-
|
124
|
+
[node[:highlight][:dependencies][:lua], node[:highlight][:dependencies][:boost]].each do |pack|
|
125
|
+
package pack do
|
126
|
+
not_if command_exists
|
127
|
+
not_if updated
|
128
|
+
end
|
113
129
|
end
|
114
130
|
|
115
|
-
execute '
|
116
|
-
|
117
|
-
command
|
131
|
+
execute 'compile' do
|
132
|
+
compile_cli = [node[:highlight][:commands][:make], 'cli'].shelljoin
|
133
|
+
command compile_cli
|
134
|
+
cwd source_dir
|
118
135
|
|
119
136
|
not_if command_exists
|
120
137
|
not_if updated
|
121
138
|
end
|
122
|
-
end
|
123
|
-
|
124
|
-
execute 'extract' do
|
125
|
-
extract_archive = [node.dig(:highlight, :commands, :tar), 'axf', archive_file_path].shelljoin
|
126
|
-
command extract_archive
|
127
|
-
cwd tmp
|
128
|
-
|
129
|
-
not_if command_exists
|
130
|
-
not_if updated
|
131
|
-
not_if makefile_exists
|
132
|
-
end
|
133
|
-
|
134
|
-
lua = node.dig(:highlight, :dependencies, :lua)
|
135
|
-
boost = node.dig(:highlight, :dependencies, :boost)
|
136
139
|
|
137
|
-
|
138
|
-
|
140
|
+
execute 'install' do
|
141
|
+
install_files = [node[:highlight][:commands][:make], 'install'].shelljoin
|
142
|
+
command install_files
|
143
|
+
cwd source_dir
|
139
144
|
|
140
145
|
not_if command_exists
|
141
146
|
not_if updated
|
142
147
|
end
|
143
148
|
end
|
144
|
-
|
145
|
-
make = node.dig(:highlight, :commands, :make)
|
146
|
-
|
147
|
-
execute 'compile' do
|
148
|
-
compile_cli = [make, 'cli'].shelljoin
|
149
|
-
command compile_cli
|
150
|
-
cwd source_dir
|
151
|
-
|
152
|
-
not_if command_exists
|
153
|
-
not_if updated
|
154
|
-
end
|
155
|
-
|
156
|
-
execute 'install' do
|
157
|
-
install_files = [make, 'install'].shelljoin
|
158
|
-
command install_files
|
159
|
-
cwd source_dir
|
160
|
-
|
161
|
-
not_if command_exists
|
162
|
-
not_if updated
|
163
|
-
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: itamae-plugin-recipe-highlight
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gemmaro
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-11-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: itamae
|