fix build fail
This commit is contained in:
parent
1b254bed50
commit
ed9217c8e4
@ -1,7 +1,8 @@
|
|||||||
|
%bcond_with bootstrap
|
||||||
%global gem_name excon
|
%global gem_name excon
|
||||||
Name: rubygem-%{gem_name}
|
Name: rubygem-%{gem_name}
|
||||||
Version: 0.62.0
|
Version: 0.62.0
|
||||||
Release: 1
|
Release: 2
|
||||||
Summary: Speed, persistence, http(s)
|
Summary: Speed, persistence, http(s)
|
||||||
License: MIT
|
License: MIT
|
||||||
URL: https://github.com/excon/excon
|
URL: https://github.com/excon/excon
|
||||||
@ -38,6 +39,7 @@ cp -a .%{gem_dir}/* \
|
|||||||
%{buildroot}%{gem_dir}/
|
%{buildroot}%{gem_dir}/
|
||||||
rm -rf %{buildroot}%{gem_instdir}/data
|
rm -rf %{buildroot}%{gem_instdir}/data
|
||||||
|
|
||||||
|
%if %{with bootstrap}
|
||||||
%check
|
%check
|
||||||
pushd .%{gem_instdir}
|
pushd .%{gem_instdir}
|
||||||
sed -i '/if plugin == :unicorn/ i\ before { skip("until #{plugin} is in Fedora") } if plugin == :unicorn' spec/support/shared_contexts/test_server_context.rb
|
sed -i '/if plugin == :unicorn/ i\ before { skip("until #{plugin} is in Fedora") } if plugin == :unicorn' spec/support/shared_contexts/test_server_context.rb
|
||||||
@ -49,6 +51,7 @@ openssl req -subj '/CN=excon/O=excon' -new -newkey rsa:2048 -sha256 -days 365 -n
|
|||||||
openssl req -subj '/CN=127.0.0.1/O=excon' -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout tests/data/127.0.0.1.cert.key -out tests/data/127.0.0.1.cert.crt
|
openssl req -subj '/CN=127.0.0.1/O=excon' -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout tests/data/127.0.0.1.cert.key -out tests/data/127.0.0.1.cert.crt
|
||||||
shindo
|
shindo
|
||||||
popd
|
popd
|
||||||
|
%endif
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%dir %{gem_instdir}
|
%dir %{gem_instdir}
|
||||||
@ -71,5 +74,8 @@ popd
|
|||||||
%{gem_instdir}/tests
|
%{gem_instdir}/tests
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Sat Sep 5 2020 liyanan <liyanan32@huawei.com> - 0.62.0-2
|
||||||
|
- fix build fail
|
||||||
|
|
||||||
* Sat Aug 22 2020 liyanan <liyanan32@huawei.com> - 0.62.0-1
|
* Sat Aug 22 2020 liyanan <liyanan32@huawei.com> - 0.62.0-1
|
||||||
- package init
|
- package init
|
||||||
|
|||||||
76
rubygem-excon.spec~
Normal file
76
rubygem-excon.spec~
Normal file
@ -0,0 +1,76 @@
|
|||||||
|
%bcond_with bootstrap
|
||||||
|
%global gem_name excon
|
||||||
|
Name: rubygem-%{gem_name}
|
||||||
|
Version: 0.62.0
|
||||||
|
Release: 1
|
||||||
|
Summary: Speed, persistence, http(s)
|
||||||
|
License: MIT
|
||||||
|
URL: https://github.com/excon/excon
|
||||||
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
||||||
|
Patch0: rubygem-excon-0.62.0-Ruby-2.6-escapes-InvalidURIError-output.patch
|
||||||
|
BuildRequires: ruby(release) rubygems-devel ruby %{_bindir}/openssl rubygem-rack
|
||||||
|
BuildRequires: rubygem-shindo rubygem(activesupport) rubygem(delorean) rubygem(eventmachine)
|
||||||
|
BuildRequires: rubygem(open4) rubygem(puma) rubygem(sinatra) rubygem(rspec)
|
||||||
|
BuildArch: noarch
|
||||||
|
%description
|
||||||
|
EXtended http(s) CONnections.
|
||||||
|
|
||||||
|
%package help
|
||||||
|
Summary: Documentation for %{name}
|
||||||
|
Requires: %{name} = %{version}-%{release}
|
||||||
|
BuildArch: noarch
|
||||||
|
Provides: %{name}-doc = %{version}-%{release}
|
||||||
|
Obsoletes: %{name}-doc < %{version}-%{release}
|
||||||
|
%description help
|
||||||
|
Documentation for %{name}.
|
||||||
|
|
||||||
|
%prep
|
||||||
|
%setup -q -n %{gem_name}-%{version}
|
||||||
|
%patch0 -p1
|
||||||
|
sed -i "/ciphers/ s/'.*'/'PROFILE=SYSTEM'/" lib/excon/constants.rb
|
||||||
|
|
||||||
|
%build
|
||||||
|
gem build ../%{gem_name}-%{version}.gemspec
|
||||||
|
%gem_install
|
||||||
|
|
||||||
|
%install
|
||||||
|
mkdir -p %{buildroot}%{gem_dir}
|
||||||
|
cp -a .%{gem_dir}/* \
|
||||||
|
%{buildroot}%{gem_dir}/
|
||||||
|
rm -rf %{buildroot}%{gem_instdir}/data
|
||||||
|
|
||||||
|
%check
|
||||||
|
pushd .%{gem_instdir}
|
||||||
|
sed -i '/if plugin == :unicorn/ i\ before { skip("until #{plugin} is in Fedora") } if plugin == :unicorn' spec/support/shared_contexts/test_server_context.rb
|
||||||
|
sed -i '/with_unicorn/ s/^/ pending\n\n/' tests/{basic_tests.rb,proxy_tests.rb}
|
||||||
|
rspec spec
|
||||||
|
sed -i "/'bundler\/setup'/ s/^/#/" tests/test_helper.rb
|
||||||
|
sed -i '/redirecting_with_cookie.ru/,/^ end/ s/^/#/' tests/middlewares/capture_cookies_tests.rb
|
||||||
|
openssl req -subj '/CN=excon/O=excon' -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout tests/data/excon.cert.key -out tests/data/excon.cert.crt
|
||||||
|
openssl req -subj '/CN=127.0.0.1/O=excon' -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -keyout tests/data/127.0.0.1.cert.key -out tests/data/127.0.0.1.cert.crt
|
||||||
|
shindo
|
||||||
|
popd
|
||||||
|
|
||||||
|
%files
|
||||||
|
%dir %{gem_instdir}
|
||||||
|
%exclude %{gem_instdir}/.*
|
||||||
|
%license %{gem_instdir}/LICENSE.md
|
||||||
|
%{gem_libdir}
|
||||||
|
%exclude %{gem_cache}
|
||||||
|
%{gem_spec}
|
||||||
|
|
||||||
|
%files help
|
||||||
|
%doc %{gem_docdir}
|
||||||
|
%doc %{gem_instdir}/CONTRIBUT*
|
||||||
|
%{gem_instdir}/Gemfile
|
||||||
|
%doc %{gem_instdir}/README.md
|
||||||
|
%{gem_instdir}/Rakefile
|
||||||
|
%{gem_instdir}/benchmarks
|
||||||
|
%doc %{gem_instdir}/changelog.txt
|
||||||
|
%{gem_instdir}/excon.gemspec
|
||||||
|
%{gem_instdir}/spec
|
||||||
|
%{gem_instdir}/tests
|
||||||
|
|
||||||
|
%changelog
|
||||||
|
* Sat Aug 22 2020 liyanan <liyanan32@huawei.com> - 0.62.0-1
|
||||||
|
- package init
|
||||||
168
spec_prep_plus.sh
Executable file
168
spec_prep_plus.sh
Executable file
@ -0,0 +1,168 @@
|
|||||||
|
changelog_update(){
|
||||||
|
# changelog replace
|
||||||
|
sed -i '/^%changelog/,$d' $file
|
||||||
|
date=`date +"%a %b %_d %Y"`
|
||||||
|
name='liyanan'
|
||||||
|
email='liyanan32@huawei.com'
|
||||||
|
changelog="%changelog\n* $date $name <$email> - ${version}-$release\n- fix build fail"
|
||||||
|
echo -e $changelog >> $file #sed -n '/^%changelog/,$p' $file
|
||||||
|
echo "Hint: changelog updated"
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
single_merge(){
|
||||||
|
awk -v key="$1" -v max_len=80 -F : \
|
||||||
|
'BEGIN {\
|
||||||
|
tmp="";\
|
||||||
|
} \
|
||||||
|
{\
|
||||||
|
if( key == $1 ){\
|
||||||
|
if( NF > 2){\
|
||||||
|
oofs=FS;FS="#";
|
||||||
|
bbb=sub(/[[:alnum:] ]+:/,"",$0);\
|
||||||
|
aaa=$bbb;
|
||||||
|
FS=oofs;
|
||||||
|
}\
|
||||||
|
else{\
|
||||||
|
$1=""; \
|
||||||
|
aaa=$0;\
|
||||||
|
}\
|
||||||
|
|
||||||
|
tmp1=tmp aaa
|
||||||
|
gsub(" +"," ",tmp1);\
|
||||||
|
#print FNR tmp1
|
||||||
|
if(length(tmp1) > max_len){\
|
||||||
|
gsub(" +"," ",tmp);\
|
||||||
|
printf "%-20s%s\n",key ":",tmp;\
|
||||||
|
tmp="";\
|
||||||
|
}\
|
||||||
|
tmp=tmp aaa;\
|
||||||
|
}\
|
||||||
|
else {\
|
||||||
|
if( length(tmp) != 0){\
|
||||||
|
gsub(" +"," ",tmp);\
|
||||||
|
printf "%-20s%s\n",key ":",tmp;\
|
||||||
|
tmp="";\
|
||||||
|
}\
|
||||||
|
print $0;\
|
||||||
|
}\
|
||||||
|
|
||||||
|
}'
|
||||||
|
}
|
||||||
|
|
||||||
|
headers_merge(){
|
||||||
|
cat $file | single_merge "BuildRequires" | single_merge "Requires" > .$file
|
||||||
|
mv -f .$file $file
|
||||||
|
echo "Hint: Tags merged"
|
||||||
|
}
|
||||||
|
|
||||||
|
delete_comment(){
|
||||||
|
sed -i '/^#.*/d' $file
|
||||||
|
echo "Hint: commentline deleted"
|
||||||
|
}
|
||||||
|
delete_blank(){
|
||||||
|
sed -i 's/[[:blank:]]\{1,\}$//g' $file
|
||||||
|
echo "Hint: tail-blank deleted "
|
||||||
|
}
|
||||||
|
|
||||||
|
insert_enter(){
|
||||||
|
sed -i '/^$/d' $file
|
||||||
|
sed -i '/^%package.*/i\ ' $file
|
||||||
|
sed -i '/^%pre.*/i\ ' $file
|
||||||
|
sed -i '/^%post.*/i\ ' $file
|
||||||
|
sed -i '/^%build.*/i\ ' $file
|
||||||
|
sed -i '/^%install.*/i\ ' $file
|
||||||
|
sed -i '/^%check*/i\ ' $file
|
||||||
|
sed -i '/^%files.*/i\ ' $file
|
||||||
|
sed -i '/^%changelog.*/i\ ' $file
|
||||||
|
echo "Hint: insert newline before stages"
|
||||||
|
}
|
||||||
|
|
||||||
|
increase_release(){
|
||||||
|
# release +1
|
||||||
|
sed -i "/^Release.*$/s/${release_oo}/${release}/" $file
|
||||||
|
# delete Group Tags
|
||||||
|
sed -i '/^Group.*/d' $file
|
||||||
|
echo "Hint: release ++"
|
||||||
|
}
|
||||||
|
|
||||||
|
header_align() {
|
||||||
|
awk '{
|
||||||
|
if ($0 ~ /^[A-Z][[:alnum:]]*: / ) {
|
||||||
|
va="";
|
||||||
|
for(i=2;i<=NF;i++){ va=va" "$i};
|
||||||
|
printf("%-20s%s\n",$1,va);
|
||||||
|
}
|
||||||
|
else print $0;
|
||||||
|
}' $file > .$file
|
||||||
|
mv -f .$file $file
|
||||||
|
echo "Hint: header_align done"
|
||||||
|
}
|
||||||
|
|
||||||
|
#################### main
|
||||||
|
main(){
|
||||||
|
|
||||||
|
file_o=$1
|
||||||
|
file=${file_o}.cp
|
||||||
|
sed -i 's/\t/ /g' $1
|
||||||
|
#sed -i 's/%package\s\+javadoc$/%package help/g' $1
|
||||||
|
#sed -i '/%description\s\+javadoc$/i\Provides: %{name}-javadoc = %{version}-%{release}' $1
|
||||||
|
#sed -i '/%description\s\+javadoc$/i\Obsoletes: %{name}-javadoc < %{version}-%{release}' $1
|
||||||
|
#sed -i 's/%description\s\+javadoc$/%description help/g' $1
|
||||||
|
#sed -i 's/%files\s\+javadoc/%files help/g' $1
|
||||||
|
#sed -i 's/%package\s\+doc$/%package help/g' $1
|
||||||
|
#sed -i '/%description\s\+doc$/i\Provides: %{name}-doc = %{version}-%{release}' $1
|
||||||
|
#sed -i '/%description\s\+doc$/i\Obsoletes: %{name}-doc < %{version}-%{release}' $1
|
||||||
|
#sed -i 's/%description\s\+doc$/%description help/g' $1
|
||||||
|
#sed -i 's/%files\s\+doc$/%files help/g' $1
|
||||||
|
#echo 'mv javadoc or doc to help succeed!!!!!!!'
|
||||||
|
sed -i "1i %bcond_with bootstrap" $1
|
||||||
|
sed -i "%check/i\'%if %{with bootstrap}'" $1
|
||||||
|
|
||||||
|
|
||||||
|
cp -f $file_o $file
|
||||||
|
|
||||||
|
# got verison release
|
||||||
|
version=`cat $file |grep '^Version' | awk '{print $2}'`
|
||||||
|
release_oo=`cat $file |grep '^Release' | awk '{print $2}'`
|
||||||
|
release_o=`echo $release_oo | sed 's/%{.*}//'`
|
||||||
|
release=$((release_o+1))
|
||||||
|
release=1
|
||||||
|
|
||||||
|
#marcos_expand keep this bug ...
|
||||||
|
delete_comment
|
||||||
|
changelog_update
|
||||||
|
increase_release
|
||||||
|
header_align
|
||||||
|
headers_merge
|
||||||
|
insert_enter
|
||||||
|
delete_blank
|
||||||
|
|
||||||
|
#let's play
|
||||||
|
#read -p "Hint: exec vimdiff $file $file_o ? enter [yes/no]: " ans
|
||||||
|
#vimdiff $file $file_o
|
||||||
|
#read -p "Hint: do mv -b -f $file $file_o ? enter [yes/no]: " ans
|
||||||
|
#if [[ $ans =~ [Yy]([Ee][Ss])? ]];then
|
||||||
|
mv -b -f $file $file_o
|
||||||
|
echo "Hint: $file_o updated"
|
||||||
|
#else
|
||||||
|
# rm -f $file
|
||||||
|
# echo "Hint: $file deleted. Not my bad :P "
|
||||||
|
#fi
|
||||||
|
echo "From SONG: Enjoy your spec working !"
|
||||||
|
}
|
||||||
|
|
||||||
|
banner(){
|
||||||
|
cat <<eof
|
||||||
|
+-+-+-+-+-+-+-+-+-+
|
||||||
|
|s|p|e|c|_|p|r|e|p|
|
||||||
|
+-+-+-+-+-+-+-+-+-+
|
||||||
|
eof
|
||||||
|
}
|
||||||
|
if [[ $# != 1 ]];then
|
||||||
|
banner
|
||||||
|
echo "USAGE: $(basename $0) SPECFILE"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
|
banner
|
||||||
|
main $1
|
||||||
Loading…
x
Reference in New Issue
Block a user