108 lines
2.2 KiB
RPMSpec
108 lines
2.2 KiB
RPMSpec
%bcond_with enable_tests
|
|
%global gem_name sassc
|
|
%define debug_package %{nil}
|
|
|
|
Name: rubygem-%{gem_name}
|
|
Summary: Use libsass with Ruby!
|
|
Version: 2.4.0
|
|
Release: 2
|
|
License: MIT
|
|
|
|
URL: https://github.com/sass/sassc-ruby
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
|
Patch0: 00-disable-broken-tests.patch
|
|
|
|
BuildRequires: ruby-devel >= 2.0.0
|
|
BuildRequires: rubygems-devel
|
|
BuildRequires: ruby(release)
|
|
|
|
%if %{with enable_tests}
|
|
# test requirements
|
|
BuildRequires: libsass
|
|
BuildRequires: rubygem(ffi)
|
|
BuildRequires: rubygem(minitest)
|
|
BuildRequires: rubygem(minitest-around)
|
|
BuildRequires: rubygem(test_construct)
|
|
%endif
|
|
|
|
Requires: libsass
|
|
|
|
%description
|
|
Use libsass with Ruby!
|
|
|
|
|
|
%package doc
|
|
Summary: Documentation for %{name}
|
|
Requires: %{name} = %{version}-%{release}
|
|
BuildArch: noarch
|
|
|
|
%description doc
|
|
Documentation for %{name}.
|
|
|
|
|
|
%prep
|
|
%autosetup -n %{gem_name}-%{version} -p1
|
|
|
|
# disable building bundled libsass
|
|
sed -i "/s\.extensions/d" ../%{gem_name}-%{version}.gemspec
|
|
|
|
|
|
%build
|
|
# use libsass.so.1 from host
|
|
sed -i "s/libsass\.\#{dl_ext}/libsass\.\#{dl_ext}\.1/" lib/sassc/native.rb
|
|
sed -i "s!__dir__!\"%{_libdir}\"!" lib/sassc/native.rb
|
|
|
|
gem build ../%{gem_name}-%{version}.gemspec
|
|
|
|
%gem_install
|
|
|
|
|
|
%install
|
|
mkdir -p %{buildroot}%{gem_dir}
|
|
cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}/
|
|
|
|
%if %{with enable_tests}
|
|
%check
|
|
pushd .%{gem_instdir}
|
|
# Pry dependency is not really necessary.
|
|
sed -i '/require "pry"/ s/^/#/' test/test_helper.rb
|
|
|
|
ruby -Ilib -e 'Dir.glob "./test/**_test.rb", &method(:require)'
|
|
popd
|
|
%endif
|
|
|
|
%files
|
|
%license %{gem_instdir}/LICENSE.txt
|
|
|
|
%{gem_libdir}
|
|
%{gem_spec}
|
|
|
|
%dir %{gem_instdir}
|
|
|
|
%exclude %{gem_instdir}/ext/
|
|
%exclude %{gem_instdir}/sassc.gemspec
|
|
%exclude %{gem_instdir}/.gitignore
|
|
%exclude %{gem_instdir}/.gitmodules
|
|
%exclude %{gem_instdir}/.travis.yml
|
|
|
|
%exclude %{gem_cache}
|
|
|
|
%files doc
|
|
%doc %{gem_docdir}
|
|
%doc %{gem_instdir}/CHANGELOG.md
|
|
%doc %{gem_instdir}/CODE_OF_CONDUCT.md
|
|
%doc %{gem_instdir}/README.md
|
|
|
|
%{gem_instdir}/Gemfile
|
|
%{gem_instdir}/Rakefile
|
|
%{gem_instdir}/test/
|
|
|
|
|
|
%changelog
|
|
* Wed Mar 30 2022 liyanan<liyanan32@huawei.com> - 2.4.0-2
|
|
- Disable tests
|
|
|
|
* Wed Mar 2 2022 caodongxia<caodongxia@huawei.com> - 2.4.0-1
|
|
- Init package
|
|
|