vici: Use "gem"-assisted vici ruby gem building and installation
authorMartin Willi <martin@revosec.ch>
Wed, 8 Oct 2014 11:46:22 +0000 (13:46 +0200)
committerMartin Willi <martin@revosec.ch>
Fri, 10 Oct 2014 09:42:17 +0000 (11:42 +0200)
configure.ac
src/libcharon/plugins/vici/Makefile.am
src/libcharon/plugins/vici/ruby/.gitignore
src/libcharon/plugins/vici/ruby/Makefile.am [new file with mode: 0644]
src/libcharon/plugins/vici/ruby/vici.gemspec [deleted file]
src/libcharon/plugins/vici/ruby/vici.gemspec.in [new file with mode: 0644]

index 0195170..dab78a9 100644 (file)
@@ -1727,6 +1727,7 @@ AC_CONFIG_FILES([
        src/libcharon/plugins/maemo/Makefile
        src/libcharon/plugins/stroke/Makefile
        src/libcharon/plugins/vici/Makefile
+       src/libcharon/plugins/vici/ruby/Makefile
        src/libcharon/plugins/updown/Makefile
        src/libcharon/plugins/dhcp/Makefile
        src/libcharon/plugins/unit_tester/Makefile
index 7e459c5..da71de3 100644 (file)
@@ -67,3 +67,10 @@ vici_tests_LDFLAGS = @COVERAGE_LDFLAGS@
 vici_tests_LDADD = \
        $(top_builddir)/src/libstrongswan/libstrongswan.la \
        $(top_builddir)/src/libstrongswan/tests/libtest.la
+
+
+SUBDIRS =
+
+if USE_RUBY_GEMS
+SUBDIRS += ruby
+endif
diff --git a/src/libcharon/plugins/vici/ruby/Makefile.am b/src/libcharon/plugins/vici/ruby/Makefile.am
new file mode 100644 (file)
index 0000000..c4dbb80
--- /dev/null
@@ -0,0 +1,20 @@
+vici.gemspec: $(srcdir)/vici.gemspec.in
+       $(AM_V_GEN) sed \
+       -e "s:@GEM_VERSION@:$(PACKAGE_VERSION):" \
+       $(srcdir)/vici.gemspec.in > $@
+
+vici-$(PACKAGE_VERSION).gem: vici.gemspec
+       $(GEM) build vici.gemspec
+
+all-local: vici-$(PACKAGE_VERSION).gem
+
+clean-local:
+       rm -f vici.gemspec vici-$(PACKAGE_VERSION).gem
+
+install-data-local: vici-$(PACKAGE_VERSION).gem
+       $(GEM) install --install-dir $(DESTDIR)$(RUBYGEMDIR) \
+               vici-$(PACKAGE_VERSION).gem
+
+uninstall-local:
+       $(GEM) uninstall --install-dir $(DESTDIR)$(RUBYGEMDIR) \
+               --version $(PACKAGE_VERSION) vici
diff --git a/src/libcharon/plugins/vici/ruby/vici.gemspec b/src/libcharon/plugins/vici/ruby/vici.gemspec
deleted file mode 100644 (file)
index 36bc21b..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-Gem::Specification.new do |s|
-  s.name          = "vici"
-  s.version       = "0.0.1"
-  s.authors       = ["Martin Willi"]
-  s.email         = ["martin@strongswan.ch"]
-  s.description   = %q{
-     The strongSwan VICI protocol allows external application to monitor,
-     configure and control the IKE daemon charon. This ruby gem provides a
-     native client side implementation of the VICI protocol, well suited to
-     script automated tasks in a relaible way.
-  }
-  s.summary       = "Native ruby interface for strongSwan VICI"
-  s.homepage      = "https://wiki.strongswan.org/projects/strongswan/wiki/Vici"
-  s.license       = "MIT"
-  s.files         = "lib/vici.rb"
-end
diff --git a/src/libcharon/plugins/vici/ruby/vici.gemspec.in b/src/libcharon/plugins/vici/ruby/vici.gemspec.in
new file mode 100644 (file)
index 0000000..5ad61c0
--- /dev/null
@@ -0,0 +1,16 @@
+Gem::Specification.new do |s|
+  s.name          = "vici"
+  s.version       = "@GEM_VERSION@"
+  s.authors       = ["Martin Willi"]
+  s.email         = ["martin@strongswan.ch"]
+  s.description   = %q{
+     The strongSwan VICI protocol allows external application to monitor,
+     configure and control the IKE daemon charon. This ruby gem provides a
+     native client side implementation of the VICI protocol, well suited to
+     script automated tasks in a relaible way.
+  }
+  s.summary       = "Native ruby interface for strongSwan VICI"
+  s.homepage      = "https://wiki.strongswan.org/projects/strongswan/wiki/Vici"
+  s.license       = "MIT"
+  s.files         = "lib/vici.rb"
+end