summaryrefslogtreecommitdiffstats
path: root/rubygem-rugged.spec
blob: dca836c12b980ac7d8a31a5f4b4ab592ba8987fd (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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
%global gem_name rugged

Summary:       Rugged is a Ruby binding to the libgit2 library
Name:          rubygem-%{gem_name}
Version:       0.19.0
Release:       7%{?dist}
Group:         Development/Languages
License:       MIT
URL:           http://github.com/libgit2/rugged
Source0:       http://rubygems.org/gems/%{gem_name}-%{version}.gem
# The test directory for this version is incomplete due to gemspec bug.
# Upstream has removed test and Rakefile from gem in future versions.
# https://github.com/libgit2/rugged/issues/262
# https://github.com/libgit2/rugged/pull/263
# This is how we are getting the tests (Source1)
#  git clone git://github.com/libgit2/rugged.git
#  cd rugged/
#  git checkout v0.19.0
#  tar cfz rugged-0.19.0-test.tgz test/ Rakefile
Source1:       %{gem_name}-%{version}-test.tgz
Requires:      ruby(rubygems)
Requires:      ruby
BuildRequires: ruby
BuildRequires: git
BuildRequires: libgit2-devel
BuildRequires: ruby-devel
BuildRequires: rubygem(minitest)
BuildRequires: rubygems-devel
Provides:      rubygem(%{gem_name}) = %{version}
%{?rubygems_default_filter}

%description
Rugged is a Ruby bindings to the libgit2W C Git library. This is
for testing and using the libgit2 library in a language that is awesome.


%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

rm -rf vendor
# Remove the bundled libraries from gemspec
sed -i -e 's\ "vendor[^,]*,\\g' rugged.gemspec

%build
# Setting for rugged v0.19.0:
export LIBGIT2_PATH="/usr/"
# Note that in upstream's git development branch (so, post 0.19.0), we have to
# specify the path to libgit2 differently:
# export CONFIGURE_ARGS="--with-cflags='%{optflags}' --with-git2-dir='/usr'"
gem build %{gem_name}.gemspec
%gem_install

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


# move C extensions to the extdir.
mkdir -p %{buildroot}%{gem_extdir_mri}/lib/%{gem_name}/
mv %{buildroot}%{gem_instdir}/lib/%{gem_name}/rugged.so %{buildroot}%{gem_extdir_mri}/lib/%{gem_name}/

# Clear up empty files
echo "#file" > %{buildroot}%{gem_instdir}/test/fixtures/attr/dir/file
echo "#file" > %{buildroot}%{gem_instdir}/test/fixtures/attr/sub/dir/file
echo "#dir" > %{buildroot}%{gem_instdir}/test/fixtures/attr/sub/sub/dir

# We don't need those files anymore.
rm -rf %{buildroot}%{gem_instdir}/ext/

%check
pushd .%{gem_instdir}
tar xfz %{SOURCE1}
export LANG="en_US.UTF-8"
git config --global user.name John Doe
testrb -Ilib test/*test.rb
popd

%files
%doc %{gem_instdir}/LICENSE
%doc %{gem_instdir}/README.md
%dir %{gem_instdir}
%{gem_libdir}
%{gem_extdir_mri}
%exclude %{gem_cache}
%{gem_spec}

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

%changelog
* Sun Jun 08 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.19.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild

* Wed Feb 05 2014 Troy Dawson <tdawson@redhat.com> - 0.19.0-6
- Misc packaging fixes (#1061552) Ken Dreyer

* Mon Jan 06 2014 Troy Dawson <tdawson@redhat.com> - 0.19.0-5
- Misc spec file fixes (#1048958) Ken Dreyer
- Change vendor patch to sed command

* Mon Sep 09 2013 Troy Dawson <tdawson@redhat.com> - 0.19.0-4
- Update comments about test source
- Fix zero length files in test

* Fri Sep 06 2013 Troy Dawson <tdawson@redhat.com> - 0.19.0-3
- Added full test directory
- use minitest for tests
- Added .so file provides filter

* Thu Aug 22 2013 Troy Dawson <tdawson@redhat.com> - 0.19.0-2
- remove vendor directory and patch gemspec to reflect that
- export LIBGIT2_PATH before building to use system git2

* Mon Jul 22 2013 Troy Dawson <tdawson@redhat.com> - 0.19.0-1
- Updated to latest release - 0.19.0
- Cleaned up bad tests
- Comment out check, due to bad exit code from successful tests

* Mon Jul 22 2013 Troy Dawson <tdawson@redhat.com> - 0.19.0-1
- Updated to latest release - 0.19.0
- Cleaned up bad tests

* Tue Jul 09 2013 Troy Dawson <tdawson@redhat.com> - 0.16.0-3
- Change build section to use current ruby guidelines
- move lib/rugged/rugged.so instead of ext/rugged/rugged.so
- move rugged.so into the correct directory
- cleanup test, now runs without problems

* Tue Jul 02 2013 Troy Dawson <tdawson@redhat.com> - 0.16.0-2
- Make macro's more consistant
- Remove extra rugged.so
- Set correct permissions for rugged.so
- Run test (thanks to Axilleas Pipinellis for this)
- Add libgit2-devel to buildrequires - this causes the build to
  use system libgit2 instead of bundled version.

* Mon Mar 18 2013 Troy Dawson <tdawson@redhat.com> - 0.16.0-1
- Initial package