e761e4da0b6e201d61fe4bc89806cf6e7a4492ed
[packages/gem2rpm.git] / gem2rpm.spec
1 #
2 # Conditional build:
3 %bcond_with     tests           # tests require networking
4
5 Summary:        Generate rpm specfiles from gems
6 Name:           gem2rpm
7 Version:        0.11.2
8 Release:        1
9 License:        GPL v2+
10 Group:          Development/Languages
11 Source0:        https://github.com/fedora-ruby/gem2rpm/archive/v%{version}/%{name}-%{version}.tar.gz
12 # Source0-md5:  80d6170dcfe7d0a840e8bf7149096d3a
13 Source2:        pld.spec.erb
14 Patch0:         gems.patch
15 Patch1:         os-release-quotes.patch
16 Patch2:         style.patch
17 URL:            https://github.com/fedora-ruby/gem2rpm
18 BuildRequires:  rpm-rubyprov
19 BuildRequires:  rpmbuild(macros) >= 1.656
20 %if %{with tests}
21 %if %(locale -a | grep -q '^en_US$'; echo $?)
22 BuildRequires:  glibc-localedb-all
23 %endif
24 %endif
25 Requires:       pld-release
26 Requires:       ruby-rubygems
27 BuildArch:      noarch
28 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
29
30 %description
31 Generate source rpms and rpm spec files from a Ruby Gem. The spec file
32 tries to follow the gem as closely as possible, and be compliant with
33 the Fedora rubygem packaging guidelines
34
35 %package doc
36 Summary:        Documentation for %{name}
37 Group:          Documentation
38 Requires:       %{name} = %{version}-%{release}
39
40 %description doc
41 Documentation for %{name}.
42
43 %prep
44 %setup -q
45 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
46 %patch0 -p1
47 %patch1 -p1
48 %patch2 -p1
49 cp -p %{SOURCE2} templates
50
51 # cleanup backups after patching
52 find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f
53
54 %build
55 %if %{with tests}
56 # tests need UTF-8 locale
57 LC_ALL=en_US.UTF-8 \
58 testrb -Itest test/
59 %endif
60
61 %install
62 rm -rf $RPM_BUILD_ROOT
63 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{_bindir}}
64
65 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
66 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
67
68 install -d $RPM_BUILD_ROOT%{_datadir}/ruby/templates
69 cp -a templates/* $RPM_BUILD_ROOT%{_datadir}/ruby/templates
70
71 %clean
72 rm -rf $RPM_BUILD_ROOT
73
74 %files
75 %defattr(644,root,root,755)
76 %doc README.md AUTHORS
77 %attr(755,root,root) %{_bindir}/gem2rpm
78 %{ruby_vendorlibdir}/gem2rpm.rb
79 %{ruby_vendorlibdir}/gem2rpm
80 %{_datadir}/ruby/templates
This page took 0.095532 seconds and 2 git commands to generate.