[packages/ruby-i18n] package gemspec, add doc bcond
glen
glen at pld-linux.org
Sun Jul 27 11:26:27 CEST 2014
commit 416d6480dd2f7cbfea642a09609fa7d50e4071ee
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sun Jul 27 12:26:25 2014 +0300
package gemspec, add doc bcond
ruby-i18n.spec | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/ruby-i18n.spec b/ruby-i18n.spec
index bea09a2..b26d0ab 100644
--- a/ruby-i18n.spec
+++ b/ruby-i18n.spec
@@ -1,8 +1,12 @@
+#
+# Conditional build:
+%bcond_without doc # don't build ri/rdoc
+
%define pkgname i18n
Summary: Add Internationalization support to your Ruby application
Name: ruby-%{pkgname}
Version: 0.6.0
-Release: 3
+Release: 4
License: MIT/Ruby License
Group: Development/Languages
Source0: http://rubygems.org/downloads/%{pkgname}-%{version}.gem
@@ -47,6 +51,10 @@ Dokumentacji w formacie ri dla %{pkgname}.
%setup -q -n %{pkgname}-%{version}
%build
+# write .gemspec
+%__gem_helper spec
+
+%if %{with doc}
# UTF8 locale needed for doc generation
export LC_ALL=en_US.UTF-8
rdoc --ri --op ri lib
@@ -54,16 +62,20 @@ rdoc --op rdoc lib
rm -r ri/{Hash,KeyError,String,Kernel,GetText}
rm ri/created.rid
rm ri/cache.ri
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_ridir},%{ruby_rdocdir}}
+install -d $RPM_BUILD_ROOT{%{ruby_vendorlibdir},%{ruby_specdir},%{ruby_ridir},%{ruby_rdocdir}}
cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
+cp -p %{pkgname}-%{version}.gemspec $RPM_BUILD_ROOT%{ruby_specdir}
+%{__rm} -r $RPM_BUILD_ROOT%{ruby_vendorlibdir}/i18n/tests
+
+%if %{with doc}
cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
cp -a rdoc $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version}
-
-%{__rm} -r $RPM_BUILD_ROOT%{ruby_vendorlibdir}/i18n/tests
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
@@ -73,7 +85,9 @@ rm -rf $RPM_BUILD_ROOT
%doc CHANGELOG.textile README.textile
%{ruby_vendorlibdir}/i18n.rb
%{ruby_vendorlibdir}/i18n
+%{ruby_specdir}/%{pkgname}-%{version}.gemspec
+%if %{with doc}
%files rdoc
%defattr(644,root,root,755)
%{ruby_rdocdir}/%{name}-%{version}
@@ -81,3 +95,4 @@ rm -rf $RPM_BUILD_ROOT
%files ri
%defattr(644,root,root,755)
%{ruby_ridir}/I18n
+%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/ruby-i18n.git/commitdiff/416d6480dd2f7cbfea642a09609fa7d50e4071ee
More information about the pld-cvs-commit
mailing list