From a500de03fdcdb3c074132d7d56eb937fa1f9f743 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Tue, 15 Apr 2014 15:58:39 +0200 Subject: [PATCH] Update to pg 0.17.1. --- .gitignore | 1 + ...ding-some-fixes-for-PostgreSQL-9.2.x.patch | 46 ------------------- rubygem-pg-0.17.1-remove-rpath.patch | 17 +++++++ rubygem-pg.spec | 41 +++++++++++------ sources | 2 +- 5 files changed, 46 insertions(+), 61 deletions(-) delete mode 100644 rubygem-pg-0.15.0.pre.432-Adding-some-fixes-for-PostgreSQL-9.2.x.patch create mode 100644 rubygem-pg-0.17.1-remove-rpath.patch diff --git a/.gitignore b/.gitignore index b79a5a3..7584a70 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ /pg-0.11.0.gem /pg-0.12.2.gem /pg-0.14.1.gem +/pg-0.17.1.gem diff --git a/rubygem-pg-0.15.0.pre.432-Adding-some-fixes-for-PostgreSQL-9.2.x.patch b/rubygem-pg-0.15.0.pre.432-Adding-some-fixes-for-PostgreSQL-9.2.x.patch deleted file mode 100644 index 42d6ed6..0000000 --- a/rubygem-pg-0.15.0.pre.432-Adding-some-fixes-for-PostgreSQL-9.2.x.patch +++ /dev/null @@ -1,46 +0,0 @@ -# HG changeset patch -# User Michael Granger -# Date 1351634653 25200 -# Node ID 10804d14d1e7ccf9b265cd08a6e28853a1a60c66 -# Parent 994bad887ae9a963ef4cedf47aaa470da6a9e825 -Adding some fixes for PostgreSQL 9.2.x - -diff -r 994bad887ae9a963ef4cedf47aaa470da6a9e825 -r 10804d14d1e7ccf9b265cd08a6e28853a1a60c66 spec/lib/helpers.rb ---- a/spec/lib/helpers.rb Tue Oct 30 15:03:28 2012 -0700 -+++ b/spec/lib/helpers.rb Tue Oct 30 15:04:13 2012 -0700 -@@ -243,7 +243,10 @@ - - config.filter_run_excluding :postgresql_90 unless - PG::Connection.instance_methods.map( &:to_sym ).include?( :escape_literal ) -- config.filter_run_excluding :postgresql_91 unless -- PG.respond_to?( :library_version ) -+ -+ unless PG.respond_to?( :library_version ) -+ config.filter_run_excluding( :postgresql_91 ) -+ config.filter_run_excluding( :postgresql_92 ) unless PG.library_version >= '90200' -+ end - end - -diff -r 994bad887ae9a963ef4cedf47aaa470da6a9e825 -r 10804d14d1e7ccf9b265cd08a6e28853a1a60c66 spec/pg/result_spec.rb ---- a/spec/pg/result_spec.rb Tue Oct 30 15:03:28 2012 -0700 -+++ b/spec/pg/result_spec.rb Tue Oct 30 15:04:13 2012 -0700 -@@ -71,7 +71,7 @@ - result.error_field( PG::PG_DIAG_INTERNAL_QUERY ).should be_nil() - result.error_field( PG::PG_DIAG_CONTEXT ).should be_nil() - result.error_field( PG::PG_DIAG_SOURCE_FILE ).should =~ /parse_relation\.c$/ -- result.error_field( PG::PG_DIAG_SOURCE_LINE ).should == '857' -+ result.error_field( PG::PG_DIAG_SOURCE_LINE ).should =~ /^\d+$/ - result.error_field( PG::PG_DIAG_SOURCE_FUNCTION ).should == 'parserOpenTable' - - end -@@ -127,8 +127,8 @@ - out_bytes.should == in_bytes - end - -- it "should return the parameter type of the specified prepared statement parameter" do -- query = 'SELECT * FROM pg_stat_activity WHERE user = $1::name AND current_query = $2::text' -+ it "should return the parameter type of the specified prepared statement parameter", :postgresql_92 do -+ query = 'SELECT * FROM pg_stat_activity WHERE user = $1::name AND query = $2::text' - @conn.prepare( 'queryfinder', query ) - res = @conn.describe_prepared( 'queryfinder' ) - diff --git a/rubygem-pg-0.17.1-remove-rpath.patch b/rubygem-pg-0.17.1-remove-rpath.patch new file mode 100644 index 0000000..d966be3 --- /dev/null +++ b/rubygem-pg-0.17.1-remove-rpath.patch @@ -0,0 +1,17 @@ +diff --git a/ext/extconf.rb b/ext/extconf.rb +--- a/ext/extconf.rb ++++ b/ext/extconf.rb +@@ -32,13 +32,6 @@ + incdir = `"#{pgconfig}" --includedir`.chomp + libdir = `"#{pgconfig}" --libdir`.chomp + dir_config 'pg', incdir, libdir +- +- # Try to use runtime path linker option, even if RbConfig doesn't know about it. +- # The rpath option is usually set implicit by dir_config(), but so far not +- # on MacOS-X. +- if RbConfig::CONFIG["RPATHFLAG"].to_s.empty? && try_link('int main() {return 0;}', " -Wl,-rpath,#{libdir}") +- $LDFLAGS << " -Wl,-rpath,#{libdir}" +- end + else + $stderr.puts "No pg_config... trying anyway. If building fails, please try again with", + " --with-pg-config=/path/to/pg_config" diff --git a/rubygem-pg.spec b/rubygem-pg.spec index df5d215..1613fc8 100644 --- a/rubygem-pg.spec +++ b/rubygem-pg.spec @@ -3,8 +3,8 @@ Summary: A Ruby interface to the PostgreSQL RDBMS Name: rubygem-%{gem_name} -Version: 0.14.1 -Release: 3%{?dist} +Version: 0.17.1 +Release: 1%{?dist} Group: Development/Languages # Upstream license clarification (https://bitbucket.org/ged/ruby-pg/issue/72/) # @@ -14,7 +14,9 @@ Group: Development/Languages License: (BSD or Ruby) and PostgreSQL URL: http://bitbucket.org/ged/ruby-pg/ Source0: http://rubygems.org/gems/%{gem_name}-%{version}.gem -Patch0: rubygem-pg-0.15.0.pre.432-Adding-some-fixes-for-PostgreSQL-9.2.x.patch +# Disable RPATH. +# https://bitbucket.org/ged/ruby-pg/issue/183 +Patch0: rubygem-pg-0.17.1-remove-rpath.patch BuildRequires: ruby(release) BuildRequires: ruby-devel BuildRequires: rubygems-devel @@ -40,14 +42,20 @@ Documentation for %{name} %prep -%setup -q -c -T -%gem_install -n %{SOURCE0} +gem unpack %{SOURCE0} +%setup -q -D -T -n %{gem_name}-%{version} + +gem spec %{SOURCE0} -l --ruby > %{gem_name}.gemspec -pushd .%{gem_instdir} %patch0 -p1 -popd %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} @@ -62,15 +70,19 @@ 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}/sample/check_conn.rb sed -i -e '/^#!\/usr\/bin\/env/d' %{buildroot}%{gem_instdir}/Rakefile.cross -sed -i -e '/^#!\/usr\/bin\/env/d' %{buildroot}%{gem_libdir}/pg.rb -sed -i -e '/^#!\/usr\/bin\/env/d' %{buildroot}%{gem_libdir}/pg/constants.rb -sed -i -e '/^#!\/usr\/bin\/env/d' %{buildroot}%{gem_libdir}/pg/result.rb -sed -i -e '/^#!\/usr\/bin\/env/d' %{buildroot}%{gem_libdir}/pg/exceptions.rb -sed -i -e '/^#!\/usr\/bin\/env/d' %{buildroot}%{gem_libdir}/pg/connection.rb +# 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 +# Fix shebangs and executable bits of samples. +for file in `find %{buildroot}%{gem_instdir}/sample -type f -name "*.rb"`; do + sed -i -e 's/^#!\/usr\/bin\/env spec/#!\/usr\/bin\/ruby/' $file \ + && chmod -v 755 $file +done # Fix spec shebangs. # https://bitbucket.org/ged/ruby-pg/issue/74/ @@ -113,8 +125,9 @@ popd %changelog -* Tue Apr 15 2014 Vít Ondruch - 0.14.1-3 +* Tue Apr 15 2014 Vít Ondruch - 0.17.1-1 - Rebuilt for https://fedoraproject.org/wiki/Changes/Ruby_2.1 +- Update to pg 0.17.1. * Sun Aug 04 2013 Fedora Release Engineering - 0.14.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild diff --git a/sources b/sources index 41363e7..9dc4679 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -1499fd3f3610e6e6b6a70296012b83ed pg-0.14.1.gem +0e81551ebe2d8504e99abcf29b243857 pg-0.17.1.gem