|
| 1 | +%global gem_name scanf |
| 2 | + |
| 3 | +Name: rubygem-%{gem_name} |
| 4 | +Version: 1.0.0 |
| 5 | +Release: 1%{?dist} |
| 6 | +Summary: A Ruby implementation of the C function scanf(3) |
| 7 | +# Automatically converted from old format: BSD - review is highly recommended. |
| 8 | +License: LicenseRef-Callaway-BSD |
| 9 | +Vendor: Microsoft Corporation |
| 10 | +Distribution: Azure Linux |
| 11 | +URL: https://github.com/ruby/scanf |
| 12 | +Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem |
| 13 | +# License is not included in the gem, copied from git |
| 14 | +Source1: LICENSE.txt |
| 15 | +# Tests are not included in the gem, copied from git |
| 16 | +Source2: data.txt |
| 17 | +Source3: test_scanf.rb |
| 18 | +Source4: test_scanfblocks.rb |
| 19 | +Source5: test_scanfio.rb |
| 20 | +BuildRequires: ruby(release) |
| 21 | +BuildRequires: rubygems-devel |
| 22 | +BuildRequires: ruby >= 2.3.0 |
| 23 | +# Required for %check |
| 24 | +BuildRequires: rubygem(test-unit) |
| 25 | +BuildArch: noarch |
| 26 | + |
| 27 | +%description |
| 28 | +A Ruby implementation of the C function scanf(3). |
| 29 | + |
| 30 | + |
| 31 | +%package doc |
| 32 | +Summary: Documentation for %{name} |
| 33 | +Requires: %{name} = %{version}-%{release} |
| 34 | +BuildArch: noarch |
| 35 | + |
| 36 | +%description doc |
| 37 | +Documentation for %{name}. |
| 38 | + |
| 39 | +%prep |
| 40 | +%setup -q -n %{gem_name}-%{version} |
| 41 | +cp %{SOURCE1} LICENSE.txt |
| 42 | + |
| 43 | +%build |
| 44 | +# Create the gem as gem install only works on a gem file |
| 45 | +gem build ../%{gem_name}-%{version}.gemspec |
| 46 | + |
| 47 | +# %%gem_install compiles any C extensions and installs the gem into ./%%gem_dir |
| 48 | +# by default, so that we can move it into the buildroot in %%install |
| 49 | +%gem_install |
| 50 | + |
| 51 | +%install |
| 52 | +mkdir -p %{buildroot}%{gem_dir} |
| 53 | +cp -a .%{gem_dir}/* \ |
| 54 | + %{buildroot}%{gem_dir}/ |
| 55 | + |
| 56 | + |
| 57 | + |
| 58 | +%check |
| 59 | +ruby -I.%{gem_instdir}/lib %{SOURCE3} %{SOURCE4} %{SOURCE5} |
| 60 | + |
| 61 | +%files |
| 62 | +%license LICENSE.txt |
| 63 | +%dir %{gem_instdir} |
| 64 | +%{gem_libdir} |
| 65 | +%exclude %{gem_cache} |
| 66 | +%{gem_spec} |
| 67 | + |
| 68 | +%files doc |
| 69 | +%doc %{gem_docdir} |
| 70 | + |
| 71 | + |
| 72 | +%changelog |
| 73 | +* Fri Dec 06 2024 Sumit Jena <v-sumitjena@microsoft.com> - 1.0.0-1 |
| 74 | +- Initial Azure Linux import from Fedora 41 (license: MIT). |
| 75 | +- License verified |
0 commit comments