2022-03-03 14:59:06 +08:00
|
|
|
# Generated from pg-0.11.0.gem by gem2rpm -*- rpm-spec -*-
|
|
|
|
|
%global gem_name pg
|
|
|
|
|
|
|
|
|
|
Name: rubygem-%{gem_name}
|
2023-08-10 10:31:12 +08:00
|
|
|
Version: 1.4.5
|
2025-02-28 21:49:08 +08:00
|
|
|
Release: 2
|
2022-03-03 14:59:06 +08:00
|
|
|
Summary: A Ruby interface to the PostgreSQL RDBMS
|
|
|
|
|
License: (BSD or Ruby) and PostgreSQL
|
|
|
|
|
URL: https://github.com/ged/ruby-pg
|
|
|
|
|
Source0: https://rubygems.org/gems/%{gem_name}-%{version}.gem
|
2023-08-10 10:31:12 +08:00
|
|
|
# git clone --no-checkout https://github.com/ged/ruby-pg.git
|
|
|
|
|
# git -C ruby-pg archive -v -o pg-1.4.5-spec.tar.gz v1.4.5 spec/
|
|
|
|
|
Source1: %{gem_name}-%{version}-spec.tar.gz
|
2022-03-03 14:59:06 +08:00
|
|
|
# Disable RPATH.
|
2023-08-10 10:31:12 +08:00
|
|
|
# https://github.com/ged/ruby-pg/issues/183
|
|
|
|
|
Patch0: rubygem-pg-1.3.0-remove-rpath.patch
|
2025-02-28 21:49:08 +08:00
|
|
|
# https://github.com/ged/ruby-pg/commit/dd138ecf313274cc6a5481071bf301dc8c5139d8
|
|
|
|
|
Patch1: backport-Use-a-connection-encoding-compatible-to-Mohre.patch
|
2023-08-10 10:31:12 +08:00
|
|
|
# ext/pg_text_decoder.c
|
2022-03-03 14:59:06 +08:00
|
|
|
Requires: rubygem(bigdecimal)
|
2023-08-10 10:31:12 +08:00
|
|
|
# lib/pg/text_{de,en}coder.rb
|
|
|
|
|
Requires: rubygem(json)
|
2022-03-03 14:59:06 +08:00
|
|
|
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.
|
2023-08-10 10:31:12 +08:00
|
|
|
This library works with PostgreSQL 9.3 and later.
|
2022-03-03 14:59:06 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
%package doc
|
|
|
|
|
Summary: Documentation for %{name}
|
|
|
|
|
Requires: %{name} = %{version}-%{release}
|
|
|
|
|
BuildArch: noarch
|
|
|
|
|
|
|
|
|
|
%description doc
|
|
|
|
|
Documentation for %{name}.
|
|
|
|
|
|
|
|
|
|
%prep
|
2023-08-10 10:31:12 +08:00
|
|
|
%setup -q -n %{gem_name}-%{version} -b 1
|
2022-03-03 14:59:06 +08:00
|
|
|
|
2025-02-28 21:49:08 +08:00
|
|
|
%patch -P0 -p1
|
|
|
|
|
|
|
|
|
|
pushd %{_builddir}
|
|
|
|
|
%patch -P1 -p1
|
|
|
|
|
popd
|
2022-03-03 14:59:06 +08:00
|
|
|
|
|
|
|
|
%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/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
pushd .%{gem_instdir}
|
2023-08-10 10:31:12 +08:00
|
|
|
ln -s %{_builddir}/spec .
|
|
|
|
|
|
2022-03-03 14:59:06 +08:00
|
|
|
# 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}
|
2023-08-10 10:31:12 +08:00
|
|
|
%exclude %{gem_instdir}/.*
|
2022-03-03 14:59:06 +08:00
|
|
|
%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}/Contributors.rdoc
|
2023-08-10 10:31:12 +08:00
|
|
|
%{gem_instdir}/Gemfile
|
2022-03-03 14:59:06 +08:00
|
|
|
%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*
|
2023-08-10 10:31:12 +08:00
|
|
|
%{gem_instdir}/rakelib/*
|
|
|
|
|
%{gem_instdir}/certs
|
|
|
|
|
%{gem_instdir}/misc
|
|
|
|
|
%{gem_instdir}/pg.gemspec
|
|
|
|
|
%{gem_instdir}/sample
|
2022-03-03 14:59:06 +08:00
|
|
|
|
|
|
|
|
%changelog
|
2025-02-28 21:49:08 +08:00
|
|
|
* Fri Feb 28 2025 Funda Wang <fundawang@yeah.net> - 1.4.5-2
|
|
|
|
|
- fix build with latest postgresql
|
|
|
|
|
|
2023-08-10 10:31:12 +08:00
|
|
|
* Thu Aug 10 2023 wubijie <wubijie@kylinos.cn> - 1.4.5-1
|
|
|
|
|
- Upgrade to version 1.4.5
|
|
|
|
|
|
2022-03-03 14:59:06 +08:00
|
|
|
* Thu Mar 3 2022 caodongxia<caodongxia@huawei.com> - 1.2.3-1
|
|
|
|
|
- Init package
|