blob: 11092161b8b4b1a6329f071ac2206c93fa045852 (
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
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
|
%global gem_name svn2git
Name: %{gem_name}
Version: 2.3.2
Release: 2%{?dist}
Summary: A tool for migrating SVN projects to Git
Group: Development/Languages
License: MIT
URL: https://github.com/nirvdrum/svn2git
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
Requires: git-svn
%if 0%{?fc20} || 0%{?el7}
Requires: ruby(release)
Requires: ruby(rubygems)
Requires: rubygem(open4)
%endif
BuildRequires: ruby(release)
BuildRequires: rubygems-devel
BuildRequires: rubygem(minitest)
BuildRequires: rubygem(open4)
BuildArch: noarch
%if 0%{?fc20} || 0%{?el7}
Provides: rubygem(%{gem_name}) = %{version}
%endif
# The ruby(release) package already provides a usable Ruby interpreter.
# Filter the extra /usr/bin/ruby requirement here.
%global __requires_exclude ^/usr/bin/ruby$
%description
A tool for migrating SVN projects to Git.
%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}
%prep
gem unpack %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
# Remove /usr/bin/env from shebang so RPM doesn't consider this a dependency
sed -i 's|#!/usr/bin/env ruby|#!/usr/bin/ruby|' bin/svn2git
# Remove unnecessary developer-only files
rm Rakefile
rm VERSION.yml
sed -i 's|"VERSION.yml",||' %{gem_name}.gemspec
sed -i 's|"Rakefile",||' %{gem_name}.gemspec
%build
gem build %{gem_name}.gemspec
%gem_install
# Remove unecessary gemspec
pushd .%{gem_instdir}
rm %{gem_name}.gemspec
popd
%install
mkdir -p %{buildroot}%{gem_dir}
cp -pa .%{gem_dir}/* \
%{buildroot}%{gem_dir}/
mkdir -p %{buildroot}%{_bindir}
cp -pa .%{_bindir}/* \
%{buildroot}%{_bindir}/
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
%check
pushd .%{gem_instdir}
ruby -e 'Dir.glob "./test/*_test.rb", &method(:require)'
popd
%files
%{!?_licensedir:%global license %%doc}
%dir %{gem_instdir}
%license %{gem_instdir}/MIT-LICENSE
%doc %{gem_instdir}/README.markdown
%{_bindir}/svn2git
%{gem_instdir}/bin
%{gem_libdir}
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/ChangeLog.markdown
%exclude %{gem_instdir}/test
%changelog
* Tue Mar 24 2015 Ken Dreyer <ktdreyer@ktdreyer.com> - 2.3.2-2
- Drop Fedora 19 conditionals
- Use %%license macro
* Fri Jan 02 2015 Ken Dreyer <ktdreyer@ktdreyer.com> - 2.3.2-1
- Update to latest upstream version
- Rename to svn2git (RHBZ #1015253)
- Add requirement on git-svn
- Add Requires: for popen4 for dists older than Fedora 21
* Wed May 21 2014 Ken Dreyer <ktdreyer@ktdreyer.com> - 2.3.1-1
- Update to latest upstream version
- Drop Minitest 5 patch (merged upstream)
- Adjustments for https://fedoraproject.org/wiki/Changes/Ruby_2.1
* Tue Apr 08 2014 Ken Dreyer <ktdreyer@ktdreyer.com> - 2.2.5-1
- Update to latest upstream version
- Patch for Minitest 5 support
* Sat Nov 23 2013 Ken Dreyer <ktdreyer@ktdreyer.com> - 2.2.2-2
- Remove Rakefile during %%prep
- Move README to main binary package
- Remove gem2rpm comment
* Tue Sep 24 2013 Ken Dreyer <ktdreyer@ktdreyer.com> - 2.2.2-1
- Initial package
|