-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathrbeapi.spec.tmpl
135 lines (108 loc) · 3.97 KB
/
rbeapi.spec.tmpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
# -*- rpm-spec -*-
%global gem_name rbeapi
Name: %{?enterprise:pe-}rubygem-%{gem_name}
Version: REPLACEME
Release: 1.eos4
Summary: Arista eAPI Ruby Library for the EOS command API
Group: Development/Languages
License: New BSD
URL: https://github.com/arista-eosplus/rbeapi
Source0: %{gem_name}-%{version}.gem
BuildArch: noarch
%description
The Ruby Client for eAPI provides a native Ruby implementation for programming
Arista EOS network devices using Ruby. The Ruby client provides the ability
to build native applications in Ruby that can communicate with EOS either
locally via Unix domain sockets (on-box) or remotely over a HTTP/S transport
(off-box). It uses a standard INI-style configuration file to specify one or
more connection profiles.
The rbeapi implementation also provides an API layer for building native Ruby
objects that allow for configuration and state extraction of EOS nodes. The API
layer provides a consistent implementation for working with EOS configuration
resources. The implementation of the API layer is highly extensible and can be
used as a foundation for building custom data models.
The library is freely provided to the open source community for building robust
applications using Arista EOS eAPI. Support is provided as best effort through
Github iusses.
%package chef
Summary: Arista eAPI Ruby Library for Chef clients
Group: Development/Languages
Requires: chef
Requires: chef-rubygem(net_http_unix)
Requires: chef-rubygem(inifile)
Requires: chef-rubygem(netaddr)
Provides: chef-rubygem(%{gem_name}) = %{version}
Provides: chef-rubygem-%{gem_name} = %{version}
%description chef
The Ruby eAPI Client for Chef clients
%package puppet3
Summary: Arista eAPI Ruby Library Puppet Enterprise 3.x agents
Group: Development/Languages
# Use these settings for Puppet Enterprise
Requires: pe-rubygems
Requires: pe-ruby
Requires: pe-rubygem(net-http-unix)
Requires: pe-rubygem(inifile)
Requires: pe-rubygem(netaddr)
Provides: pe-rubygem(%{gem_name}) = %{version}
Provides: pe-rubygem-%{gem_name} = %{version}
%description puppet3
The Ruby eAPI Client for Puppet Enterprise 3.x agents
%package puppet-aio
Summary: Arista eAPI Ruby Library for Puppet All-In-One (4.x) agents
Group: Development/Languages
Requires: puppet >= 4.0.0
Requires: rubygem-net_http_unix
Requires: rubygem-inifile
Requires: rubygem-netaddr
Provides: rubygem-%{gem_name} = %{version}
%description puppet-aio
The Ruby eAPI Client for Puppet All-In-One (4.x) agents
%prep
%setup -q -D -T -n .
%install
mkdir -p %{buildroot}
install %{SOURCE0} %{buildroot}/
%files
/%{gem_name}-%{version}.gem
%files chef
/%{gem_name}-%{version}.gem
%files puppet3
/%{gem_name}-%{version}.gem
%files puppet-aio
/%{gem_name}-%{version}.gem
%post
GEM_OPTS="--no-rdoc --no-ri --local"
gem install ${GEM_OPTS} /%{gem_name}-%{version}.gem > /dev/null 2>&1
%preun
gem uninstall %{gem_name} --version '= %{version}' > /dev/null 2>&1
%post chef
GEM=/opt/chef/embedded/bin/gem
GEM_OPTS="--no-document --local"
${GEM} install ${GEM_OPTS} /%{gem_name}-%{version}.gem > /dev/null 2>&1
%preun chef
GEM=/opt/chef/embedded/bin/gem
${GEM} uninstall %{gem_name} --version '= %{version}' > /dev/null 2>&1
%post puppet3
GEM=/opt/puppet/bin/gem
GEM_OPTS="--no-rdoc --no-ri --local"
${GEM} install ${GEM_OPTS} /%{gem_name}-%{version}.gem > /dev/null 2>&1
%preun puppet3
GEM=/opt/puppet/bin/gem
${GEM} uninstall %{gem_name} --version '= %{version}' > /dev/null 2>&1
%post puppet-aio
GEM=/opt/puppetlabs/puppet/bin/gem
GEM_OPTS="--no-rdoc --no-ri --local"
${GEM} install ${GEM_OPTS} /%{gem_name}-%{version}.gem > /dev/null 2>&1
%preun puppet-aio
GEM=/opt/puppetlabs/puppet/bin/gem
${GEM} uninstall %{gem_name} --version '= %{version}' > /dev/null 2>&1
%changelog
* Tue May 24 2016 Jere Julian - 0.6.0-1
- Add Chef sub-package
* Fri Oct 30 2015 Jere Julian - 0.4.0-1
- Detect the location of the puppet-agent's gem install
* Thu May 21 2015 Jere Julian - 0.1.0-2
- Ubuntu requires we manually create the buildroot
* Tue Mar 17 2015 Jere Julian - 0.1.0-1
- Initial package