# Generated from pg-0.11.0.gem by gem2rpm -*- rpm-spec -*- %global gem_name pg Name: rubygem-%{gem_name} Version: 1.2.3 Release: 1 Summary: A Ruby interface to the PostgreSQL RDBMS # Upstream license clarification (https://bitbucket.org/ged/ruby-pg/issue/72/) # # The portions of the code that are BSD-licensed are licensed under # the BSD 3-Clause license; the contents of the BSD file are incorrect. # License: (BSD or Ruby) and PostgreSQL URL: https://github.com/ged/ruby-pg Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem # Disable RPATH. # https://bitbucket.org/ged/ruby-pg/issue/183 Patch0: rubygem-pg-0.17.1-remove-rpath.patch # Required in ext/pg_text_decoder.c Requires: rubygem(bigdecimal) BuildRequires: ruby(release) BuildRequires: rubygems-devel BuildRequires: ruby-devel # Compiler is required for build of gem binary extension. # https://fedoraproject.org/wiki/Packaging:C_and_C++#BuildRequires_and_Requires BuildRequires: gcc BuildRequires: postgresql-server libpq-devel BuildRequires: rubygem(bigdecimal) BuildRequires: rubygem(rspec) %description This is the extension library to access a PostgreSQL database from Ruby. This library works with PostgreSQL 9.1 and later. %package doc Summary: Documentation for %{name} Requires: %{name} = %{version}-%{release} BuildArch: noarch %description doc Documentation for %{name}. %prep %setup -q -n %{gem_name}-%{version} %patch0 -p1 %build # Create the gem as gem install only works on a gem file gem build ../%{gem_name}-%{version}.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 -a .%{gem_dir}/* \ %{buildroot}%{gem_dir}/ mkdir -p %{buildroot}%{gem_extdir_mri} cp -a .%{gem_extdir_mri}/{gem.build_complete,*.so} %{buildroot}%{gem_extdir_mri}/ # Prevent dangling symlink in -debuginfo (rhbz#878863). rm -rf %{buildroot}%{gem_instdir}/ext/ # Remove useless shebangs. sed -i -e '/^#!\/usr\/bin\/env/d' %{buildroot}%{gem_instdir}/Rakefile sed -i -e '/^#!\/usr\/bin\/env/d' %{buildroot}%{gem_instdir}/Rakefile.cross # Files under %%{gem_libdir} are not executable. for file in `find %{buildroot}%{gem_libdir} -type f -name "*.rb"`; do sed -i '/^#!\/usr\/bin\/env/ d' $file \ && chmod -v 644 $file done %check pushd .%{gem_instdir} # Set --verbose to show detail log by $VERBOSE. # See https://github.com/ged/ruby-pg/blob/master/spec/helpers.rb $VERBOSE # Assign a random port to consider a case of multi builds in parallel in a host. # https://github.com/ged/ruby-pg/pull/39 if ! PGPORT="$((54321 + ${RANDOM} % 1000))" ruby -S --verbose \ rspec -I$(dirs +1)%{gem_extdir_mri} -f d spec; then echo "==== [setup.log start ] ====" cat tmp_test_specs/setup.log echo "==== [setup.log end ] ====" false fi popd %files %dir %{gem_instdir} %{gem_extdir_mri} %exclude %{gem_instdir}/.gemtest %license %{gem_instdir}/BSDL %license %{gem_instdir}/POSTGRES %license %{gem_instdir}/LICENSE %{gem_libdir} %exclude %{gem_cache} %{gem_spec} %files doc %doc %{gem_docdir} %doc %{gem_instdir}/ChangeLog %doc %{gem_instdir}/Contributors.rdoc %doc %{gem_instdir}/History.rdoc %doc %{gem_instdir}/Manifest.txt %doc %{gem_instdir}/README-OS_X.rdoc %doc %{gem_instdir}/README-Windows.rdoc %doc %{gem_instdir}/README.ja.rdoc %doc %{gem_instdir}/README.rdoc %{gem_instdir}/Rakefile* %{gem_instdir}/spec %changelog * Thu Mar 3 2022 caodongxia - 1.2.3-1 - Init package