summaryrefslogtreecommitdiffstats
path: root/postgresql92/rubygem-pg.spec.nodsc
blob: 22ac9fec31b0ddae461d83a8ed54be508ec53641 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
# Generated from pg-0.11.0.gem by gem2rpm -*- rpm-spec -*-
%global gemdir %(ruby -rubygems -e 'puts Gem::dir' 2>/dev/null)
%global gemname pg
%global geminstdir %{gemdir}/gems/%{gemname}-%{version}
%{!?ruby_sitearch: %global ruby_sitearch %(ruby -rrbconfig -e 'puts Config::CONFIG["sitearchdir"]')}
%global rubyabi 1.8

Summary: A Ruby interface to the PostgreSQL RDBMS
Name: rubygem-%{gemname}
Version: 0.12.2
Release: 2%{?dist}
Group: Development/Languages
# 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: (GPLv2 or Ruby) and BSD
URL: http://bitbucket.org/ged/ruby-pg/
Source0: http://rubygems.org/gems/%{gemname}-%{version}.gem
Requires: ruby(abi) = %{rubyabi}
Requires: rubygems
Requires: ruby
BuildRequires: ruby(abi) = %{rubyabi}
BuildRequires: rubygems
BuildRequires: ruby ruby-devel
BuildRequires: postgresql-server postgresql-devel
# EPEL does not have RSpec 2.x :/
%if 0%{?fedora}
# Keep requiring rspec-core as long as rubygem(rspec) is provided by RSpec 1.x
BuildRequires: rubygem(rspec-core)
%endif
Provides: rubygem(%{gemname}) = %{version}

%description
This is the extension library to access a PostgreSQL database from Ruby.
This library works with PostgreSQL 7.4 and later.


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

%description doc
Documentation for %{name}


%prep
%setup -q -c -T
mkdir -p .%{gemdir}
export CONFIGURE_ARGS="--with-cflags='%{optflags}'"
gem install --local --install-dir .%{gemdir} \
            -V --force %{SOURCE0}

%build

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

install -d -m0755 %{buildroot}%{ruby_sitearch}
mv %{buildroot}%{geminstdir}/lib/pg_ext.so %{buildroot}%{ruby_sitearch}/

# Remove the binary extension sources and build leftovers.
rm -rf %{buildroot}%{geminstdir}/ext

# Remove useless shebangs.
sed -i -e '/^#!\/usr\/bin\/env/d' %{buildroot}%{geminstdir}/lib/pg.rb
sed -i -e '/^#!rake/d' %{buildroot}%{geminstdir}/Rakefile
sed -i -e '/^#!rake/d' %{buildroot}%{geminstdir}/Rakefile.cross

# Fix spec shebangs.
# https://bitbucket.org/ged/ruby-pg/issue/74/
for file in `find %{buildroot}%{geminstdir}/spec -type f ! -perm /a+x -name "*.rb"`; do
    [ ! -z "`head -n 1 $file | grep \"^#!/\"`" ] \
        && sed -i -e 's/^#!\/usr\/bin\/env spec/#!\/usr\/bin\/env rspec/' $file \
        && chmod -v 755 $file
done

%if 0%{?fedora}
%check
pushd .%{geminstdir}
rspec spec
popd
%endif

%files
%exclude %{geminstdir}/.gemtest
%{ruby_sitearch}/pg_ext.so
%dir %{geminstdir}
%doc %{geminstdir}/BSD
%doc %{geminstdir}/GPL
%doc %{geminstdir}/LICENSE
%{geminstdir}/lib
%{gemdir}/cache/%{gemname}-%{version}.gem
%{gemdir}/specifications/%{gemname}-%{version}.gemspec

%files doc
%doc %{gemdir}/doc/%{gemname}-%{version}
%doc %{geminstdir}/ChangeLog
%doc %{geminstdir}/Contributors.rdoc
%doc %{geminstdir}/History.rdoc
%doc %{geminstdir}/Manifest.txt
%{geminstdir}/Rakefile
%{geminstdir}/Rakefile.cross
%doc %{geminstdir}/README.rdoc
%doc %{geminstdir}/README.ja.rdoc
%doc %{geminstdir}/README.OS_X.rdoc
%doc %{geminstdir}/README.windows.rdoc
%{geminstdir}/misc
%{geminstdir}/sample
%{geminstdir}/spec


%changelog
* Tue Apr 24 2012 Vít Ondruch <vondruch@redhat.com> - 0.12.2-2
- Fix provides macro.

* Tue Apr 03 2012 Vít Ondruch <vondruch@redhat.com> - 0.12.2-1
- Upgrade to pg 0.12.2.

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.11.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Fri Jun 03 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-5
- Pass CFLAGS to extconf.rb.

* Fri Jun 03 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-4
- Binary extension moved into ruby_sitearch dir.
- -doc subpackage made architecture independent.

* Wed Jun 01 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-3
- Quoted upstream license clarification.

* Mon May 30 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-2
- Removed/fixed shebang in non-executables.
- Removed sources.

* Thu May 26 2011 Vít Ondruch <vondruch@redhat.com> - 0.11.0-1
- Initial package