init package
This commit is contained in:
parent
41cb416a80
commit
6ffc4c8c08
BIN
racc-1.6.0.gem
Normal file
BIN
racc-1.6.0.gem
Normal file
Binary file not shown.
32
racc-create-tarball-missing-files.sh
Normal file
32
racc-create-tarball-missing-files.sh
Normal file
@ -0,0 +1,32 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
set -e
|
||||
|
||||
if [ $# -lt 1 ]
|
||||
then
|
||||
echo "$0 <version>"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
CURRDIR=$(pwd)
|
||||
|
||||
TMPDIRPATH=$(mktemp -d /var/tmp/racc-tar-XXXXXX)
|
||||
pushd $TMPDIRPATH
|
||||
|
||||
NAME=racc
|
||||
VERSION=$1
|
||||
|
||||
git clone https://github.com/ruby/racc.git
|
||||
pushd racc
|
||||
git reset --hard v${VERSION}
|
||||
popd
|
||||
|
||||
ln -sf ${NAME} ${NAME}-${VERSION}
|
||||
tar czf ${CURRDIR}/rubygem-${NAME}-${VERSION}-missing-files.tar.gz \
|
||||
${NAME}-${VERSION}/./{test/,sample/}
|
||||
|
||||
popd
|
||||
|
||||
rm -rf $TMPDIRPATH
|
||||
|
||||
BIN
rubygem-racc-1.6.0-missing-files.tar.gz
Normal file
BIN
rubygem-racc-1.6.0-missing-files.tar.gz
Normal file
Binary file not shown.
128
rubygem-racc.spec
Normal file
128
rubygem-racc.spec
Normal file
@ -0,0 +1,128 @@
|
||||
%global gem_name racc
|
||||
|
||||
Name: rubygem-%{gem_name}
|
||||
Version: 1.6.0
|
||||
Release: 1
|
||||
|
||||
Summary: LALR(1) parser generator
|
||||
License: BSD
|
||||
URL: https://github.com/ruby/racc
|
||||
|
||||
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
||||
Source10: rubygem-%{gem_name}-%{version}-missing-files.tar.gz
|
||||
# Source10 is created by %%{SOURCE11} %%version
|
||||
Source11: racc-create-tarball-missing-files.sh
|
||||
|
||||
BuildRequires: gcc
|
||||
BuildRequires: rubygems-devel
|
||||
BuildRequires: ruby-devel
|
||||
BuildRequires: rubygem(test-unit)
|
||||
BuildRequires: rubygem(did_you_mean)
|
||||
|
||||
|
||||
%description
|
||||
Racc is a LALR(1) parser generator.
|
||||
It is written in Ruby itself, and generates Ruby program.
|
||||
|
||||
|
||||
%package doc
|
||||
Summary: Documentation for %{name}
|
||||
Requires: %{name} = %{version}-%{release}
|
||||
BuildArch: noarch
|
||||
|
||||
%description doc
|
||||
Documentation for %{name}.
|
||||
|
||||
%prep
|
||||
%setup -q -n %{gem_name}-%{version} -a 10
|
||||
|
||||
mv ../%{gem_name}-%{version}.gemspec .
|
||||
|
||||
# Fix shebang
|
||||
grep -rl /usr/local . | xargs -r sed -i -e 's|/usr/local|/usr|'
|
||||
|
||||
# Encoding
|
||||
pushd %{gem_name}-%{version}
|
||||
for f in \
|
||||
sample/calc-ja.y \
|
||||
#web/racc.ja.rhtml \
|
||||
%{nil}
|
||||
do
|
||||
touch -r $f $f.stamp
|
||||
iconv -f EUC-JP -t UTF-8 $f > $f.tmp
|
||||
mv $f.tmp $f
|
||||
touch -r $f.stamp $f
|
||||
rm -f $f.stamp
|
||||
done
|
||||
popd
|
||||
|
||||
%build
|
||||
gem build %{gem_name}-%{version}.gemspec
|
||||
%gem_install
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}%{_prefix}
|
||||
cp -a .%{_prefix}/* \
|
||||
%{buildroot}%{_prefix}/
|
||||
|
||||
cp -a ./%{gem_name}-%{version}/sample \
|
||||
%{buildroot}%{gem_instdir}
|
||||
|
||||
mkdir -p %{buildroot}%{gem_extdir_mri}
|
||||
cp -a .%{gem_extdir_mri}/* \
|
||||
%{buildroot}%{gem_extdir_mri}/
|
||||
rm -f %{buildroot}%{gem_extdir_mri}/{gem_make.out,mkmf.log}
|
||||
|
||||
rm -f %{buildroot}%{gem_cache}
|
||||
pushd %{buildroot}%{gem_instdir}
|
||||
rm -rf \
|
||||
ext/ \
|
||||
fastcache/ \
|
||||
misc/ \
|
||||
tasks/ \
|
||||
test/ \
|
||||
DEPENDS \
|
||||
Manifest.txt \
|
||||
Rakefile \
|
||||
setup.rb \
|
||||
%{nil}
|
||||
|
||||
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x
|
||||
|
||||
%check
|
||||
cp -a %{gem_name}-%{version}/* .%{gem_instdir}
|
||||
pushd .%{gem_instdir}
|
||||
|
||||
LANG=C.utf8
|
||||
true sed -i.match test/test_racc_command.rb \
|
||||
-e '\@assert_output_unchanged@d'
|
||||
|
||||
ruby -Ilib:test:test/lib:. -e \
|
||||
"gem 'test-unit' ; require 'helper' ; Dir.glob('test/test_*.rb').each {|f| require f}"
|
||||
popd
|
||||
|
||||
%files
|
||||
%dir %{gem_instdir}
|
||||
|
||||
%license %{gem_instdir}/COPYING
|
||||
%doc %lang(ja) %{gem_instdir}/README.ja.rdoc
|
||||
%doc %{gem_instdir}/README.rdoc
|
||||
%doc %{gem_instdir}/ChangeLog
|
||||
|
||||
%{_bindir}/racc
|
||||
|
||||
%{gem_extdir_mri}
|
||||
%{gem_instdir}/bin
|
||||
%{gem_libdir}
|
||||
|
||||
%{gem_spec}
|
||||
|
||||
%files doc
|
||||
%doc %{gem_docdir}
|
||||
%doc %{gem_instdir}/TODO
|
||||
%doc %{gem_instdir}/doc
|
||||
%doc %{gem_instdir}/sample
|
||||
|
||||
%changelog
|
||||
* Thu Mar 3 2022 caodongxia<caodongxia@huawei.com> - 1.6.0-1
|
||||
- Initial package
|
||||
Loading…
x
Reference in New Issue
Block a user