1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
|
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# frozen_string_literal: true
require 'digest/md5'
require 'net/http'
require_relative 'config/config'
require_relative 'lib/package'
require_relative 'lib/download'
task :dmd, [:version] do |_, arguments|
raise 'Version is not specified.' unless arguments.key? :version
dub_version = '1.29.0'
dscanner_version = '0.12.2'
dcd_version = '0.13.6'
tarball_name = "dmd.#{arguments[:version]}.linux.tar.xz"
uri = URI "http://downloads.dlang.org/releases/2.x/#{arguments[:version]}/#{tarball_name}"
checksum = {
dmd: download(uri, "slackbuilds/development/dmd/#{tarball_name}").hexdigest
}
package = Package.new 'development/dmd',
version: arguments[:version],
homepage: 'https://dlang.org'
write_info package,
downloads: [Download.new(uri.to_s, checksum[:dmd])]
update_slackbuild_version 'development/dmd', package.version
commit 'development/dmd', version
uri = URI "https://codeload.github.com/dlang/tools/tar.gz/v#{package.version}"
checksum[:tools] = download_and_deploy uri,
"development/d-tools/tools-#{package.version}.tar.gz"
uri = URI "https://codeload.github.com/dlang/dub/tar.gz/v#{dub_version}"
checksum[:dub] = download_and_deploy uri,
"development/d-tools/dub-#{dub_version}.tar.gz"
checksum[:dscanner] = clone 'https://github.com/dlang-community/D-Scanner.git',
"development/d-tools/D-Scanner-#{dscanner_version}.tar.xz"
checksum[:dcd] = clone 'https://github.com/dlang-community/DCD.git',
"development/d-tools/DCD-#{dcd_version}.tar.xz"
package = Package.new 'development/d-tools',
version: arguments[:version],
homepage: 'https://dlang.org',
requires: ['dmd']
write_info package,
downloads: [
Download.new(hosted_sources("/d-tools/dub-#{dub_version}.tar.gz"), checksum[:dub]),
Download.new(hosted_sources("/d-tools/tools-#{package.version}.tar.gz"), checksum[:tools]),
Download.new(hosted_sources("/d-tools/D-Scanner-#{dscanner_version}.tar.xz"), checksum[:dscanner]),
Download.new(hosted_sources("/d-tools/DCD-#{dcd_version}.tar.xz"), checksum[:dcd])
]
slackbuild_filename = 'slackbuilds/development/d-tools/d-tools.SlackBuild'
slackbuild_contents = File.read(slackbuild_filename)
.gsub(/^DUB_VERSION=\${DUB_VERSION:-.+/,
"DUB_VERSION=${DUB_VERSION:-#{dub_version}}")
.gsub(/^DSCANNER_VERSION=\${DSCANNER_VERSION:-.+/,
"DSCANNER_VERSION=${DSCANNER_VERSION:-#{dscanner_version}}")
.gsub(/^DCD_VERSION=\${DCD_VERSION:-.+/,
"DCD_VERSION=${DCD_VERSION:-#{dcd_version}}")
File.open(slackbuild_filename, 'w') { |file| file.puts slackbuild_contents }
update_slackbuild_version 'development/d-tools', package.version
commit 'development/d-tools', package.version
end
task :composer, [:version] do |_, arguments|
raise 'Version is not specified.' unless arguments.key? :version
package = Package.new 'development/composer',
version: arguments[:version],
homepage: 'https://getcomposer.org/'
uri = "https://getcomposer.org/download/#{arguments[:version]}/composer.phar"
checksum = download URI(uri), 'slackbuilds/development/composer/composer.phar'
write_info package, downloads: [Download.new(uri, checksum.hexdigest)]
update_slackbuild_version 'development/composer', arguments[:version]
commit 'development/composer', arguments[:version]
end
task 'universal-ctags', [:version] do |_, arguments|
raise 'Version is not specified.' unless arguments.key? :version
package = Package.new 'development/universal-ctags',
version: arguments[:version],
homepage: 'https://ctags.io/',
requires: ['%README%']
uri = "https://github.com/universal-ctags/ctags/archive/#{arguments[:version]}/ctags-#{arguments[:version]}.tar.gz"
tarball = "slackbuilds/development/universal-ctags/ctags-#{arguments[:version]}.tar.gz"
checksum = download URI(uri), tarball
download = "https://download.dlackware.com/hosted-sources/universal-ctags/ctags-#{arguments[:version]}.tar.gz"
write_info package,
downloads: [Download.new(download, checksum.hexdigest)]
update_slackbuild_version 'development/universal-ctags', arguments[:version]
sh 'scp', tarball, "#{CONFIG[:remote_path]}/universal-ctags"
commit 'development/universal-ctags', arguments[:version]
end
task :hhvm do
raise 'Version is not specified.' unless arguments.key? :version
checksum = {}
checksum[:hhvm] = clone 'https://github.com/facebook/hhvm.git',
"development/hhvm/hhvm-#{arguments[:version]}.tar.xz", 'HHVM-'
package = Package.new 'development/hhvm',
version: arguments[:version],
homepage: 'https://hhvm.com/',
requires: %w[tbb glog libdwarf libmemcached dobule-conversion]
write_info package,
downloads: [
Download.new(hosted_sources("/hhvm/hhvm-#{package.version}.tar.xz"), checksum[:hhvm], is64: true)
]
update_slackbuild_version 'development/hhvm', package.version
end
task :ioncube do
raise 'Version is not specified.' unless arguments.key? :version
tarball_name = {
'32' => "ioncube_loaders_lin_x86_#{arguments[:version]}.tar.gz",
'64' => "ioncube_loaders_lin_x86-64_#{arguments[:version]}.tar.gz"
}
uri = {
'32' => URI("http://downloads3.ioncube.com/loader_downloads/#{tarball_name['32']}"),
'64' => URI("http://downloads3.ioncube.com/loader_downloads/#{tarball_name['64']}")
}
checksum = {
'32' => download(uri['32'], "slackbuilds/development/ioncube-loader/#{tarball_name['32']}").hexdigest,
'64' => download(uri['64'], "slackbuilds/development/ioncube-loader/#{tarball_name['64']}").hexdigest
}
package = Package.new 'development/ioncube-loader',
version: arguments[:version],
homepage: 'https://www.ioncube.com'
write_info package,
downloads: [
Download.new(uri['32'], checksum['32']),
Download.new(uri['64'], checksum['64'], is64: true)
]
update_slackbuild_version 'development/ioncube-loader', package.version
commit 'development/ioncube-loader', package.version
end
|