[packages/ruby-text-format] build noarch; install to vendor dir; add doc bcond
glen
glen at pld-linux.org
Sun Mar 20 13:35:55 CET 2016
commit 0f340f85153a367f04d5bac57eeeb858aa51012f
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Sun Mar 20 14:31:25 2016 +0200
build noarch; install to vendor dir; add doc bcond
ruby-text-format.spec | 43 ++++++++++++++++++++++++++-----------------
1 file changed, 26 insertions(+), 17 deletions(-)
---
diff --git a/ruby-text-format.spec b/ruby-text-format.spec
index b4c297e..fd4c14c 100644
--- a/ruby-text-format.spec
+++ b/ruby-text-format.spec
@@ -1,24 +1,25 @@
+#
+# Conditional build:
+%bcond_without doc # don't build ri/rdoc
+
%define pkgname text-format
Summary: A Ruby port of Text::Format
Summary(pl.UTF-8): Port Text::Format dla języka Ruby
Name: ruby-%{pkgname}
Version: 1.0.0
-Release: 3
+Release: 4
License: GPL
Group: Development/Libraries
Source0: http://rubygems.org/downloads/%{pkgname}-%{version}.gem
# Source0-md5: 7b08f134e605da252c23afedbb481beb
-URL: http://www.halostatue.ca/ruby/Text__Format.html
-BuildRequires: rpmbuild(macros) >= 1.277
-BuildRequires: ruby-modules
-%{?ruby_mod_ver_requires_eq}
-Obsoletes: ruby-Text-Format
+URL: https://rubygems.org/gems/text-format
+BuildRequires: rpm-rubyprov
+BuildRequires: rpmbuild(macros) >= 1.665
Provides: ruby-Text-Format
+Obsoletes: ruby-Text-Format
+BuildArch: noarch
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
-# nothing to be placed there. we're not noarch only because of ruby packaging
-%define _enable_debug_packages 0
-
%description
Text::Format provides strong text formatting capabilities to Ruby.
Based on Perl's Text::Format 0.52, it offers all of the functionality
@@ -54,31 +55,38 @@ ri documentation for %{pkgname}.
Dokumentacji w formacie ri dla %{pkgname}.
%prep
-%setup -q -c
-%{__tar} xf %{SOURCE0} -O data.tar.gz | %{__tar} xz
-find -newer README -o -print | xargs touch --reference %{SOURCE0}
+%setup -q -n %{pkgname}-%{version}
+# tgz
%build
+%if %{with doc}
rdoc --inline-source --op rdoc lib
rdoc --ri --op ri lib
-# rm -rf ri/NOT_THIS_MODULE_RELATED_DIRS
-rm -f ri/created.rid
+rm ri/created.rid
+rm ri/cache.ri
+%endif
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT{%{ruby_rubylibdir},%{ruby_ridir},%{ruby_rdocdir}/%{name}-%{version}}
+install -d $RPM_BUILD_ROOT%{ruby_vendorlibdir}
+cp -a lib/* $RPM_BUILD_ROOT%{ruby_vendorlibdir}
-cp -a lib/* $RPM_BUILD_ROOT%{ruby_rubylibdir}
+%if %{with doc}
+install -d $RPM_BUILD_ROOT{%{ruby_ridir},%{ruby_rdocdir}/%{name}-%{version}}
cp -a ri/* $RPM_BUILD_ROOT%{ruby_ridir}
cp -a rdoc $RPM_BUILD_ROOT%{ruby_rdocdir}/%{name}-%{version}
+%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%{ruby_rubylibdir}/*
+%dir %{ruby_vendorlibdir}/text
+%{ruby_vendorlibdir}/text/format.rb
+%{ruby_vendorlibdir}/text/format
+%if %{with doc}
%files rdoc
%defattr(644,root,root,755)
%{ruby_rdocdir}/%{name}-%{version}
@@ -86,3 +94,4 @@ rm -rf $RPM_BUILD_ROOT
%files ri
%defattr(644,root,root,755)
%{ruby_ridir}/Text
+%endif
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/ruby-text-format.git/commitdiff/0f340f85153a367f04d5bac57eeeb858aa51012f
More information about the pld-cvs-commit
mailing list