!8 [sync] PR-7: Use %gem_extdir_mri instead of ext for %check due to ruby3.2 change

From: @openeuler-sync-bot 
Reviewed-by: @jxy_git 
Signed-off-by: @jxy_git
This commit is contained in:
openeuler-ci-bot 2023-08-11 03:05:36 +00:00 committed by Gitee
commit 68bd9467a8
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -1,7 +1,7 @@
%global gem_name rdiscount %global gem_name rdiscount
Name: rubygem-rdiscount Name: rubygem-rdiscount
Version: 2.2.0.2 Version: 2.2.0.2
Release: 1 Release: 2
Summary: Converts documents in Markdown syntax to HTML Summary: Converts documents in Markdown syntax to HTML
License: ASL 1.1 License: ASL 1.1
URL: http://github.com/rtomayko/rdiscount URL: http://github.com/rtomayko/rdiscount
@ -27,69 +27,77 @@ This package contains documentation for rubygem-rdiscount.
%prep %prep
gem unpack %{SOURCE0} gem unpack %{SOURCE0}
%autosetup -D -T -n rdiscount-%{version} -p0 %setup -q -D -T -n %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby | sed -e 's|,|,\n|g' > rdiscount.gemspec %patch0 -p0
gem spec %{SOURCE0} -l --ruby | sed -e 's|,|,\n|g' > %{gem_name}.gemspec
(cd ext; ls -1 *.c *.h | grep -v rdiscount.c ) > discount_files (cd ext; ls -1 *.c *.h | grep -v rdiscount.c ) > discount_files
cat discount_files | while read f ; cat discount_files | while read f ; do
do
rm -f ext/$f rm -f ext/$f
sed -i rdiscount.gemspec -e "\@ext/$f@d" sed -i %{gem_name}.gemspec -e "\@ext/$f@d"
done done
sed -i ext/extconf.rb -e '\@create_makefile@i \$libs = "-lmarkdown"' \ sed -i ext/extconf.rb \
-e '\@create_makefile@i \$libs = "-lmarkdown"' \
%{nil} %{nil}
%build %build
rm -rf ./%{gem_extdir_mri} ./%{gem_instdir} rm -rf ./%{gem_extdir_mri}
gem build rdiscount.gemspec rm -rf ./%{gem_instdir}
gem build %{gem_name}.gemspec
%gem_install %gem_install
%install %install
rm -rf %{buildroot} rm -rf %{buildroot}
install -d %{buildroot}%{gem_dir} mkdir -p %{buildroot}%{gem_dir}
install -d %{buildroot}%{_mandir}/man1 mkdir -p %{buildroot}%{_mandir}/man1
install -d %{buildroot}%{_mandir}/man7 mkdir -p %{buildroot}%{_mandir}/man7
mv .%{gem_instdir}/man/rdiscount.1 %{buildroot}%{_mandir}/man1 mv .%{gem_instdir}/man/rdiscount.1 %{buildroot}%{_mandir}/man1
mv .%{gem_instdir}/man/markdown.7 %{buildroot}%{_mandir}/man7 mv .%{gem_instdir}/man/markdown.7 %{buildroot}%{_mandir}/man7
cp -a .%{gem_dir}/* %{buildroot}%{gem_dir} cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}
rm -rf %{buildroot}%{gem_instdir}/ext rm -rf %{buildroot}%{gem_instdir}/ext
install -d %{buildroot}%{gem_extdir_mri} mkdir -p %{buildroot}%{gem_extdir_mri}
install -D .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/ cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/
install -d %{buildroot}/%{_bindir} mkdir -p %{buildroot}/%{_bindir}
mv .%{_bindir}/* %{buildroot}/%{_bindir} mv .%{_bindir}/* %{buildroot}/%{_bindir}
%check %check
cd .%{gem_instdir} pushd .%{gem_instdir}
ruby -Ilib:ext:. -e 'gem "test-unit" ; Dir.glob("test/*_test.rb").sort.each {|f| require f}' ruby -Ilib:%{buildroot}%{gem_extdir_mri}:. \
cd - -e 'gem "test-unit" ; Dir.glob("test/*_test.rb").sort.each {|f| require f}'
popd
%files %files
%{_bindir}/rdiscount %{_bindir}/rdiscount
%dir %{gem_instdir} %dir %{gem_instdir}
%{gem_instdir}/bin/ %{gem_instdir}/bin/
%{gem_libdir}/ %{gem_libdir}/
%{gem_spec}
%{gem_extdir_mri}/
%exclude %{gem_cache}
%files help
%doc %{gem_instdir}/Rakefile
%doc %{gem_instdir}/BUILDING %doc %{gem_instdir}/BUILDING
%doc %{gem_instdir}/COPYING %doc %{gem_instdir}/COPYING
%doc %{gem_instdir}/README.markdown %doc %{gem_instdir}/README.markdown
%exclude %{gem_cache}
%{gem_spec}
%{gem_extdir_mri}/
%{_mandir}/man1/rdiscount.1.gz
%exclude %{_mandir}/man7/markdown.7.gz
%files help
%doc %{gem_instdir}/Rakefile
%{gem_docdir} %{gem_docdir}
%{gem_instdir}/man %{gem_instdir}/man
%{gem_instdir}/test %{gem_instdir}/test
%{_mandir}/man1/rdiscount.1.gz
%{gem_instdir}/rdiscount.gemspec %{gem_instdir}/rdiscount.gemspec
%exclude %{_mandir}/man7/markdown.7.gz
%changelog %changelog
* Fri Aug 11 2023 wubijie <wubijie@kylinos.cn> - 2.2.0.2-2
- Use %gem_extdir_mri instead of ext for %check due to ruby3.2 change
* Tue Jun 28 2022 wulei <wulei80@h-partners.com> - 2.2.0.2-1 * Tue Jun 28 2022 wulei <wulei80@h-partners.com> - 2.2.0.2-1
- Upgrade to 2.2.0.2 - Upgrade to 2.2.0.2