File dba-puppet-dashboard-1.2.20.spec of Package dba-puppet-dashboard-1.2.20

%define pkg_name        puppet-dashboard
%define real_vers       1.2.20
%define pkg_vers        1220
%define prefix          /DBA/puppet/%{real_vers}
%define maketest        0
%define dba_ruby_pkg    dba-ruby-193
%define dba_ruby_path   /DBA/ruby/1.9.3
%define dba_puppet_pkg    dba-puppet-302
%define dba_puppet_path   /DBA/puppet/3.0.2
%global sitelib %(/DBA/ruby/1.9.3/bin/ruby -rrbconfig -e 'puts RbConfig::CONFIG["sitelibdir"]')

%if 0%{?suse_version}
%define confdir		ext/suse
%else
%define confdir		ext/redhat
%endif

Name:           dba-%{pkg_name}-%{pkg_vers}
Version:        %{real_vers}
Summary: 	A network tool for managing many disparate systems - web interface
Release: 	1%{?dist}
License: 	Apache 2.0
Group:    	Productivity/Networking/System

URL: 		http://puppetlabs.com/puppet/related-projects/dashboard/
Source0: 	http://downloads.puppetlabs.com/dashboard/%{pkg_name}-%{real_vers}.tar.gz
#Patch:		DBA.patch
BuildRoot: 	%{_tmppath}/%{pkg_name}-%{real_vers}-build
Prefix:		%{prefix}

Requires:       ruby(abi) >= 1.9
Requires: 	%{dba_ruby_pkg}
Requires: 	%{dba_puppet_pkg}
Requires:	dba-ruby-rubygems-193-json_pure-1.7.6 
Requires:	dba-ruby-rubygems-193-hiera-1.1.2
AutoReq: off

BuildRequires: 	%{dba_ruby_pkg}
BuildRequires: 	%{dba_puppet_pkg}
BuildRequires:	dba-ruby-rubygems-193-json_pure-1.7.6
BuildRequires:	dba-ruby-rubygems-193-hiera-1.1.2
BuildRequires:  dba-openssl-098r openssl-devel

%if 0%{?suse_version}
BuildRequires:  -post-build-checks
BuildRequires:	fastjar
%else
%endif


%description
The Puppet Dashboard is a web interface and reporting tool for your Puppet installation. D
ashboard facilitates management and configuration tasks, provides a quick visual snapshot of important system information, and delivers valuable reports. 
In the future, it will also serve to integrate with other IT tools commonly used alongside Puppet.

%prep
%setup -q -n %{pkg_name}-%{real_vers}

#%patch -p1

%build
for f in bin/*; do
 sed -i -e '1s,^#!.*ruby$,#!%{dba_ruby_path}/bin/ruby,' $f
done

%install

mkdir -p %{buildroot}%{dba_puppet_path}/opt
cp -r %{_builddir}/* %{buildroot}%{dba_puppet_path}/opt

%files
%defattr(-, root, root, 0755)
%{dba_puppet_path}/opt


%clean
%{__rm} -rf %{buildroot}

%changelog