LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File unicorn.spec of Package rubygem-unicorn (Project home:javagg)

%if 0%{?fedora}%{?rhel} <= 6
  %global scl ruby193
  %global scl_prefix ruby193-
%endif
%{!?scl:%global pkg_name %{name}}
%{?scl:%scl_package rubygem-%{gem_name}}

%global gem_name unicorn
%global rubyabi 1.9.1

Summary: Rack HTTP server for fast clients and Unix
Name: %{?scl:%scl_prefix}rubygem-%{gem_name}
Version: 4.7.0
Release: 1%{?dist}
Group: Development/Languages
License: GPLv2+ and Ruby 1.8
URL: http://unicorn.bogomips.org/
Source0: http://ruby.taobao.orggems/%{gem_name}-%{version}.gem
%if 0%{?fedora} >= 19
Requires: ruby(release)
%else
Requires: %{?scl:%scl_prefix}ruby(abi) >= %{rubyabi}
%endif
Requires: %{?scl:%scl_prefix}ruby(rubygems) 
Requires: %{?scl:%scl_prefix}rubygem(rack) 
Requires: %{?scl:%scl_prefix}rubygem(kgio) => 2.6
Requires: %{?scl:%scl_prefix}rubygem(kgio) < 3
Requires: %{?scl:%scl_prefix}rubygem(raindrops) => 0.7
Requires: %{?scl:%scl_prefix}rubygem(raindrops) < 1
%if 0%{?fedora}%{?rhel} <= 6
BuildRequires: %{?scl:%scl_prefix}build
BuildRequires: scl-utils-build
%endif
%if 0%{?fedora} >= 19
BuildRequires: ruby(release)
BuildRequires: rubypick
%else
BuildRequires: %{?scl:%scl_prefix}ruby(abi) >= %{rubyabi}
%endif
BuildRequires: %{?scl:%scl_prefix}rubygems-devel 
BuildRequires: %{?scl:%scl_prefix}ruby-devel 
Provides: %{?scl:%scl_prefix}rubygem(%{gem_name}) = %{version}

%description
\Unicorn is an HTTP server for Rack applications designed to only serve
fast clients on low-latency, high-bandwidth connections and take
advantage of features in Unix/Unix-like kernels.  Slow clients should
only be served by placing a reverse proxy capable of fully buffering
both the the request and response in between \Unicorn and slow clients.


%package doc
Summary: Documentation for %{name}
Group: Documentation
Requires: %{name} = %{version}-%{release}
BuildArch: noarch

%description doc
Documentation for %{name}

%prep
%{?scl:scl enable %scl "}
gem unpack %{SOURCE0}
%setup -q -D -T -n  %{gem_name}-%{version}
gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec
%{?scl:"}

%build
%{?scl:scl enable %scl - << \EOF}
gem build %{gem_name}.gemspec
%if 0%{?fedora} >= 19
%gem_install
%else
export CONFIGURE_ARGS="--with-cflags='%{optflags}' $CONFIGURE_ARGS"
gem install -V \
        --local \
        --install-dir ./%{gem_dir}\
        --bindir ./%{_bindir} \
        --force \
        --rdoc \
        --ri \
        --backtrace \
        %{gem_name}-%{version}.gem 
%endif
%{?scl:EOF}

%clean
rm -rf %{buildroot}

%install
mkdir -p %{buildroot}%{gem_dir}
cp -a .%{gem_dir}/* %{buildroot}%{gem_dir}/

mkdir -p %{buildroot}%{gem_extdir_mri}/lib
mv %{buildroot}%{gem_instdir}/lib/unicorn_http.so %{buildroot}%{gem_extdir_mri}/lib/

mkdir -p %{buildroot}%{_bindir}
cp -a .%{_bindir}/* %{buildroot}%{_bindir}/
find %{buildroot}%{gem_instdir}/bin -type f | xargs chmod a+x

sed -i -e '1s/^#!.*$/#!\/usr\/bin\/env ruby/' %{buildroot}%{gem_instdir}/bin/unicorn
sed -i -e '1s/^#!.*$/#!\/usr\/bin\/env ruby/' %{buildroot}%{gem_instdir}/bin/unicorn_rails

# Remove build leftovers.
rm -rf %{buildroot}%{gem_instdir}/.yard*

%files
%dir %{gem_instdir}
%doc %{gem_instdir}/COPYING
%doc %{gem_instdir}/Documentation
%doc %{gem_instdir}/man

%{gem_instdir}/%{gem_name}.gemspec
%exclude %{gem_instdir}/.*

%{_bindir}/unicorn
%{_bindir}/unicorn_rails
%{gem_instdir}/bin
%{gem_libdir}
%exclude %{gem_instdir}/ext
%{gem_extdir_mri}
%exclude %{gem_cache}
%{gem_spec}
%{gem_instdir}/examples
%{gem_instdir}/GNUmakefile
%{gem_instdir}/script
%{gem_instdir}/setup.rb
%{gem_instdir}/t
%{gem_instdir}/local.mk.sample

%files doc
%doc %{gem_docdir}
%{gem_instdir}/test
%{gem_instdir}/Rakefile
%doc %{gem_instdir}/GIT-VERSION-FILE
%doc %{gem_instdir}/GIT-VERSION-GEN
%doc %{gem_instdir}/FAQ
%doc %{gem_instdir}/README
%doc %{gem_instdir}/TUNING
%doc %{gem_instdir}/PHILOSOPHY
%doc %{gem_instdir}/HACKING
%doc %{gem_instdir}/DESIGN
%doc %{gem_instdir}/CONTRIBUTORS
%doc %{gem_instdir}/LICENSE
%doc %{gem_instdir}/SIGNALS
%doc %{gem_instdir}/KNOWN_ISSUES
%doc %{gem_instdir}/TODO
%doc %{gem_instdir}/NEWS
%doc %{gem_instdir}/ChangeLog
%doc %{gem_instdir}/LATEST
%doc %{gem_instdir}/ISSUES
%doc %{gem_instdir}/Sandbox
%doc %{gem_instdir}/Links
%doc %{gem_instdir}/Application_Timeouts

%changelog
* Thu Oct 17 2013 Alex Lee <lu.lee05@gmail.com> - 4.7.0-1
- Initial package