summaryrefslogtreecommitdiffstats
path: root/rubygem-rinku.spec
blob: 5d407c30b246326d745038ee2ad377efeafcc72c (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
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
%global gem_name rinku

Name: rubygem-%{gem_name}
Version: 1.7.3
Release: 4%{?dist}
Summary: Autolinking for Ruby
Group: Development/Languages
License: ISC
URL: https://github.com/vmg/rinku
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
# Minitest 5 compat
# https://github.com/vmg/rinku/pull/48
Patch0: rinku-1.7.3-minitest.patch
%if 0%{?el7}
Requires: ruby
Requires: ruby(rubygems)
%endif
BuildRequires: rubygems-devel
BuildRequires: ruby-devel
BuildRequires: rubygem(minitest)
%if 0%{?el7}
Provides: rubygem(%{gem_name}) = %{version}
%endif

%description
A fast and very smart autolinking library that acts as a drop-in replacement
for Rails `auto_link`.


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

%description doc
Documentation for %{name}.

%prep
gem unpack %{SOURCE0}

%autosetup -p 1 -D -T -n  %{gem_name}-%{version}

gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec

# Remove unnecessary Rakefile
rm Rakefile
sed -i "s|\"Rakefile\",||g" %{gem_name}.gemspec

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

%gem_install

# Remove unnecessary gemspec file
rm .%{gem_instdir}/%{gem_name}.gemspec

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

# Remove deprecated "ext" directory
rm -r %{buildroot}%{gem_instdir}/ext

# Move the binary extension
mkdir -p %{buildroot}%{gem_extdir_mri}
cp -pa .%{gem_extdir_mri}/* %{buildroot}%{gem_extdir_mri}/

%check
pushd .%{gem_instdir}
  ruby -I"lib:%{buildroot}%{gem_extdir_mri}" test/autolink_test.rb
popd

%files
%dir %{gem_instdir}
%license %{gem_instdir}/COPYING
%doc %{gem_instdir}/README.markdown
%{gem_libdir}
%{gem_extdir_mri}
%exclude %{gem_cache}
%{gem_spec}

%files doc
%doc %{gem_docdir}
%exclude %{gem_instdir}/test

%changelog
* Fri Jan 08 2016 Ken Dreyer <ktdreyer@ktdreyer.com> - 1.7.3-4
- Drop macros for Fedora 20 (now EOL)
- Switch to %%autosetup macro
- Drop unneeded %%license definition

* Sat Mar 28 2015 Ken Dreyer <ktdreyer@ktdreyer.com> - 1.7.3-3
- Drop Fedora 19 conditionals
- Remove extraneous BR: ruby. This is covered by BR: ruby-devel.
- Patch for Minitest 5
- Use %%license macro

* Thu Jul 10 2014 Ken Dreyer <ktdreyer@ktdreyer.com> - 1.7.3-2
- Adjustments for https://fedoraproject.org/wiki/Changes/Ruby_2.1

* Wed Feb 05 2014 Ken Dreyer <ktdreyer@ktdreyer.com> - 1.7.3-1
- Initial package