Drop compatibility with old releases

This commit is contained in:
Yaakov Selkowitz 2018-01-25 03:13:39 -06:00
parent 6af8b6afaa
commit 859f3f1d1f

View File

@ -1,66 +1,31 @@
%if 0%{?fedora} <= 16 && 0%{?rhel} <= 6
%global ruby_sitelib %(ruby -rrbconfig -e "puts Config::CONFIG['sitelibdir']")
%global ruby_sitearch %(ruby -rrbconfig -e "puts Config::CONFIG['sitearchdir']")
%endif
%global mainver 1.8.1 %global mainver 1.8.1
#%%global prever .rc3 #%%global prever .rc3
%global mainrel 1 %global mainrel 1
%global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g') %global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g')
%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null) %global gem_name nokogiri
%global gemname nokogiri
%global geminstdir %{gemdir}/gems/%{gemname}-%{mainver}%{?prever}
%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7
%if 0%{?fedora} < 19
%global rubyabi 1.9.1
%endif
%global ruby19 1
%global gemdir %{gem_dir}
%global geminstdir %{gem_instdir}
%global gemsodir %{gem_extdir_mri}/lib
%else
%global ruby19 0
%global gemsodir %{ruby_sitearch}
%endif
%global gem_name %{gemname}
# Note for packager:
# Nokogiri 1.4.3.1 gem says that Nokogiri upstream will
# no longer support ruby 1.8.6 after 2010-08-01, so
# it seems that 1.4.3.1 is the last version for F-13 and below.
Summary: An HTML, XML, SAX, and Reader parser Summary: An HTML, XML, SAX, and Reader parser
Name: rubygem-%{gemname} Name: rubygem-%{gem_name}
Version: %{mainver} Version: %{mainver}
Release: %{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}}%{?dist}.2 Release: %{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}}%{?dist}.3
Group: Development/Languages Group: Development/Languages
License: MIT License: MIT
URL: http://nokogiri.rubyforge.org/nokogiri/ URL: http://nokogiri.rubyforge.org/nokogiri/
Source0: https://rubygems.org/gems/%{gemname}-%{mainver}%{?prever}.gem Source0: https://rubygems.org/gems/%{gem_name}-%{mainver}%{?prever}.gem
# ./test/html/test_element_description.rb:62 fails, as usual...... # ./test/html/test_element_description.rb:62 fails, as usual......
# Patch0: rubygem-nokogiri-1.5.0.beta3-test-failure.patch # Patch0: rubygem-nokogiri-1.5.0.beta3-test-failure.patch
#Patch0: rubygem-nokogiri-1.5.0-allow-non-crosscompile.patch #Patch0: rubygem-nokogiri-1.5.0-allow-non-crosscompile.patch
# Shut down libxml2 version unmatching warning # Shut down libxml2 version unmatching warning
Patch0: %{name}-1.6.6.4-shutdown-libxml2-warning.patch Patch0: %{name}-1.6.6.4-shutdown-libxml2-warning.patch
%if 0%{?fedora} >= 19
Requires: ruby(release)
BuildRequires: ruby(release) BuildRequires: ruby(release)
%else
Requires: ruby(abi) = %{rubyabi}
Requires: ruby
BuildRequires: ruby(abi) = %{rubyabi}
BuildRequires: ruby
%endif
BuildRequires: ruby(rubygems) BuildRequires: ruby(rubygems)
## ##
## For %%check ## For %%check
BuildRequires: rubygem(minitest) BuildRequires: rubygem(minitest)
BuildRequires: rubygems-devel BuildRequires: rubygems-devel
Obsoletes: ruby-%{gemname} <= 1.5.2-2 Obsoletes: ruby-%{gem_name} <= 1.5.2-2
#BuildRequires: ruby(racc) #BuildRequires: ruby(racc)
## ##
## Others ## Others
@ -68,8 +33,6 @@ BuildRequires: rubygem(pkg-config)
BuildRequires: libxml2-devel BuildRequires: libxml2-devel
BuildRequires: libxslt-devel BuildRequires: libxslt-devel
BuildRequires: ruby-devel BuildRequires: ruby-devel
Requires: ruby(rubygems)
Provides: rubygem(%{gemname}) = %{version}-%{release}
%description %description
Nokogiri parses and searches XML/HTML very quickly, and also has Nokogiri parses and searches XML/HTML very quickly, and also has
@ -97,14 +60,14 @@ Requires: %{name} = %{version}-%{release}
%description doc %description doc
This package contains documentation for %{name}. This package contains documentation for %{name}.
%package -n ruby-%{gemname} %package -n ruby-%{gem_name}
Summary: Non-Gem support package for %{gemname} Summary: Non-Gem support package for %{gem_name}
Group: Development/Languages Group: Development/Languages
Requires: %{name} = %{version}-%{release} Requires: %{name} = %{version}-%{release}
Provides: ruby(%{gemname}) = %{version}-%{release} Provides: ruby(%{gem_name}) = %{version}-%{release}
%description -n ruby-%{gemname} %description -n ruby-%{gem_name}
This package provides non-Gem support for %{gemname}. This package provides non-Gem support for %{gem_name}.
%global version %{mainver}%{?prever} %global version %{mainver}%{?prever}
@ -140,7 +103,7 @@ popd
rm -rf tmpunpackdir rm -rf tmpunpackdir
%build %build
mkdir -p ./%{gemdir} mkdir -p ./%{gem_dir}
# 1.6.0 needs this # 1.6.0 needs this
export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes
@ -148,23 +111,22 @@ export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes
# Permission # Permission
chmod 0644 .%{gemdir}/cache/%{gemname}-%{mainver}%{?prever}.gem chmod 0644 .%{gem_dir}/cache/%{gem_name}-%{mainver}%{?prever}.gem
# Remove precompiled Java .jar file # Remove precompiled Java .jar file
rm -f .%{geminstdir}/lib/*.jar rm -f .%{gem_instdir}/lib/*.jar
# For now remove JRuby support # For now remove JRuby support
rm -rf .%{geminstdir}/ext/java rm -rf .%{gem_instdir}/ext/java
%install %install
mkdir -p %{buildroot}%{gemdir} mkdir -p %{buildroot}%{gem_dir}
cp -a ./%{gemdir}/* %{buildroot}%{gemdir} cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}
# Remove backup file # Remove backup file
find %{buildroot} -name \*.orig_\* | xargs rm -vf find %{buildroot} -name \*.orig_\* | xargs rm -vf
# move arch dependent files to %%gem_extdir # move arch dependent files to %%gem_extdir
%if 0%{?fedora} >= 21
mkdir -p %{buildroot}%{gem_extdir_mri} mkdir -p %{buildroot}%{gem_extdir_mri}
cp -a ./%{gem_extdir_mri}/* %{buildroot}%{gem_extdir_mri}/ cp -a ./%{gem_extdir_mri}/* %{buildroot}%{gem_extdir_mri}/
@ -172,11 +134,6 @@ pushd %{buildroot}
rm -f .%{gem_extdir_mri}/{gem_make.out,mkmf.log} rm -f .%{gem_extdir_mri}/{gem_make.out,mkmf.log}
popd popd
%else
mkdir -p %{buildroot}%{gemsodir}/%{gemname}
mv %{buildroot}%{geminstdir}/lib/%{gemname}/*.so \
%{buildroot}%{gemsodir}/%{gemname}/
%endif
# move bin/ files # move bin/ files
mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_bindir}
@ -184,24 +141,24 @@ cp -pa .%{_bindir}/* \
%{buildroot}%{_bindir}/ %{buildroot}%{_bindir}/
# remove all shebang # remove all shebang
for f in $(find %{buildroot}%{geminstdir} -name \*.rb) for f in $(find %{buildroot}%{gem_instdir} -name \*.rb)
do do
sed -i -e '/^#!/d' $f sed -i -e '/^#!/d' $f
chmod 0644 $f chmod 0644 $f
done done
# cleanups # cleanups
rm -rf %{buildroot}%{geminstdir}/ext/%{gemname}/ rm -rf %{buildroot}%{gem_instdir}/ext/%{gem_name}/
rm -rf %{buildroot}%{geminstdir}/tmp/ rm -rf %{buildroot}%{gem_instdir}/tmp/
rm -f %{buildroot}%{geminstdir}/{.autotest,.require_paths,.gemtest,.travis.yml} rm -f %{buildroot}%{gem_instdir}/{.autotest,.require_paths,.gemtest,.travis.yml}
rm -f %{buildroot}%{geminstdir}/appveyor.yml rm -f %{buildroot}%{gem_instdir}/appveyor.yml
rm -f %{buildroot}%{geminstdir}/.cross_rubies rm -f %{buildroot}%{gem_instdir}/.cross_rubies
rm -f %{buildroot}%{geminstdir}/{build_all,dependencies.yml,test_all} rm -f %{buildroot}%{gem_instdir}/{build_all,dependencies.yml,test_all}
rm -f %{buildroot}%{geminstdir}/.editorconfig rm -f %{buildroot}%{gem_instdir}/.editorconfig
rm -rf %{buildroot}%{geminstdir}/suppressions/ rm -rf %{buildroot}%{gem_instdir}/suppressions/
rm -rf %{buildroot}%{geminstdir}/patches/ rm -rf %{buildroot}%{gem_instdir}/patches/
rm -f %{buildroot}%{geminstdir}/{Rakefile,Gemfile*} rm -f %{buildroot}%{gem_instdir}/{Rakefile,Gemfile*}
rm -f %{buildroot}%{geminstdir}/Manifest.txt rm -f %{buildroot}%{gem_instdir}/Manifest.txt
@ -213,7 +170,7 @@ export TZ="Asia/Tokyo"
#??? #???
LANG=ja_JP.UTF-8 LANG=ja_JP.UTF-8
pushd ./%{geminstdir} pushd ./%{gem_instdir}
# Need investigation. For now anyway build # Need investigation. For now anyway build
ruby \ ruby \
@ -232,32 +189,35 @@ popd
%files %files
%defattr(-,root, root,-) %defattr(-,root, root,-)
%{_bindir}/%{gemname} %{_bindir}/%{gem_name}
%{gem_extdir_mri}/ %{gem_extdir_mri}/
%dir %{geminstdir}/ %dir %{gem_instdir}/
%doc %{geminstdir}/[A-Z]* %doc %{gem_instdir}/[A-Z]*
%{geminstdir}/bin/ %{gem_instdir}/bin/
%{geminstdir}/lib/ %{gem_instdir}/lib/
%exclude %{gemdir}/cache/%{gemname}-%{mainver}%{?prever}.gem %exclude %{gem_dir}/cache/%{gem_name}-%{mainver}%{?prever}.gem
%{gemdir}/specifications/%{gemname}-%{mainver}%{?prever}.gemspec %{gem_dir}/specifications/%{gem_name}-%{mainver}%{?prever}.gemspec
%if 0 %if 0
%files jruby %files jruby
%defattr(-,root,root,-) %defattr(-,root,root,-)
%{geminstdir}/ext/java/ %{gem_instdir}/ext/java/
%endif %endif
%files doc %files doc
%defattr(-,root,root,-) %defattr(-,root,root,-)
#%%{geminstdir}/deps.rip #%%{gem_instdir}/deps.rip
#%%{geminstdir}/spec/ #%%{gem_instdir}/spec/
%{geminstdir}/tasks/ %{gem_instdir}/tasks/
%{geminstdir}/test/ %{gem_instdir}/test/
%{gemdir}/doc/%{gemname}-%{mainver}%{?prever}/ %{gem_dir}/doc/%{gem_name}-%{mainver}%{?prever}/
%changelog %changelog
* Thu Jan 25 2018 Yaakov Selkowitz <yselkowi@redhat.com> - 1.8.1-1.3
- Drop compatibility with old releases
* Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 1.8.1-1.2 * Sat Jan 20 2018 Björn Esser <besser82@fedoraproject.org> - 1.8.1-1.2
- Rebuilt for switch to libxcrypt - Rebuilt for switch to libxcrypt