#5 .spec file cleanup
Merged 2 months ago by snecker. Opened 2 months ago by vondruch.
rpms/ vondruch/rubygem-asciidoctor-pdf cleanup  into  master

file modified
+12 -21

@@ -1,27 +1,18 @@ 

  %global gem_name asciidoctor-pdf

  %global mainver 1.5.0

- %global prever .alpha.16

+ %global prerelease .alpha.16

  %global release 9

- %{?prever:

- %global gem_instdir %{gem_dir}/gems/%{gem_name}-%{mainver}%{?prever}

- %global gem_docdir %{gem_dir}/doc/%{gem_name}-%{mainver}%{?prever}

- %global gem_cache %{gem_dir}/cache/%{gem_name}-%{mainver}%{?prever}.gem

- %global gem_spec %{gem_dir}/specifications/%{gem_name}-%{mainver}%{?prever}.gemspec

- }

  

  Name: rubygem-%{gem_name}

  Version: %{mainver}

- Release: %{?prever:0.}%{release}%{?prever}%{?dist}

+ Release: %{?prerelease:0.}%{release}%{?prerelease}%{?dist}

  Summary: Converts AsciiDoc documents to PDF using Prawn

  License: MIT

  URL: https://github.com/asciidoctor/asciidoctor-pdf

- Source0: http://rubygems.org/gems/%{gem_name}-%{version}%{?prever}.gem

- Provides: %{gem_name} = %{version}-%{release}

+ Source0: http://rubygems.org/gems/%{gem_name}-%{version}%{?prerelease}.gem

  BuildRequires: ruby(release)

  BuildRequires: rubygems-devel > 1.3.1

  BuildRequires: ruby >= 1.9

- Requires: ruby(release)

- Requires: ruby(rubygems)

  

  BuildArch: noarch

  

@@ -38,17 +29,17 @@ 

  Documentation for %{name}.

  

  %prep

- %setup -q -n %{gem_name}-%{version}%{?prever}

- %gemspec_remove_dep -s ../%{gem_name}-%{version}%{?prever}.gemspec -g treetop "= 1.5.3"

- %gemspec_remove_dep -s ../%{gem_name}-%{version}%{?prever}.gemspec -g prawn-icon "= 1.3.0"

- %gemspec_remove_dep -s ../%{gem_name}-%{version}%{?prever}.gemspec -g prawn-svg ">= 0.21.0", "< 0.28.0"

- %gemspec_add_dep -s ../%{gem_name}-%{version}%{?prever}.gemspec -g treetop "< 2.0.0"

- %gemspec_add_dep -s ../%{gem_name}-%{version}%{?prever}.gemspec -g prawn-svg "~> 0.28.0"

- %gemspec_add_dep -s ../%{gem_name}-%{version}%{?prever}.gemspec -g prawn-icon "~> 2.3.0"

+ %setup -q -n %{gem_name}-%{version}%{?prerelease}

+ %gemspec_remove_dep -g treetop "= 1.5.3"

+ %gemspec_remove_dep -g prawn-icon "= 1.3.0"

+ %gemspec_remove_dep -g prawn-svg ">= 0.21.0", "< 0.28.0"

+ %gemspec_add_dep -g treetop "< 2.0.0"

+ %gemspec_add_dep -g prawn-svg "~> 0.28.0"

+ %gemspec_add_dep -g prawn-icon "~> 2.3.0"

  

  %build

- gem build ../%{gem_name}-%{version}%{?prever}.gemspec

- %gem_install -n%{gem_name}-%{version}%{?prever}.gem

+ gem build ../%{gem_name}-%{version}%{?prerelease}.gemspec

+ %gem_install

  

  %install

  mkdir -p %{buildroot}%{gem_dir}

It removes several unneeded Provides/Requires as well as it uses %{prerelease} macro supported by rubygems-devel macros. Please not that the support in %gemspec_ macros is available only in Rawhide ATM: https://src.fedoraproject.org/rpms/ruby/c/13a1b3e907bdf6fd5a0b3d61f40f0f8bc21008d6?branch=master

Pull-Request has been merged by snecker

2 months ago