# Generated from drupalcluster-0.1.2.gem by gem2rpm -*- rpm-spec -*-
%global gem_name drupalcluster

Name: rubygem-%{gem_name}
Version: 0.1.2
Release: 1%{?dist}
Summary: Create/delete/test a multiserver Drupal site in Amazon cloud
License: Nonstandard
URL: https://github.com/zellerede/drupalcluster
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: ruby
BuildArch: noarch

%description
+drupalcluster+  is a command line tool to quickly
deploy a Drupal hosting cluster of a scalable amount [2..5]
of virtual webservers.
!! AWS identity is required for this script !!
Your AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY should be either
environment variables, or set in ~/.aws/credentials.
The configuration file contains additional details for the cluster,
including an ssh KeyName that's needed to access the servers.
The KeyName defaults to 'Drupal', easiest if it's precreated.
$HOME/.drc/drupalcluster.conf
This is a demo version only, builds Drupal on HTTP connection.
Don't use it seriously. 
Especially, don't post personal/sensitive data on your Drupal site.
==== Commands
create name      -- Creates a Drupal hosting cluster
check [name]     -- Checks the status of creation/deletion 
delete name      -- Deletes permanently the given cluster
test name|url    -- Sends a simple HTTP GET to the URL (of the given cluster)
attack instance  -- Permanently terminates the given server instance
list             -- Lists the recently created/deleted clusters.
-----------------------
*** Please contribute to add rspec's ***.


%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}.

%prep
%setup -q -n %{gem_name}-%{version}

%build
# Create the gem as gem install only works on a gem file
gem build ../%{gem_name}-%{version}.gemspec

# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir
# by default, so that we can move it into the buildroot in %%install
%gem_install

%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* \
        %{buildroot}%{gem_dir}/


mkdir -p %{buildroot}%{_bindir}
cp -a .%{_bindir}/* \
        %{buildroot}%{_bindir}/

find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x

%check
pushd .%{gem_instdir}
# Run the test suite.
popd

%files
%dir %{gem_instdir}
%{_bindir}/drupalcluster
%{gem_instdir}/bin
%{gem_instdir}/conf
%{gem_instdir}/data
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}
%{gem_instdir}/drupalcluster.gemspec
%doc %{gem_instdir}/readme.md

%changelog
* Mon Sep 13 2021 mockbuilder - 0.1.2-1
- Initial package