summaryrefslogtreecommitdiff
path: root/ruby-dbi.spec
blob: 452d487dfe5b0be90b601a268b2c762eb218b902 (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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
#
# Conditional build:
%bcond_without	rdoc		# build with rdoc
%bcond_with	ri		# build with ri
#
%define tarname dbi
Summary:	Database Interface for Ruby
Summary(pl):	Interfejs do baz danych dla jêzyka Ruby
Name:		ruby-DBI
Version:	0.1.1
Release:	1
License:	GPL
Group:		Development/Languages
Source0:	http://rubyforge.org/frs/download.php/12368/%{tarname}-%{version}.tar.gz
# Source0-md5:	1077f898080bb0af1098ee4b5b54f8d1
Patch0:		%{name}-prefix.patch
BuildRequires:	mysql-ruby
BuildRequires:	rpmbuild(macros) >= 1.277
BuildRequires:	ruby-devel >= 1:1.8.4-5
BuildRequires:	ruby-Postgres
BuildRequires:	ruby-odbc
BuildRequires:	sqlite-devel
Obsoletes:	ruby-dbi
%{?ruby_mod_ver_requires_eq}
BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)

%description
DBI Module for Ruby.

%description -l pl
Modu³ DBI dla Ruby.

%package -n ruby-DBD-Mysql
Summary:	MySQL Database Driver for Ruby
Summary(pl):	Sterownik bazy danych MySQL dla jêzyka Ruby
Group:		Development/Languages
Requires:	%{name} = %{version}-%{release}
Requires:	ruby-mysql-library

%description -n ruby-DBD-Mysql
MySQL Database Driver for Ruby.

%description -n ruby-DBD-Mysql -l pl
Sterownik bazy danych MySQL dla jêzyka Ruby.

%package -n ruby-DBD-ODBC
Summary:	ODBC Database Driver for Ruby
Summary(pl):	Sterownik bazy danych ODBC dla jêzyka Ruby
Group:		Development/Languages
Requires:	%{name} = %{version}-%{release}
Requires:	ruby-odbc

%description -n ruby-DBD-ODBC
ODBC Database Driver for Ruby.

%description -n ruby-DBD-ODBC -l pl
Sterownik bazy danych ODBC dla jêzyka Ruby.

%package -n ruby-DBD-Pg
Summary:	PostgreSQL Database Driver for Ruby
Summary(pl):	Sterownik bazy danych PostgreSQL dla jêzyka Ruby
Group:		Development/Languages
Requires:	%{name} = %{version}-%{release}
Requires:	ruby-Postgres

%description -n ruby-DBD-Pg
PostgreSQL Database Driver for Ruby.

%description -n ruby-DBD-Pg -l pl
Sterownik bazy danych PostgreSQL dla jêzyka Ruby.

%package -n ruby-DBD-SQLite
Summary:	SQLite Database Driver for Ruby
Summary(pl):	Sterownik bazy danych SQLite dla jêzyka Ruby
Group:		Development/Languages
Requires:	%{name} = %{version}-%{release}

%description -n ruby-DBD-SQLite
SQLite Database Driver for Ruby.

%description -n ruby-DBD-SQLite -l pl
Sterownik bazy danych SQLite dla jêzyka Ruby.

%prep
%setup -q -n ruby-dbi
%patch0 -p1

#find lib -type d -name 'test*' | xargs rm -r -v

%build
# dbd_sybase requires TDS API update
ruby setup.rb config \
	--with=dbi,dbd_mysql,dbd_proxy,dbd_pg,dbd_sqlite,dbd_sqlrelay,dbd_odbc \
	--prefix=$RPM_BUILD_ROOT \
	--rb-dir=%{ruby_rubylibdir} \
	--so-dir=%{ruby_archdir}

ruby setup.rb setup

%if %{with rdoc}
rdoc -o rdoc lib ext
%endif
%if %{with ri}
rdoc --ri --op ri lib ext
%endif

%install
rm -rf $RPM_BUILD_ROOT
install -d $RPM_BUILD_ROOT{%{ruby_archdir},%{ruby_ridir},%{_examplesdir}/%{name}-%{version}}
ruby setup.rb install

%if %{with ri}
cp -a ri/ri/* $RPM_BUILD_ROOT%{ruby_ridir}
%endif
cp -a examples/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(644,root,root,755)
%doc README* 
%if %{with rdoc}
%doc rdoc
%endif
%attr(755,root,root) %{_bindir}/proxyserver.rb
%attr(755,root,root) %{_bindir}/sqlsh.rb
%dir %{ruby_rubylibdir}/DBD
%dir %{ruby_archdir}/DBD
%{ruby_rubylibdir}/DBD/Proxy
%{ruby_rubylibdir}/DBD/SQLRelay
%{ruby_rubylibdir}/dbi.rb
%{ruby_rubylibdir}/dbi
%if %{with ri}
%{ruby_ridir}/DBI
%{ruby_ridir}/ColumnInfo
#%{ruby_ridir}/OCIError/cdesc-OCIError.yaml
%endif
%{_examplesdir}/%{name}-%{version}

%files -n ruby-DBD-Mysql
%defattr(644,root,root,755)
%{ruby_rubylibdir}/DBD/Mysql

%files -n ruby-DBD-ODBC
%defattr(644,root,root,755)
%{ruby_rubylibdir}/DBD/ODBC

%files -n ruby-DBD-Pg
%defattr(644,root,root,755)
%{ruby_rubylibdir}/DBD/Pg

%files -n ruby-DBD-SQLite
%defattr(644,root,root,755)
%dir %{ruby_archdir}/DBD/SQLite
%attr(755,root,root) %{ruby_archdir}/DBD/SQLite/SQLite.so