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 prever .rc3
%global mainrel 1
%global prerpmver %(echo "%{?prever}" | sed -e 's|\\.||g')
%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
%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.
%global gem_name nokogiri
Summary: An HTML, XML, SAX, and Reader parser
Name: rubygem-%{gemname}
Name: rubygem-%{gem_name}
Version: %{mainver}
Release: %{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}}%{?dist}.2
Release: %{?prever:0.}%{mainrel}%{?prever:.%{prerpmver}}%{?dist}.3
Group: Development/Languages
License: MIT
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......
# Patch0: rubygem-nokogiri-1.5.0.beta3-test-failure.patch
#Patch0: rubygem-nokogiri-1.5.0-allow-non-crosscompile.patch
# Shut down libxml2 version unmatching warning
Patch0: %{name}-1.6.6.4-shutdown-libxml2-warning.patch
%if 0%{?fedora} >= 19
Requires: ruby(release)
BuildRequires: ruby(release)
%else
Requires: ruby(abi) = %{rubyabi}
Requires: ruby
BuildRequires: ruby(abi) = %{rubyabi}
BuildRequires: ruby
%endif
BuildRequires: ruby(rubygems)
##
## For %%check
BuildRequires: rubygem(minitest)
BuildRequires: rubygems-devel
Obsoletes: ruby-%{gemname} <= 1.5.2-2
Obsoletes: ruby-%{gem_name} <= 1.5.2-2
#BuildRequires: ruby(racc)
##
## Others
@ -68,8 +33,6 @@ BuildRequires: rubygem(pkg-config)
BuildRequires: libxml2-devel
BuildRequires: libxslt-devel
BuildRequires: ruby-devel
Requires: ruby(rubygems)
Provides: rubygem(%{gemname}) = %{version}-%{release}
%description
Nokogiri parses and searches XML/HTML very quickly, and also has
@ -97,14 +60,14 @@ Requires: %{name} = %{version}-%{release}
%description doc
This package contains documentation for %{name}.
%package -n ruby-%{gemname}
Summary: Non-Gem support package for %{gemname}
%package -n ruby-%{gem_name}
Summary: Non-Gem support package for %{gem_name}
Group: Development/Languages
Requires: %{name} = %{version}-%{release}
Provides: ruby(%{gemname}) = %{version}-%{release}
Provides: ruby(%{gem_name}) = %{version}-%{release}
%description -n ruby-%{gemname}
This package provides non-Gem support for %{gemname}.
%description -n ruby-%{gem_name}
This package provides non-Gem support for %{gem_name}.
%global version %{mainver}%{?prever}
@ -140,7 +103,7 @@ popd
rm -rf tmpunpackdir
%build
mkdir -p ./%{gemdir}
mkdir -p ./%{gem_dir}
# 1.6.0 needs this
export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes
@ -148,23 +111,22 @@ export NOKOGIRI_USE_SYSTEM_LIBRARIES=yes
# Permission
chmod 0644 .%{gemdir}/cache/%{gemname}-%{mainver}%{?prever}.gem
chmod 0644 .%{gem_dir}/cache/%{gem_name}-%{mainver}%{?prever}.gem
# Remove precompiled Java .jar file
rm -f .%{geminstdir}/lib/*.jar
rm -f .%{gem_instdir}/lib/*.jar
# For now remove JRuby support
rm -rf .%{geminstdir}/ext/java
rm -rf .%{gem_instdir}/ext/java
%install
mkdir -p %{buildroot}%{gemdir}
cp -a ./%{gemdir}/* %{buildroot}%{gemdir}
mkdir -p %{buildroot}%{gem_dir}
cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}
# Remove backup file
find %{buildroot} -name \*.orig_\* | xargs rm -vf
# move arch dependent files to %%gem_extdir
%if 0%{?fedora} >= 21
mkdir -p %{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}
popd
%else
mkdir -p %{buildroot}%{gemsodir}/%{gemname}
mv %{buildroot}%{geminstdir}/lib/%{gemname}/*.so \
%{buildroot}%{gemsodir}/%{gemname}/
%endif
# move bin/ files
mkdir -p %{buildroot}%{_bindir}
@ -184,24 +141,24 @@ cp -pa .%{_bindir}/* \
%{buildroot}%{_bindir}/
# remove all shebang
for f in $(find %{buildroot}%{geminstdir} -name \*.rb)
for f in $(find %{buildroot}%{gem_instdir} -name \*.rb)
do
sed -i -e '/^#!/d' $f
chmod 0644 $f
done
# cleanups
rm -rf %{buildroot}%{geminstdir}/ext/%{gemname}/
rm -rf %{buildroot}%{geminstdir}/tmp/
rm -f %{buildroot}%{geminstdir}/{.autotest,.require_paths,.gemtest,.travis.yml}
rm -f %{buildroot}%{geminstdir}/appveyor.yml
rm -f %{buildroot}%{geminstdir}/.cross_rubies
rm -f %{buildroot}%{geminstdir}/{build_all,dependencies.yml,test_all}
rm -f %{buildroot}%{geminstdir}/.editorconfig
rm -rf %{buildroot}%{geminstdir}/suppressions/
rm -rf %{buildroot}%{geminstdir}/patches/
rm -f %{buildroot}%{geminstdir}/{Rakefile,Gemfile*}
rm -f %{buildroot}%{geminstdir}/Manifest.txt
rm -rf %{buildroot}%{gem_instdir}/ext/%{gem_name}/
rm -rf %{buildroot}%{gem_instdir}/tmp/
rm -f %{buildroot}%{gem_instdir}/{.autotest,.require_paths,.gemtest,.travis.yml}
rm -f %{buildroot}%{gem_instdir}/appveyor.yml
rm -f %{buildroot}%{gem_instdir}/.cross_rubies
rm -f %{buildroot}%{gem_instdir}/{build_all,dependencies.yml,test_all}
rm -f %{buildroot}%{gem_instdir}/.editorconfig
rm -rf %{buildroot}%{gem_instdir}/suppressions/
rm -rf %{buildroot}%{gem_instdir}/patches/
rm -f %{buildroot}%{gem_instdir}/{Rakefile,Gemfile*}
rm -f %{buildroot}%{gem_instdir}/Manifest.txt
@ -213,7 +170,7 @@ export TZ="Asia/Tokyo"
#???
LANG=ja_JP.UTF-8
pushd ./%{geminstdir}
pushd ./%{gem_instdir}
# Need investigation. For now anyway build
ruby \
@ -232,32 +189,35 @@ popd
%files
%defattr(-,root, root,-)
%{_bindir}/%{gemname}
%{_bindir}/%{gem_name}
%{gem_extdir_mri}/
%dir %{geminstdir}/
%doc %{geminstdir}/[A-Z]*
%dir %{gem_instdir}/
%doc %{gem_instdir}/[A-Z]*
%{geminstdir}/bin/
%{geminstdir}/lib/
%exclude %{gemdir}/cache/%{gemname}-%{mainver}%{?prever}.gem
%{gemdir}/specifications/%{gemname}-%{mainver}%{?prever}.gemspec
%{gem_instdir}/bin/
%{gem_instdir}/lib/
%exclude %{gem_dir}/cache/%{gem_name}-%{mainver}%{?prever}.gem
%{gem_dir}/specifications/%{gem_name}-%{mainver}%{?prever}.gemspec
%if 0
%files jruby
%defattr(-,root,root,-)
%{geminstdir}/ext/java/
%{gem_instdir}/ext/java/
%endif
%files doc
%defattr(-,root,root,-)
#%%{geminstdir}/deps.rip
#%%{geminstdir}/spec/
%{geminstdir}/tasks/
%{geminstdir}/test/
%{gemdir}/doc/%{gemname}-%{mainver}%{?prever}/
#%%{gem_instdir}/deps.rip
#%%{gem_instdir}/spec/
%{gem_instdir}/tasks/
%{gem_instdir}/test/
%{gem_dir}/doc/%{gem_name}-%{mainver}%{?prever}/
%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
- Rebuilt for switch to libxcrypt