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