summaryrefslogtreecommitdiffstats
path: root/svn2git.spec
diff options
context:
space:
mode:
Diffstat (limited to 'svn2git.spec')
-rw-r--r--svn2git.spec122
1 files changed, 122 insertions, 0 deletions
diff --git a/svn2git.spec b/svn2git.spec
new file mode 100644
index 0000000..ad3e07c
--- /dev/null
+++ b/svn2git.spec
@@ -0,0 +1,122 @@
+%global gem_name svn2git
+
+Name: %{gem_name}
+Version: 2.3.2
+Release: 1%{?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%{?fc19} || 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%{?fc19} || 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
+%dir %{gem_instdir}
+%doc %{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
+* 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