2 |
%define rubyver 1.8.7 |
%define rubyver 1.8.7 |
3 |
%define patchversion p357 |
%define patchversion p357 |
4 |
%define rel 1 |
%define rel 1 |
5 |
|
%define subrel 1 |
6 |
|
|
7 |
Summary: Object Oriented Script Language |
Summary: Object Oriented Script Language |
8 |
Name: ruby |
Name: ruby |
23 |
Provides: ruby-rexml |
Provides: ruby-rexml |
24 |
# explicit file provides (since such requires are automatically added by find-requires) |
# explicit file provides (since such requires are automatically added by find-requires) |
25 |
Provides: /usr/bin/ruby |
Provides: /usr/bin/ruby |
26 |
Provides: ruby(abi) = %subver |
Provides: ruby(abi) = %{subver} |
27 |
|
|
28 |
Source0: ftp://ftp.ruby-lang.org/pub/ruby/%{subver}/ruby-%{rubyver}-%{patchversion}.tar.bz2 |
Source0: ftp://ftp.ruby-lang.org/pub/ruby/%{subver}/ruby-%{rubyver}-%{patchversion}.tar.bz2 |
29 |
Source1: http://www.rubycentral.com/faq/rubyfaqall.html.bz2 |
Source1: http://www.rubycentral.com/faq/rubyfaqall.html.bz2 |
34 |
Patch2: ruby-add-old-os-to-search-path.patch |
Patch2: ruby-add-old-os-to-search-path.patch |
35 |
Patch3: ruby-do_not_propagate_no-undefined.patch |
Patch3: ruby-do_not_propagate_no-undefined.patch |
36 |
Patch4: 110703_CVE-2011-0188.patch |
Patch4: 110703_CVE-2011-0188.patch |
37 |
|
Patch5: ruby-1.8.7-p358-CVE-2012-4466-CVE-2012-4481.patch |
38 |
URL: http://www.ruby-lang.org/ |
URL: http://www.ruby-lang.org/ |
|
Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root |
|
39 |
|
|
40 |
%define my_target_cpu %{_target_cpu} |
%define my_target_cpu %{_target_cpu} |
41 |
%ifarch ppc |
%ifarch ppc |
106 |
%patch2 -p2 -b .old |
%patch2 -p2 -b .old |
107 |
%patch3 -p2 -b .undefined |
%patch3 -p2 -b .undefined |
108 |
%patch4 -p1 -b .CVE-2011-0188 |
%patch4 -p1 -b .CVE-2011-0188 |
109 |
|
%patch5 -p1 -b .CVE-2012-4466-CVE-2012-4481 |
110 |
|
|
111 |
autoreconf |
autoreconf |
112 |
|
|
119 |
rm -f libdummy.so.0 |
rm -f libdummy.so.0 |
120 |
} |
} |
121 |
|
|
122 |
CFLAGS=`echo %optflags | sed 's/-fomit-frame-pointer//'` |
CFLAGS=`echo %{optflags} | sed 's/-fomit-frame-pointer//'` |
123 |
%configure2_5x --enable-shared --disable-rpath --enable-pthread \ |
%configure2_5x --enable-shared --disable-rpath --enable-pthread \ |
124 |
--with-sitedir=%_prefix/lib/ruby/site_ruby \ |
--with-sitedir=%{_prefix}/lib/ruby/site_ruby \ |
125 |
--with-vendordir=%_prefix/lib/ruby/vendor_ruby \ |
--with-vendordir=%{_prefix}/lib/ruby/vendor_ruby \ |
126 |
--with-old-os=linux-gnu |
--with-old-os=linux-gnu |
127 |
|
|
128 |
%make |
%make |
129 |
|
|
130 |
|
|
131 |
%install |
%install |
132 |
rm -rf %buildroot |
rm -rf %{buildroot} |
133 |
%makeinstall_std install-doc |
%makeinstall_std install-doc |
134 |
|
|
135 |
install -d %buildroot%{_docdir}/%{name}-%{version} |
install -d %{buildroot}%{_docdir}/%{name}-%{version} |
136 |
cp -a COPYING* ChangeLog README* ToDo sample %buildroot%{_docdir}/%{name}-%{version} |
cp -a COPYING* ChangeLog README* ToDo sample %{buildroot}%{_docdir}/%{name}-%{version} |
137 |
bzcat %{SOURCE1} > %buildroot%{_docdir}/%{name}-%{version}/FAQ.html |
bzcat %{SOURCE1} > %{buildroot}%{_docdir}/%{name}-%{version}/FAQ.html |
138 |
|
|
139 |
install -d %buildroot%{_datadir}/emacs/site-lisp |
install -d %{buildroot}%{_datadir}/emacs/site-lisp |
140 |
cp -a misc/ruby-mode.el %buildroot%{_datadir}/emacs/site-lisp |
cp -a misc/ruby-mode.el %{buildroot}%{_datadir}/emacs/site-lisp |
141 |
|
|
142 |
install -d %buildroot%{_sysconfdir}/emacs/site-start.d |
install -d %{buildroot}%{_sysconfdir}/emacs/site-start.d |
143 |
cat <<EOF >%buildroot%{_sysconfdir}/emacs/site-start.d/%{name}.el |
cat <<EOF >%{buildroot}%{_sysconfdir}/emacs/site-start.d/%{name}.el |
144 |
(autoload 'ruby-mode "ruby-mode" "Ruby editing mode." t) |
(autoload 'ruby-mode "ruby-mode" "Ruby editing mode." t) |
145 |
(add-to-list 'auto-mode-alist '("\\\\.rb$" . ruby-mode)) |
(add-to-list 'auto-mode-alist '("\\\\.rb$" . ruby-mode)) |
146 |
(add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode)) |
(add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode)) |
147 |
EOF |
EOF |
148 |
|
|
149 |
(cd %buildroot%{_docdir}/%{name}-%{version} ; tar xfj %{SOURCE2} ; cd Pro*; mv -f html/* . ; rm -rf html xml) |
(cd %{buildroot}%{_docdir}/%{name}-%{version} ; tar xfj %{SOURCE2} ; cd Pro*; mv -f html/* . ; rm -rf html xml) |
150 |
|
|
151 |
# Make the file/dirs list, filtering out tcl/tk and devel files |
# Make the file/dirs list, filtering out tcl/tk and devel files |
152 |
( cd %buildroot \ |
( cd %{buildroot} \ |
153 |
&& find usr/lib/ruby/%{subver} \ |
&& find usr/lib/ruby/%{subver} \ |
154 |
\( -not -type d -printf "/%%p\n" \) \ |
\( -not -type d -printf "/%%p\n" \) \ |
155 |
-or \( -type d -printf "%%%%dir /%%p\n" \) \ |
-or \( -type d -printf "%%%%dir /%%p\n" \) \ |
156 |
) | egrep -v '/(tcl)?tk|(%{my_target_cpu}-%{_target_os}%{abi}/.*[ha]$)' > %{name}.list |
) | egrep -v '/(tcl)?tk|(%{my_target_cpu}-%{_target_os}%{abi}/.*[ha]$)' > %{name}.list |
157 |
|
|
158 |
# Fix scripts permissions and location |
# Fix scripts permissions and location |
159 |
find %buildroot sample -type f | file -i -f - | grep text | cut -d: -f1 >text.list |
find %{buildroot} sample -type f | file -i -f - | grep text | cut -d: -f1 >text.list |
160 |
cat text.list | xargs chmod 0644 |
cat text.list | xargs chmod 0644 |
161 |
# Magic grepping to get only files with '#!' in the first line |
# Magic grepping to get only files with '#!' in the first line |
162 |
cat text.list | xargs grep -n '^#!' | grep ':1:#!' | cut -d: -f1 >shebang.list |
cat text.list | xargs grep -n '^#!' | grep ':1:#!' | cut -d: -f1 >shebang.list |
165 |
|
|
166 |
|
|
167 |
# Install the rpm macros |
# Install the rpm macros |
168 |
mkdir -p %buildroot%{_sysconfdir}/rpm/macros.d |
mkdir -p %{buildroot}%{_sysconfdir}/rpm/macros.d |
169 |
cp %{SOURCE3} %buildroot%{_sysconfdir}/rpm/macros.d |
cp %{SOURCE3} %{buildroot}%{_sysconfdir}/rpm/macros.d |
170 |
%check |
%check |
171 |
make test |
make test |
172 |
|
|
173 |
%clean |
%clean |
174 |
rm -rf %buildroot |
rm -rf %{buildroot} |
175 |
|
|
176 |
%files -f %{name}.list |
%files -f %{name}.list |
|
%defattr(-, root, root) |
|
177 |
%dir %{_docdir}/%{name}-%{version} |
%dir %{_docdir}/%{name}-%{version} |
178 |
%{_docdir}/%{name}-%{version}/README |
%{_docdir}/%{name}-%{version}/README |
179 |
%{_bindir}/* |
%{_bindir}/* |
186 |
%{_sysconfdir}/rpm/macros.d/%{name}.macros |
%{_sysconfdir}/rpm/macros.d/%{name}.macros |
187 |
|
|
188 |
%files doc |
%files doc |
|
%defattr(-, root, root) |
|
189 |
%{_datadir}/ri |
%{_datadir}/ri |
190 |
%dir %{_docdir}/%{name}-%{version} |
%dir %{_docdir}/%{name}-%{version} |
191 |
%{_docdir}/%{name}-%{version}/COPYING* |
%{_docdir}/%{name}-%{version}/COPYING* |
197 |
%{_docdir}/%{name}-%{version}/ProgrammingRuby* |
%{_docdir}/%{name}-%{version}/ProgrammingRuby* |
198 |
|
|
199 |
%files devel |
%files devel |
|
%defattr(-, root, root) |
|
200 |
%{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/*.[ah] |
%{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/*.[ah] |
201 |
%{_libdir}/libruby-static.a |
%{_libdir}/libruby-static.a |
202 |
%{_libdir}/libruby.so |
%{_libdir}/libruby.so |
203 |
|
|
204 |
%files tk |
%files tk |
|
%defattr(-, root, root) |
|
205 |
%{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/tcltk* |
%{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/tcltk* |
206 |
%{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/tk* |
%{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/tk* |
207 |
%{_prefix}/lib/%{name}/%{subver}/tcltk* |
%{_prefix}/lib/%{name}/%{subver}/tcltk* |
208 |
%{_prefix}/lib/%{name}/%{subver}/tk* |
%{_prefix}/lib/%{name}/%{subver}/tk* |
209 |
%{_prefix}/lib/%{name}/%{subver}/test/unit/ui/tk |
%{_prefix}/lib/%{name}/%{subver}/test/unit/ui/tk |
|
|
|
|
|
|
|
|
|