ref: refs/heads/network
commit 6ad88caa3cbcb204b475f3a7676d3d38e46c37cf
Author: Jiri Suchomel
Date: Thu Sep 3 15:02:05 2009 +0200
make custom package webclient a separate package, so it is easily configurable
---
plugins/custom_services/README | 18 +++++
plugins/custom_services/Rakefile | 10 +++
plugins/custom_services/app/.readme | 1 +
plugins/custom_services/config/rails_parent.rb | 15 +++++
.../yast2-webclient-custom-services.changes | 5 ++
.../package/yast2-webclient-custom-services.spec | 66 ++++++++++++++++++++
.../public/icons/custom-service.png | Bin 0 -> 3801 bytes
plugins/custom_services/shortcuts.yml | 9 +++
8 files changed, 124 insertions(+), 0 deletions(-)
diff --git a/plugins/custom_services/README b/plugins/custom_services/README
new file mode 100644
index 0000000..c639ebe
--- /dev/null
+++ b/plugins/custom_services/README
@@ -0,0 +1,18 @@
+Custom Services
+===============
+
+Plugin for handling custom services.
+
+
+To use your own name of plugin Control Panel (e.g. same as name of custom service),
+edit the title and description items in shortcuts.yml file.
+
+To use your own icon for this plugin, put the icon file under public/icons directory
+and point to its nam in shortcuts.yml file.
+
+The service(s) that should be managed by this plugin is defined in the
+custom_services.yml file present on the managed system. The example of such files
+is contained in yast2-webservice-services package.
+
+
+Copyright (c) 2009 Novell, released under the MIT license
diff --git a/plugins/custom_services/Rakefile b/plugins/custom_services/Rakefile
new file mode 100644
index 0000000..ca63e76
--- /dev/null
+++ b/plugins/custom_services/Rakefile
@@ -0,0 +1,10 @@
+require 'rake'
+require 'rake/testtask'
+require 'rake/rdoctask'
+require File.join(File.dirname(__FILE__), 'config', 'rails_parent')
+require File.join(RailsParent.parent, 'config', 'boot')
+require 'tasks/rails'
+
+desc 'Default: run unit tests.'
+task :default => :test
+
diff --git a/plugins/custom_services/app/.readme b/plugins/custom_services/app/.readme
new file mode 100644
index 0000000..cabe428
--- /dev/null
+++ b/plugins/custom_services/app/.readme
@@ -0,0 +1 @@
+Just an empty directory, so the plugin can be registered.
diff --git a/plugins/custom_services/config/rails_parent.rb b/plugins/custom_services/config/rails_parent.rb
new file mode 100644
index 0000000..59e7892
--- /dev/null
+++ b/plugins/custom_services/config/rails_parent.rb
@@ -0,0 +1,15 @@
+class RailsParent
+
+ def RailsParent.parent
+ parent = ENV["RAILS_PARENT"]
+ unless parent
+ parent = File.expand_path(File.join('..','..','..', 'webclient'), File.dirname(__FILE__))
+ unless File.directory?( parent || "" )
+ $stderr.puts "Nope: #{parent}\nPlease set RAILS_PARENT environment"
+ exit 1
+ end
+ end
+ parent
+ end
+
+end
diff --git a/plugins/custom_services/package/yast2-webclient-custom-services.changes b/plugins/custom_services/package/yast2-webclient-custom-services.changes
new file mode 100644
index 0000000..1ed622c
--- /dev/null
+++ b/plugins/custom_services/package/yast2-webclient-custom-services.changes
@@ -0,0 +1,5 @@
+-------------------------------------------------------------------
+Tue Sep 1 15:54:02 CEST 2009 - jsuchome@suse.cz
+
+- split from yast2-webclient-services
+- only contain customizable shortcuts.yml file
diff --git a/plugins/custom_services/package/yast2-webclient-custom-services.spec b/plugins/custom_services/package/yast2-webclient-custom-services.spec
new file mode 100644
index 0000000..8616bf7
--- /dev/null
+++ b/plugins/custom_services/package/yast2-webclient-custom-services.spec
@@ -0,0 +1,66 @@
+#
+# spec file for package yast2-webclient-services (Version 0.1)
+#
+# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
+# This file and all modifications and additions to the pristine
+# package are under the same license as the package itself.
+#
+# Please submit bugfixes or comments via http://bugs.opensuse.org/
+#
+
+
+Name: yast2-webclient-custom-services
+PreReq: yast2-webclient
+License: GPL
+Group: Productivity/Networking/Web/Utilities
+Autoreqprov: on
+Version: 0.0.1
+Release: 0
+Summary: YaST2 - Webclient - Custom Services
+Source: www.tar.bz2
+BuildRoot: %{_tmppath}/%{name}-%{version}-build
+BuildArch: noarch
+
+Requires: yast2-webclient-services
+
+#
+%define pkg_user yast
+%define plugin_name services
+#
+
+
+%description
+YaST2 - Webclient - UI for YaST-webservice in order to handle custom service(s).
+Authors:
+--------
+ Stefan Schubert
+
+%prep
+%setup -q -n www
+
+%build
+export RAILS_PARENT=/srv/www/yast
+(rake makemo)
+
+%install
+
+#
+# Install all web and frontend parts.
+#
+mkdir -p $RPM_BUILD_ROOT/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}
+cp -a * $RPM_BUILD_ROOT/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}
+
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+%dir /srv/www/%{pkg_user}
+%dir /srv/www/%{pkg_user}/vendor
+%dir /srv/www/%{pkg_user}/vendor/plugins
+%dir /srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}
+/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/README
+/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/app
+/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/shortcuts.yml
+/srv/www/%{pkg_user}/vendor/plugins/%{plugin_name}/config
diff --git a/plugins/custom_services/public/icons/custom-service.png b/plugins/custom_services/public/icons/custom-service.png
new file mode 100644
index 0000000..8584229
Binary files /dev/null and b/plugins/custom_services/public/icons/custom-service.png differ
diff --git a/plugins/custom_services/shortcuts.yml b/plugins/custom_services/shortcuts.yml
new file mode 100644
index 0000000..ec600fd
--- /dev/null
+++ b/plugins/custom_services/shortcuts.yml
@@ -0,0 +1,9 @@
+main:
+ # put your icon name here
+ icon: 'icons/custom-service.png'
+ url: /services?custom=1
+ groups: [ Services ]
+ tags: [ init, script, service ]
+ # replace with own title and description
+ title: Custom Service
+ description: Manage custom service
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org