]> git.pld-linux.org Git - packages/ruby-ffi-yajl.git/blob - ruby-ffi-yajl.spec
- x32 rebuild
[packages/ruby-ffi-yajl.git] / ruby-ffi-yajl.spec
1 # TODO
2 # - separate subpackages for C extension and FFI extension?
3 # - package bench as subpackage?
4 #
5 # Conditional build:
6 %bcond_with     tests           # build without tests
7
8 %define pkgname ffi-yajl
9 Summary:        Ruby FFI wrapper around YAJL 2.x
10 Name:           ruby-%{pkgname}
11 Version:        1.3.1
12 Release:        2
13 License:        Apache v2.0
14 Group:          Development/Languages
15 Source0:        http://rubygems.org/downloads/%{pkgname}-%{version}.gem
16 # Source0-md5:  ac12c13508dc6df56724a14670d6684a
17 Patch0:         system-yajl.patch
18 URL:            http://github.com/opscode/ffi-yajl
19 BuildRequires:  rpm-rubyprov
20 BuildRequires:  rpmbuild(macros) >= 1.656
21 BuildRequires:  ruby-devel
22 BuildRequires:  ruby-rubygems
23 BuildRequires:  sed >= 4.0
24 BuildRequires:  yajl-devel >= 2.0
25 %if %{with tests}
26 BuildRequires:  ruby-mime-types < 2
27 BuildRequires:  ruby-mime-types >= 1.16
28 BuildRequires:  ruby-pry < 1
29 BuildRequires:  ruby-pry >= 0.9
30 BuildRequires:  ruby-rake < 11
31 BuildRequires:  ruby-rake >= 10.1
32 BuildRequires:  ruby-rake-compiler < 0.9
33 BuildRequires:  ruby-rake-compiler >= 0.8.3
34 BuildRequires:  ruby-rspec < 3
35 BuildRequires:  ruby-rspec >= 2.99
36 %endif
37 Requires:       ruby-ffi < 2
38 Requires:       ruby-ffi >= 1.5
39 # libyajl.so.2 opened by FFI
40 Requires:       yajl >= 2.0
41 BuildRoot:      %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
42
43 %description
44 Ruby FFI wrapper around YAJL 2.x
45
46 %prep
47 %setup -q -n %{pkgname}-%{version}
48 %patch0 -p1
49 %{__sed} -i -e '1 s,#!.*ruby,#!%{__ruby},' bin/*
50
51 %build
52 # write .gemspec
53 %__gem_helper spec
54
55 # provided by rpm deps
56 %{__sed} -i -e '/libyajl2/d' %{pkgname}-%{version}.gemspec
57
58 cd ext/ffi_yajl/ext/encoder
59 %{__ruby} extconf.rb
60 %{__make} V=1 \
61         CC="%{__cc}" \
62         LDFLAGS="%{rpmldflags}" \
63         CFLAGS="%{rpmcflags} -fPIC"
64
65 cd ../parser
66 %{__ruby} extconf.rb
67 %{__make} V=1 \
68         CC="%{__cc}" \
69         LDFLAGS="%{rpmldflags}" \
70         CFLAGS="%{rpmcflags} -fPIC"
71
72 %install
73 rm -rf $RPM_BUILD_ROOT
74 install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{_bindir}}
75 cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
76 cp -a bin/* $RPM_BUILD_ROOT%{_bindir}
77 cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
78
79 install -d $RPM_BUILD_ROOT%{ruby_vendorarchdir}/ffi_yajl/ext/{encoder,parser}
80 install -p ext/ffi_yajl/ext/parser/parser.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}/ffi_yajl/ext
81 install -p ext/ffi_yajl/ext/encoder/encoder.so $RPM_BUILD_ROOT%{ruby_vendorarchdir}/ffi_yajl/ext
82
83 %{__rm} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/ffi_yajl/benchmark.rb
84 %{__rm} -r $RPM_BUILD_ROOT%{ruby_vendorlibdir}/ffi_yajl/benchmark
85 %{__rm} $RPM_BUILD_ROOT%{_bindir}/ffi-yajl-bench
86 %{__rm} $RPM_BUILD_ROOT%{ruby_vendorlibdir}/ffi_yajl/ext/.keep
87
88 %clean
89 rm -rf $RPM_BUILD_ROOT
90
91 %files
92 %defattr(644,root,root,755)
93 %{ruby_vendorlibdir}/ffi_yajl.rb
94 %dir %{ruby_vendorlibdir}/ffi_yajl
95 %{ruby_vendorlibdir}/ffi_yajl/encoder.rb
96 %{ruby_vendorlibdir}/ffi_yajl/ext.rb
97 %{ruby_vendorlibdir}/ffi_yajl/ffi.rb
98 %{ruby_vendorlibdir}/ffi_yajl/json_gem.rb
99 %{ruby_vendorlibdir}/ffi_yajl/parser.rb
100 %{ruby_vendorlibdir}/ffi_yajl/version.rb
101 %dir %{ruby_vendorlibdir}/ffi_yajl/ffi
102 %{ruby_vendorlibdir}/ffi_yajl/ffi/encoder.rb
103 %{ruby_vendorlibdir}/ffi_yajl/ffi/parser.rb
104 %{ruby_specdir}/%{pkgname}-%{version}.gemspec
105
106 # ext
107 %dir %{ruby_vendorarchdir}/ffi_yajl
108 %dir %{ruby_vendorarchdir}/ffi_yajl/ext
109 %dir %{ruby_vendorarchdir}/ffi_yajl/ext/encoder
110 %dir %{ruby_vendorarchdir}/ffi_yajl/ext/parser
111 %attr(755,root,root) %{ruby_vendorarchdir}/ffi_yajl/ext/parser.so
112 %attr(755,root,root) %{ruby_vendorarchdir}/ffi_yajl/ext/encoder.so
This page took 0.056765 seconds and 4 git commands to generate.