diff --git a/.gitignore b/.gitignore index e91091d..970ce7a 100644 --- a/.gitignore +++ b/.gitignore @@ -2,7 +2,3 @@ highline-1.5.1.tgz /highline-1.5.2.tgz /highline-1.6.11.gem /highline-1.6.21.gem -/highline-1.7.8.gem -/tests-2.0.3.tar.bz2 -/highline-3.0.1.gem -/tests-3.0.1.tar.bz2 diff --git a/dl-tests.sh b/dl-tests.sh deleted file mode 100644 index 3ab66bb..0000000 --- a/dl-tests.sh +++ /dev/null @@ -1,127 +0,0 @@ -#!/bin/bash - -tag=$(sed -n 's/^Version:\s\(.*\)$/\1/p' ./*.spec | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') -url=$(sed -n 's/^URL:\s\(.*\)$/\1/p' ./*.spec | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//') -pkgdir=$(basename $url | sed -s 's/\.git$//') - -echo "tag: $tag" -echo "URL: $url" -echo "pkgdir: $pkgdir" - -set -e - -tmp=$(mktemp -d) - -trap cleanup EXIT -cleanup() { - echo Cleaning up... - set +e - [ -z "$tmp" -o ! -d "$tmp" ] || rm -rf "$tmp" -} - -unset CDPATH -pwd=$(pwd) - -pushd "$tmp" -git clone $url -cd $pkgdir -echo Finding git tag -gittag=$(git show-ref --tags | cut -d' ' -f2 | grep "${tag}$" || git show-ref --tags | cut -d' ' -f2 | sort -Vr | head -n1) -if [ -z $gittag ]; then - gittag=tags/$tag -fi -echo "Git Tag: $gittag" -if [ -d "test" ]; then - git archive --prefix='test/' --format=tar ${gittag}:test/ \ - | bzip2 > "$pwd"/tests-${tag}.tar.bz2 -elif [ -d "tests" ]; then - git archive --prefix='tests/' --format=tar ${gittag}:tests/ \ - | bzip2 > "$pwd"/tests-${tag}.tar.bz2 -elif [ -d "spec" ]; then - git archive --prefix='spec/' --format=tar ${gittag}:spec/ \ - | bzip2 > "$pwd"/tests-${tag}.tar.bz2 -else - echo "No test directory found for tag ${gittag}" -fi -if [ -d "support" ]; then - git archive --prefix='support/' --format=tar ${gittag}:support/ \ - | bzip2 > "$pwd"/support-${tag}.tar.bz2 -fi -if [ -d "fixture" ]; then - git archive --prefix='fixture/' --format=tar ${gittag}:fixture/ \ - | bzip2 > "$pwd"/fixture-${tag}.tar.bz2 -fi -if [ -d "examples" ]; then - git archive --prefix='examples/' --format=tar ${gittag}:examples/ \ - | bzip2 > "$pwd"/examples-${tag}.tar.bz2 -elif [ -d "example" ]; then - git archive --prefix='example/' --format=tar ${gittag}:example/ \ - | bzip2 > "$pwd"/examples-${tag}.tar.bz2 -fi -if [ -d "tasks" ]; then - git archive --prefix='tasks/' --format=tar ${gittag}:tasks/ \ - | bzip2 > "$pwd"/tasks-${tag}.tar.bz2 -fi -if [ -d "docs" ]; then - git archive --prefix='docs/' --format=tar ${gittag}:docs/ \ - | bzip2 > "$pwd"/docs-${tag}.tar.bz2 -elif [ -d "doc" ]; then - git archive --prefix='doc/' --format=tar ${gittag}:doc/ \ - | bzip2 > "$pwd"/docs-${tag}.tar.bz2 -fi -if [ -d "src" ]; then - git archive --prefix='src/' --format=tar ${gittag}:src/ \ - | bzip2 > "$pwd"/src-${tag}.tar.bz2 -elif [ -d "source" ]; then - git archive --prefix='source/' --format=tar ${gittag}:source/ \ - | bzip2 > "$pwd"/source-${tag}.tar.bz2 -fi -if [ -d "tools" ]; then - git archive --prefix='tools/' --format=tar ${gittag}:tools/ \ - | bzip2 > "$pwd"/tools-${tag}.tar.bz2 -fi -if [ -d "scripts" ]; then - git archive --prefix='scripts/' --format=tar ${gittag}:scripts/ \ - | bzip2 > "$pwd"/scripts-${tag}.tar.bz2 -fi -if [ -d "modules" ]; then - git archive --prefix='modules/' --format=tar ${gittag}:modules/ \ - | bzip2 > "$pwd"/modules-${tag}.tar.bz2 -fi -if [ -d "ts" ]; then - git archive --prefix='ts/' --format=tar ${gittag}:ts/ \ - | bzip2 > "$pwd"/ts-${tag}.tar.bz2 -fi -if [ -d "build" ]; then - git archive --prefix='build/' --format=tar ${gittag}:build/ \ - | bzip2 > "$pwd"/build-${tag}.tar.bz2 -fi -if [ -d "fixtures" ]; then - git archive --prefix='fixtures/' --format=tar ${gittag}:fixtures/ \ - | bzip2 > "$pwd"/fixtures-${tag}.tar.bz2 -fi -if [ -d "mocks" ]; then - git archive --prefix='mocks/' --format=tar ${gittag}:mocks/ \ - | bzip2 > "$pwd"/mocks-${tag}.tar.bz2 -fi -if [ -d "typings" ]; then - git archive --prefix='typings/' --format=tar ${gittag}:typings/ \ - | bzip2 > "$pwd"/typings-${tag}.tar.bz2 -fi -if [ -d "templates" ]; then - git archive --prefix='templates/' --format=tar ${gittag}:templates/ \ - | bzip2 > "$pwd"/templates-${tag}.tar.bz2 -fi -if [ -d "benchmark" ]; then - git archive --prefix='benchmark/' --format=tar ${gittag}:benchmark/ \ - | bzip2 > "$pwd"/benchmark-${tag}.tar.bz2 -fi -if [ -d "vendor" ]; then - git archive --prefix='vendor/' --format=tar ${gittag}:vendor/ \ - | bzip2 > "$pwd"/vendor-${tag}.tar.bz2 -fi -if [ -d "packages" ]; then - git archive --prefix='packages/' --format=tar ${gittag}:packages/ \ - | bzip2 > "$pwd"/packages-${tag}.tar.bz2 -fi -popd diff --git a/rubygem-highline.spec b/rubygem-highline.spec index 3ee4c95..2d89637 100644 --- a/rubygem-highline.spec +++ b/rubygem-highline.spec @@ -3,21 +3,16 @@ Summary: HighLine is a high-level command-line IO library Name: rubygem-%{gem_name} -Version: 3.0.1 -Release: 4%{?dist} -License: GPL-2.0-only or Ruby +Version: 1.6.21 +Release: 7%{?dist} +Group: Development/Languages +License: GPLv2 or Ruby or BSD URL: https://github.com/JEG2/highline Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem -# The test files are not included in the npm tarball. -# Source1 is generated by running Source10, which pulls from the upstream -# version control repository. -Source1: tests-%{version}.tar.bz2 -Source10: dl-tests.sh BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby -BuildRequires: rubygem(minitest) -BuildRequires: rubygem(simplecov) +BuildRequires: rubygem(test-unit) BuildArch: noarch %description @@ -28,6 +23,7 @@ with just minutes of work. %package doc Summary: Documentation for %{name} +Group: Documentation Requires: %{name} = %{version}-%{release} BuildArch: noarch @@ -35,11 +31,10 @@ BuildArch: noarch Documentation for %{name} %prep -%setup -q -n %{gem_name}-%{version} +%setup -q -c -T +%gem_install -n %{SOURCE0} %build -gem build ../%{gem_name}-%{version}.gemspec -%gem_install %install mkdir -p %{buildroot}%{gem_dir} @@ -47,105 +42,47 @@ cp -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ # Fix the shebang. -find %{buildroot}%{gem_instdir}/{examples,lib}/ -type f -name '*.rb' -exec \ +find %{buildroot}%{gem_instdir}/{examples,lib,test}/ -type f -name '*.rb' -exec \ sed -i -e 's|/usr/local/bin/ruby|/usr/bin/ruby|' '{}' \; -# Remove build leftovers. +# Remove hidden files. find %{buildroot}%{gem_instdir}/ -type f -iname '.*' -exec rm -f '{}' \; -rm -f %{buildroot}%{gem_instdir}/Gemfile -rm -rf %{buildroot}%{gem_instdir}/.github %check pushd .%{gem_instdir} -# setup the tests -tar xfj %{SOURCE1} -ruby -Ilib:test test/test_*.rb +# Test fails without real terminal. +sed -i '/^ def test_terminal_size$/,/^ end$/ s/^/#/' test/tc_highline.rb + +# Set locales, since the test suite does some unjustified assumptions about +# encoding. +# https://github.com/JEG2/highline/issues/108 +LANG=en_US.utf8 ruby -Ilib:test test/ts_all.rb popd %files -%license %{gem_instdir}/LICENSE -%license %{gem_instdir}/COPYING %dir %{gem_instdir} +%exclude %{gem_instdir}/setup.rb %{gem_libdir} %exclude %{gem_cache} %{gem_spec} +%{gem_instdir}/COPYING %files doc %doc %{gem_docdir} -%doc %{gem_instdir}/README.md +%doc %{gem_instdir}/README.rdoc %doc %{gem_instdir}/TODO -%doc %{gem_instdir}/Changelog.md +%doc %{gem_instdir}/CHANGELOG +%doc %{gem_instdir}/LICENSE %{gem_instdir}/AUTHORS %{gem_instdir}/Rakefile %{gem_instdir}/examples %{gem_instdir}/%{gem_name}.gemspec %{gem_instdir}/site +%{gem_instdir}/test +%exclude %{gem_instdir}/INSTALL %changelog -* Fri Jul 25 2025 Fedora Release Engineering - 3.0.1-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild - -* Sat Jan 18 2025 Fedora Release Engineering - 3.0.1-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild - -* Fri Jul 19 2024 Fedora Release Engineering - 3.0.1-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild - -* Thu May 02 2024 Troy Dawson - 3.0.1-1 -- Update to 3.0.1 -- move to SPDX license format - -* Fri Jan 26 2024 Fedora Release Engineering - 2.0.3-8 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Mon Jan 22 2024 Fedora Release Engineering - 2.0.3-7 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild - -* Fri Jul 21 2023 Fedora Release Engineering - 2.0.3-6 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild - -* Fri Jan 20 2023 Fedora Release Engineering - 2.0.3-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild - -* Sat Jul 23 2022 Fedora Release Engineering - 2.0.3-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - -* Fri Jan 21 2022 Fedora Release Engineering - 2.0.3-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild - -* Fri Jul 23 2021 Fedora Release Engineering - 2.0.3-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - -* Tue Feb 02 2021 Troy Dawson - 2.0.3-1 -- Fix FTBFS (#1923635) -- Update to 2.0.3 -- Supply tests from git source -- Update BuildRequires - -* Wed Jan 27 2021 Fedora Release Engineering - 1.7.8-5 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild - -* Wed Jul 29 2020 Fedora Release Engineering - 1.7.8-4 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild - -* Thu Jan 30 2020 Fedora Release Engineering - 1.7.8-3 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild - -* Fri Jul 26 2019 Fedora Release Engineering - 1.7.8-2 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild - -* Fri Feb 15 2019 Troy Dawson - 1.7.8-1 -- Fix FTBFS (#1675925) -- Update to 1.7.8 (the latest version with tests in the gem) - -* Sat Feb 02 2019 Fedora Release Engineering - 1.6.21-9 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild - -* Sun Nov 18 2018 Zbigniew Jędrzejewski-Szmek - 1.6.21-8 -- Use C.UTF-8 locale - See https://fedoraproject.org/wiki/Changes/Remove_glibc-langpacks-all_from_buildroot - * Sat Jul 14 2018 Fedora Release Engineering - 1.6.21-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild diff --git a/sources b/sources index 9f3a469..1bb5050 100644 --- a/sources +++ b/sources @@ -1,2 +1 @@ -SHA512 (highline-3.0.1.gem) = 65b39f093cb26fac1cb256e8271ce3de98d010c6ceca55a5a782a768a024d40fee56c6b587ed0057cfe3b5451a6e6edf40c3ce50a02f9357b93a3f443d69dd80 -SHA512 (tests-3.0.1.tar.bz2) = 2fd5055d85a306f63afcdbfbf4dfa19968de45030e35ecf23803bd9143b216f1faec6485f904fae5abc30b1eea7f3b59af6546399dd05e0d8f05b025ed927588 +fc79952fb9d12957d828da76b94e4ecb highline-1.6.21.gem