-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathvirt-what.rb
46 lines (36 loc) · 1.36 KB
/
virt-what.rb
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
component "virt-what" do |pkg, settings, platform|
pkg.version "1.25"
pkg.md5sum "2345f1ec5fa0836bff4071659730ac8f"
pkg.url "https://people.redhat.com/~rjones/virt-what/files/virt-what-#{pkg.get_version}.tar.gz"
pkg.mirror "#{settings[:buildsources_url]}/virt-what-#{pkg.get_version}.tar.gz"
pkg.replaces 'pe-virt-what'
# Run-time requirements
unless platform.is_deb?
requires "util-linux"
end
if platform.is_rpm?
pkg.build_requires "util-linux"
end
if platform.is_linux?
if platform.architecture =~ /ppc64le$/
host_opt = '--host powerpc64le-unknown-linux-gnu'
elsif platform.architecture =~ /ppc64$/
host_opt = '--host powerpc64-unknown-linux-gnu'
end
end
if platform.is_cross_compiled_linux?
host_opt = "--host #{settings[:platform_triple]}"
pkg.environment "PATH" => "/opt/pl-build-tools/bin:$$PATH:#{settings[:bindir]}"
pkg.environment "CFLAGS" => settings[:cflags]
pkg.environment "LDFLAGS" => settings[:ldflags]
end
pkg.configure do
["./configure --prefix=#{settings[:prefix]} --sbindir=#{settings[:prefix]}/bin --libexecdir=#{settings[:prefix]}/lib/virt-what #{host_opt}"]
end
pkg.build do
["#{platform[:make]} -j$(shell expr $(shell #{platform[:num_cores]}) + 1)"]
end
pkg.install do
["#{platform[:make]} -j$(shell expr $(shell #{platform[:num_cores]}) + 1) install"]
end
end