]> git.pld-linux.org Git - packages/ruby-yajl.git/commitdiff
build binary ext with setup.rb
authorElan Ruusamäe <glen@delfi.ee>
Wed, 3 Apr 2013 22:39:52 +0000 (01:39 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Wed, 3 Apr 2013 22:40:06 +0000 (01:40 +0300)
ruby-yajl.spec

index fa68a7042306b2ba08b1a944b07ba7f8913ee904..3b4a6381531c8da262e4ac452beda5bbdf4f1d60 100644 (file)
@@ -2,18 +2,19 @@
 Summary:       Ruby C bindings to the excellent Yajl JSON stream-based parser library
 Name:          ruby-yajl
 Version:       1.1.0
-Release:       0.1
+Release:       0.2
 License:       MIT
 Group:         Development/Languages
 URL:           http://rdoc.info/github/brianmario/yajl-ruby
 Source0:       %{rbname}-%{version}.gem
+# Source0-md5: 5f35141b89be7da3b279b65ea0f3c0c2
 BuildRequires: rpm-rubyprov
 BuildRequires: rpmbuild(macros) >= 1.656
+BuildRequires: setup.rb
 Requires:      ruby-activesupport
 Requires:      ruby-json
 Requires:      ruby-rake-compiler >= 0.7.5
 Requires:      ruby-rspec >= 2.0.0
-BuildArch:     noarch
 BuildRoot:     %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -22,10 +23,27 @@ C binding to the excellent YAJL JSON parsing and generation library.
 %prep
 %setup -q
 
+# ext build
+cp -p %{_datadir}/setup.rb .
+
 %build
+ruby setup.rb config \
+       --prefix=%{_prefix} \
+       --siterubyver=%{ruby_vendorlibdir} \
+       --siterubyverarch=%{ruby_vendorarchdir} \
+
+cd ext/yajl
+# binary pkgs:
+%{__ruby} extconf.rb
+%{__make} \
+       CC="%{__cc}" \
+       LDFLAGS="%{rpmldflags}" \
+       CFLAGS="%{rpmcflags} -fPIC"
 
 %install
 rm -rf $RPM_BUILD_ROOT
+%{__ruby} setup.rb install \
+       --prefix=$RPM_BUILD_ROOT
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -33,3 +51,6 @@ rm -rf $RPM_BUILD_ROOT
 %files
 %defattr(644,root,root,755)
 %doc CHANGELOG.md README.md MIT-LICENSE
+%attr(755,root,root) %{ruby_vendorarchdir}/yajl.so
+%{ruby_vendorlibdir}/yajl.rb
+%{ruby_vendorlibdir}/yajl
This page took 0.08457 seconds and 4 git commands to generate.