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