summaryrefslogtreecommitdiffstats
path: root/SPECS/opt-ruby-rubygem-file-tail.spec
blob: feab45f3a878646969517c7236f84350329781bc (plain)
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
%define gemname file-tail
%define rubyver         1.9.3
%define ruby_dir /opt/ruby-%{rubyver}
%define ruby_sitelib %(%{ruby_dir}/bin/ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
%define gemdir %(%{ruby_dir}/bin/ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
%define geminstdir %{gemdir}/gems/%{gemname}-%{version}

Summary: File::Tail for Ruby
Name: opt-ruby-%{rubyver}-rubygem-%{gemname}
Version: 1.0.8
Release: 1%{?dist}
Group: Development/Languages
License: GPLv2+ or Ruby
URL: http://flori.github.com/file-tail
Source0: http://rubygems.org/gems/%{gemname}-%{version}.gem
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Requires: opt-ruby-%{rubyver}
Requires: opt-ruby-%{rubyver}-rubygem(spruz) >= 0.2.13
BuildRequires: opt-ruby-%{rubyver}
BuildArch: noarch
Provides: opt-ruby-%{rubyver}-rubygem(%{gemname}) = %{version}

%description
Library to tail files in Ruby


%prep

%build

%install
rm -rf %{buildroot}
mkdir -p %{buildroot}%{gemdir}
%{ruby_dir}/bin/gem install --local --install-dir %{buildroot}%{gemdir} \
            --force --rdoc %{SOURCE0}
mkdir -p %{buildroot}/%{ruby_dir}/bin
mv %{buildroot}%{geminstdir}/bin/* %{buildroot}/%{ruby_dir}/bin
find %{buildroot}/%{ruby_dir}/bin -type f | xargs -n 1 sed -i  -e 's"^#!/usr/bin/env ruby"#!%{ruby_dir}/bin/ruby"'
rmdir %{buildroot}%{geminstdir}/bin

%clean
rm -rf %{buildroot}

%files
%defattr(-, root, root, -)
%{ruby_dir}/bin/rtail
%{gemdir}/gems/%{gemname}-%{version}/
%doc %{gemdir}/doc/%{gemname}-%{version}
%doc %{geminstdir}/README.rdoc
%{gemdir}/cache/%{gemname}-%{version}.gem
%{gemdir}/specifications/%{gemname}-%{version}.gemspec


%changelog
* Tue Oct 19 2010 Erik Ogan <erik@stealthymonkeys.com> - 1.0.5-1
- Initial package