| 1 |
%global gem_name einhorn |
| 2 |
%if 0%{?rhel} == 6 |
| 3 |
%global gem_dir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) |
| 4 |
%global gem_docdir %{gem_dir}/doc/%{gem_name}-%{version} |
| 5 |
%global gem_cache %{gem_dir}/cache/%{gem_name}-%{version}.gem |
| 6 |
%global gem_spec %{gem_dir}/specifications/%{gem_name}-%{version}.gemspec |
| 7 |
%global gem_instdir %{gem_dir}/gems/%{gem_name}-%{version} |
| 8 |
%endif |
| 9 |
|
| 10 |
Summary: Language-independent shared socket manager |
| 11 |
Name: rubygem-%{gem_name} |
| 12 |
Version: 0.7.5 |
| 13 |
Release: 1%{?dist} |
| 14 |
Group: Development/Languages |
| 15 |
License: MIT |
| 16 |
URL: https://github.com/stripe/einhorn |
| 17 |
Source0: https://github.com/stripe/einhorn/archive/v%{version}.tar.gz |
| 18 |
|
| 19 |
%if 0%{?rhel} == 6 |
| 20 |
Requires: ruby(abi) = 1.8 |
| 21 |
%else |
| 22 |
Requires: ruby(release) |
| 23 |
%endif |
| 24 |
%if 0%{?fedora} |
| 25 |
BuildRequires: rubygems-devel |
| 26 |
%endif |
| 27 |
BuildRequires: rubygems |
| 28 |
BuildArch: noarch |
| 29 |
Provides: rubygem(%{gem_name}) = %{version} |
| 30 |
%description |
| 31 |
Einhorn makes it easy to run (and keep alive) multiple copies of a single long-lived process. If that process is a server listening on some socket, Einhorn will open the socket in the master process so that it's shared among the workers. |
| 32 |
|
| 33 |
%prep |
| 34 |
%setup -n %{gem_name}-%{version} |
| 35 |
tar -tzf %{SOURCE0} |cut -d/ -f2- |grep -v /$ >files |
| 36 |
sed -i -e 's/git ls-files/cat files/' %{gem_name}.gemspec |
| 37 |
|
| 38 |
%build |
| 39 |
gem build %{gem_name}.gemspec |
| 40 |
|
| 41 |
%gem_install |
| 42 |
|
| 43 |
%install |
| 44 |
mkdir -p %{buildroot}%{gem_dir} |
| 45 |
cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/ |
| 46 |
|
| 47 |
mkdir -p %{buildroot}%{_bindir} |
| 48 |
cp -a ./%{_bindir}/* %{buildroot}%{_bindir} |
| 49 |
|
| 50 |
%files |
| 51 |
%{_bindir}/einhorn |
| 52 |
%{_bindir}/einhornsh |
| 53 |
%exclude %{gem_cache} |
| 54 |
%doc %{gem_docdir} |
| 55 |
%{gem_instdir} |
| 56 |
%{gem_spec} |