mirror of
https://github.com/SELinuxProject/selinux
synced 2024-12-24 23:12:05 +00:00
d7dfd88158
This patch adds a SWIG specification file for ruby bindings for libsemanage. The spec file is almost identical to the python SWIG file with the exception that all list generating typemaps have been removed and the python related functions have been replaced with the corresponding ruby ones. Finally the Makefile is modified to be able to build the new bindings. Something to note is that on 64-bit systems ruby.h might be found somewhere under /usr/lib64 instead of /usr/lib so LIBDIR=/usr/lib64 will be needed to build the ruby bindings from source. Below is an example using the ruby bindings and produces the similar output to semodule -l #!/usr/bin/ruby require "semanage" handle = Semanage.semanage_handle_create Semanage.semanage_select_store(handle, "targeted", Semanage::SEMANAGE_CON_DIRECT) Semanage.semanage_connect(handle) module_info = Semanage.semanage_module_list(handle) modules = Array.new() module_info[2].times do |n| temp_module = Semanage.semanage_module_list_nth(module_info[1], n) mod_string = Semanage.semanage_module_get_name(temp_module).to_s + " " \ + Semanage.semanage_module_get_version(temp_module).to_s modules.push(mod_string) end puts "List of Installed Modules" modules.each do |str| puts str end Signed-off-by: David P. Quigley <dpquigl@tycho.nsa.gov> |
||
---|---|---|
.. | ||
example | ||
include | ||
man | ||
src | ||
tests | ||
ChangeLog | ||
COPYING | ||
Makefile | ||
VERSION |