# Generated from mysql2-0.3.12b6.gem by gem2rpm -*- rpm-spec -*- %bcond_with rspec %global gem_name mysql2 Name: rubygem-%{gem_name} Version: 0.3.12b6 Release: 1%{?dist} Summary: A simple, fast Mysql library for Ruby, binding to libmysql Group: Development/Languages License: MIT URL: http://github.com/brianmario/mysql2 Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem Requires: ruby(release) Requires: ruby(rubygems) > 1.3.1 BuildRequires: ruby(release) BuildRequires: rubygems-devel > 1.3.1 BuildRequires: ruby-devel BuildRequires: rubygem(rspec) Provides: rubygem(%{gem_name}) = %{version} %description %package doc Summary: Documentation for %{name} Group: Documentation Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc Documentation for %{name} %prep gem unpack %{SOURCE0} %setup -q -D -T -n %{gem_name}-%{version} gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec %build # Create the gem as gem install only works on a gem file gem build %{gem_name}.gemspec # %%gem_install compiles any C extensions and installs the gem into ./%gem_dir # by default, so that we can move it into the buildroot in %%install %gem_install %install mkdir -p %{buildroot}%{gem_dir} cp -pa .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ mkdir -p %{buildroot}%{gem_extdir_mri}/lib mv %{buildroot}%{gem_instdir}/lib/mysql2/mysql2.so %{buildroot}%{gem_extdir_mri}/lib/ %if %{with rspec} %check pushd .%{gem_instdir} # Edit these details to match your database settings echo "root: host: localhost username: root password: database: test user: host: localhost username: admin password: admin database: mysql2_test" > spec/configuration.yml #rspec -Ilib spec rspec -Ilib spec popd %endif %files %dir %{gem_instdir} %{gem_libdir} %exclude %{gem_instdir}/ext %{gem_extdir_mri} %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_docdir} %{gem_instdir}/CHANGELOG.md %{gem_instdir}/MIT-LICENSE %{gem_instdir}/README.md %{gem_instdir}/examples %{gem_instdir}/spec %{gem_instdir}/support %changelog * Thu May 02 2013 Anuj More - 0.3.12b6-1 - Initial package