2013-09-11 16:16:18 +01:00
|
|
|
require 'ffi'
|
|
|
|
|
|
|
|
module RPM
|
|
|
|
module C
|
|
|
|
|
|
|
|
extend ::FFI::Library
|
|
|
|
|
|
|
|
begin
|
2013-09-11 19:14:48 +01:00
|
|
|
ffi_lib ['librpm.so.3', 'librpm.so.2', 'librpm.so.1', 'rpm']
|
2013-09-11 16:16:18 +01:00
|
|
|
rescue LoadError => e
|
|
|
|
raise(
|
|
|
|
"Can't find rpm libs on your system: #{e.message}"
|
|
|
|
)
|
|
|
|
end
|
|
|
|
|
|
|
|
attach_function 'rpmvercmp', [:string, :string], :int
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|