]> git.pld-linux.org Git - packages/ruby-rugged.git/blob - ruby-rugged.spec
e1b7b7ef821596668fe075d5b5e8df6aefd56212
[packages/ruby-rugged.git] / ruby-rugged.spec
1 #
2 # Conditional build:
3 %bcond_with     tests           # build without tests
4
5 %define pkgname rugged
6 Summary:        Rugged is a Ruby binding to the libgit2 library
7 Name:           ruby-%{pkgname}
8 Version:        0.24.0
9 Release:        1
10 License:        MIT
11 Group:          Development/Languages
12 Source0:        https://rubygems.org/gems/%{pkgname}-%{version}.gem
13 # Source0-md5:  9f86c5a2801b6727aa88a302dc018a2f
14 URL:            https://github.com/libgit2/rugged
15 BuildRequires:  cmake
16 BuildRequires:  git-core
17 BuildRequires:  gmp-devel
18 BuildRequires:  libgit2-devel
19 BuildRequires:  rpm-rubyprov
20 BuildRequires:  ruby-devel
21 BuildRequires:  ruby-minitest
22 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
23
24 %description
25 Rugged is a Ruby bindings to the libgit2 C Git library. This is for
26 testing and using the libgit2 library in a language that is awesome.
27
28 %package doc
29 Summary:        Documentation for %{name}
30 Group:          Documentation
31 Requires:       %{name} = %{version}-%{release}
32 %if "%{_rpmversion}" >= "5"
33 BuildArch:      noarch
34 %endif
35
36 %description doc
37 Documentation for %{name}
38
39 %prep
40 %setup -q -n %{pkgname}-%{version}
41
42 rm -r vendor
43
44 # The build system requres libgit2's version.h to be present, and defaults to
45 # using the vendor'd copy. Use the system copy instead.
46 sed -i -e 's|LIBGIT2_DIR = .*|LIBGIT2_DIR = "/usr"|' ext/rugged/extconf.rb
47
48 %build
49 # write .gemspec
50 %__gem_helper spec
51
52 export CONFIGURE_ARGS="--with-cflags='%{rpmcflags}' --use-system-libraries"
53 cd ext/%{pkgname}
54 %{__ruby} extconf.rb
55 %{__make} \
56         CC="%{__cc}" \
57         LDFLAGS="%{rpmldflags}" \
58         CFLAGS="%{rpmcflags} -fPIC"
59
60 %if %{with tests}
61 export LANG="en_US.UTF-8"
62 git config --global user.name John Doe
63 # Comment out the test until we get the minitest/autorun figured out
64 #testrb -Ilib test/*test.rb
65 %endif
66
67 %install
68 rm -rf $RPM_BUILD_ROOT
69 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_vendorarchdir}/%{pkgname},%{ruby_specdir}}
70 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
71 install -p ext/%{pkgname}/*.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}/%{pkgname}
72 cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
73
74 %clean
75 rm -rf $RPM_BUILD_ROOT
76
77 %files
78 %defattr(644,root,root,755)
79 %doc README.md LICENSE
80 %{ruby_vendorlibdir}/%{pkgname}.rb
81 %dir %{ruby_vendorlibdir}/%{pkgname}
82 %{ruby_vendorlibdir}/%{pkgname}/*.rb
83 %{ruby_vendorlibdir}/%{pkgname}/diff
84 %dir %{ruby_vendorarchdir}/rugged
85 %attr(755,root,root) %{ruby_vendorarchdir}/rugged/rugged.so
86 %{ruby_specdir}/%{pkgname}-%{version}.gemspec
This page took 0.045992 seconds and 2 git commands to generate.