From: Elan Ruusamäe Date: Wed, 25 Sep 2013 17:31:06 +0000 (+0300) Subject: package docs, add tests X-Git-Tag: auto/th/ruby-safe_yaml-0.9.4-1~1 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=362aae0b66108e800cb23d7e67d379794d39ce70;p=packages%2Fruby-safe_yaml.git package docs, add tests --- diff --git a/ruby-safe_yaml.spec b/ruby-safe_yaml.spec index e8c8561..cc72389 100644 --- a/ruby-safe_yaml.spec +++ b/ruby-safe_yaml.spec @@ -1,3 +1,7 @@ +# +# Conditional build: +%bcond_with tests # build without tests + %define pkgname safe_yaml Summary: Parse YAML safely Name: ruby-%{pkgname} @@ -10,6 +14,13 @@ Source0: http://rubygems.org/downloads/%{pkgname}-%{version}.gem URL: http://dtao.github.com/safe_yaml/ BuildRequires: rpm-rubyprov BuildRequires: rpmbuild(macros) >= 1.656 +%if %{with tests} +BuildRequires: ruby-hashie +BuildRequires: ruby-heredoc_unindent +BuildRequires: ruby-ostruct +BuildRequires: ruby-rspec +BuildRequires: ruby-yaml +%endif BuildArch: noarch BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) @@ -20,6 +31,11 @@ vulnerability %prep %setup -q -n %{pkgname}-%{version} +%build +%if %{with tests} +rspec -Ilib spec +%endif + %install rm -rf $RPM_BUILD_ROOT install -d $RPM_BUILD_ROOT%{ruby_vendorlibdir} @@ -30,5 +46,6 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(644,root,root,755) +%doc README.md CHANGES.md LICENSE.txt %{ruby_vendorlibdir}/safe_yaml.rb %{ruby_vendorlibdir}/safe_yaml