rubygem-httpclient/rubygem-httpclient.spec
2023-11-14 11:24:54 +08:00

78 lines
2.2 KiB
RPMSpec

%bcond_with bootstrap
%global gem_name httpclient
%global rubyabi 1.8
Summary: HTTP Client interface for ruby
Name: rubygem-%{gem_name}
Version: 2.8.3
Release: 1
License: (Ruby or BSD) and Public Domain
URL: https://github.com/nahi/httpclient
Source0: https://rubygems.org/downloads/%{gem_name}-%{version}.gem
Requires: ruby(release)
BuildRequires: rubygem(minitest) rubygems-devel rubygem(http-cookie)
BuildArch: noarch
Provides: rubygem(%{gem_name}) = %{version}
%description
an interface to HTTP Client for the ruby language
%package doc
Summary: Documentation for %{name}
Requires: %{name} = %{version}-%{release}
BuildArch: noarch
%description doc
Documentation for %{name}
%prep
gem unpack %{SOURCE0}
%setup -q -D -T -n %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%build
gem build %{gem_name}.gemspec
%gem_install
%install
mkdir -p %{buildroot}%{gem_dir}
cp -a ./%{gem_dir}/* %{buildroot}%{gem_dir}/
find %{buildroot}/%{gem_instdir} -type f -name "*~" -delete
rm -rf %{buildroot}%{gem_instdir}/.yardoc
for file in `find %{buildroot}/%{gem_instdir} -type f -perm /a+x`; do
[ -z "`head -n 1 $file | grep \"^#!/\"`" ] && chmod -v 644 $file
done
for file in `find %{buildroot}/%{gem_instdir} -type f ! -perm /a+x -name "*.rb"`; do
[ ! -z "`head -n 1 $file | grep \"^#!/\"`" ] && chmod -v 755 $file
done
find %{buildroot}/%{gem_instdir} -type f -perm /g+wx -exec chmod -v g-w {} \;
find %{buildroot}/%{gem_instdir} -type f ! -perm /go+r -exec chmod -v go+r {} \;
%if %{with bootstrap}
%check
pushd %{buildroot}%{gem_instdir}
rm -f test/test_auth.rb
ruby -Ilib -e 'Dir.glob "./test/test_*.rb", &method(:require)'
popd
%endif
%files
%dir %{gem_instdir}
%{gem_instdir}/bin/
%{gem_instdir}/lib/
%doc %{gem_instdir}/sample
%exclude %{gem_cache}
%{gem_spec}
%files doc
%doc %{gem_docdir}
%doc %{gem_instdir}/README.md
%doc %{gem_instdir}/test
%changelog
* Tue Nov 14 2023 yaoxin <yao_xin001@hoperun.com> - 2.8.3-1
- Upgrade to 2.8.3
* Sat Sep 5 2020 liyanan <liyanan32@huawei.com> - 2.8.0-2
- fix build fail
* Thu Aug 20 2020 tuShenmei <tushenmei@huawei.com> - 2.8.0-1
- package init