/[packages]/updates/2/ruby/current/SPECS/ruby.spec
ViewVC logotype

Contents of /updates/2/ruby/current/SPECS/ruby.spec

Parent Directory Parent Directory | Revision Log Revision Log


Revision 401797 - (show annotations) (download)
Fri Mar 8 18:45:35 2013 UTC (8 years, 6 months ago) by luigiwalser
File size: 6945 byte(s)
add patches from redhat to fix CVE-2013-1821
1 %define subver 1.8
2 %define rubyver 1.8.7
3 %define patchversion p358
4 %define rel 1
5 %define subrel 2
6
7 Summary: Object Oriented Script Language
8 Name: ruby
9 Version: %{rubyver}.%{patchversion}
10 Release: %mkrel %rel
11 License: Ruby or GPLv2
12 Group: Development/Ruby
13 BuildRequires: autoconf
14 BuildRequires: byacc
15 BuildRequires: ncurses-devel
16 BuildRequires: readline-devel
17 BuildRequires: tcl-devel tk-devel
18 BuildRequires: db4-devel
19 BuildRequires: gdbm-devel >= 1.8.3
20 BuildRequires: openssl-devel
21 BuildRequires: zlib-devel
22 Obsoletes: ruby-rexml
23 Provides: ruby-rexml
24 # explicit file provides (since such requires are automatically added by find-requires)
25 Provides: /usr/bin/ruby
26 Provides: ruby(abi) = %{subver}
27
28 Source0: ftp://ftp.ruby-lang.org/pub/ruby/%{subver}/ruby-%{rubyver}-%{patchversion}.tar.bz2
29 Source1: http://www.rubycentral.com/faq/rubyfaqall.html.bz2
30 Source2: http://dev.rubycentral.com/downloads/files/ProgrammingRuby-0.4.tar.bz2
31 Source3: ruby.macros
32 Patch0: ruby-lib64.patch
33 Patch1: ruby-do-not-use-system-ruby-to-generate-ri-doc.patch
34 Patch2: ruby-add-old-os-to-search-path.patch
35 Patch3: ruby-do_not_propagate_no-undefined.patch
36 Patch4: 110703_CVE-2011-0188.patch
37 Patch5: ruby-1.8.7-p358-CVE-2012-4466-CVE-2012-4481.patch
38 Patch6: ruby-2.0.0-entity-expansion-DoS-vulnerability-in-REXML.patch
39 Patch7: ruby-2.0.0-add-missing-rexml-require.patch
40 URL: http://www.ruby-lang.org/
41
42 %define my_target_cpu %{_target_cpu}
43 %ifarch ppc
44 %define my_target_cpu powerpc
45 %endif
46 %ifarch ppc64
47 %define my_target_cpu powerpc64
48 %endif
49 %ifarch amd64
50 %define my_target_cpu x86_64
51 %endif
52
53 # we're building for eabi
54 %ifarch %arm
55 %define abi -eabi
56 %else
57 %define abi %{nil}
58 %endif
59
60 %package doc
61 Summary: Documentation for the powerful language Ruby
62 Group: Development/Ruby
63 BuildArch: noarch
64
65 %package devel
66 Summary: Development file for the powerful language Ruby
67 Group: Development/Ruby
68 Requires: %{name} = %{version}
69
70 %package tk
71 Summary: Tk extension for the powerful language Ruby
72 Group: Development/Ruby
73 Requires: %{name} = %{version}
74
75 %description
76 Ruby is the interpreted scripting language for quick and
77 easy object-oriented programming. It has many features to
78 process text files and to do system management tasks (as in
79 Perl). It is simple, straight-forward, and extensible.
80
81 %description doc
82 Ruby is the interpreted scripting language for quick and
83 easy object-oriented programming. It has many features to
84 process text files and to do system management tasks (as in
85 Perl). It is simple, straight-forward, and extensible.
86
87 This package contains the Ruby's documentation
88
89 %description devel
90 Ruby is the interpreted scripting language for quick and
91 easy object-oriented programming. It has many features to
92 process text files and to do system management tasks (as in
93 Perl). It is simple, straight-forward, and extensible.
94
95 This package contains the Ruby's devel files.
96
97 %description tk
98 Ruby is the interpreted scripting language for quick and
99 easy object-oriented programming. It has many features to
100 process text files and to do system management tasks (as in
101 Perl). It is simple, straight-forward, and extensible.
102
103 This package contains the Tk extension for Ruby.
104
105 %prep
106 %setup -q -n ruby-%{rubyver}-%{patchversion}
107 %patch0 -p0 -b .lib64
108 %patch1 -p0 -b .ri
109 %patch2 -p2 -b .old
110 %patch3 -p2 -b .undefined
111 %patch4 -p1 -b .CVE-2011-0188
112 %patch5 -p1 -b .CVE-2012-4466-CVE-2012-4481
113 %patch6 -p1 -b .CVE-2013-1821
114 %patch7 -p0 -b .rexml
115
116 # Once fix FTBTS issue (redhat bug 716021). Remove the below
117 # when it is no longer needed.
118 sed -i.redirect -e '\@RUBY@s@\.rb >@\.rb | cat >@' ext/dl/depend
119
120 autoreconf
121
122 %build
123 echo '.text' | gcc -shared -o libdummy.so.0 -xassembler - -ltcl -ltk >& /dev/null && {
124 if %{_bindir}/ldd libdummy.so.0 | grep -q "lib\(tcl\|tk\).so"; then
125 echo "Your tcl/tk is broken, get one with versioning in the libraries."
126 exit 1
127 fi
128 rm -f libdummy.so.0
129 }
130
131 CFLAGS=`echo %{optflags} | sed 's/-fomit-frame-pointer//'`
132 %configure2_5x --enable-shared --disable-rpath --enable-pthread \
133 --with-sitedir=%{_prefix}/lib/ruby/site_ruby \
134 --with-vendordir=%{_prefix}/lib/ruby/vendor_ruby \
135 --with-old-os=linux-gnu
136
137 %make
138
139
140 %install
141 %makeinstall_std install-doc
142
143 install -d %{buildroot}%{_docdir}/%{name}-%{version}
144 cp -a COPYING* ChangeLog README* ToDo sample %{buildroot}%{_docdir}/%{name}-%{version}
145 bzcat %{SOURCE1} > %{buildroot}%{_docdir}/%{name}-%{version}/FAQ.html
146
147 install -d %{buildroot}%{_datadir}/emacs/site-lisp
148 cp -a misc/ruby-mode.el %{buildroot}%{_datadir}/emacs/site-lisp
149
150 install -d %{buildroot}%{_sysconfdir}/emacs/site-start.d
151 cat <<EOF >%{buildroot}%{_sysconfdir}/emacs/site-start.d/%{name}.el
152 (autoload 'ruby-mode "ruby-mode" "Ruby editing mode." t)
153 (add-to-list 'auto-mode-alist '("\\\\.rb$" . ruby-mode))
154 (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
155 EOF
156
157 (cd %{buildroot}%{_docdir}/%{name}-%{version} ; tar xfj %{SOURCE2} ; cd Pro*; mv -f html/* . ; rm -rf html xml)
158
159 # Make the file/dirs list, filtering out tcl/tk and devel files
160 ( cd %{buildroot} \
161 && find usr/lib/ruby/%{subver} \
162 \( -not -type d -printf "/%%p\n" \) \
163 -or \( -type d -printf "%%%%dir /%%p\n" \) \
164 ) | egrep -v '/(tcl)?tk|(%{my_target_cpu}-%{_target_os}%{abi}/.*[ha]$)' > %{name}.list
165
166 # Fix scripts permissions and location
167 find %{buildroot} sample -type f | file -i -f - | grep text | cut -d: -f1 >text.list
168 cat text.list | xargs chmod 0644
169 # Magic grepping to get only files with '#!' in the first line
170 cat text.list | xargs grep -n '^#!' | grep ':1:#!' | cut -d: -f1 >shebang.list
171 cat shebang.list | xargs sed -i -e 's|/usr/local/bin|/usr/bin|; s|\./ruby|/usr/bin/ruby|'
172 cat shebang.list | xargs chmod 0755
173
174
175 # Install the rpm macros
176 mkdir -p %{buildroot}%{_sysconfdir}/rpm/macros.d
177 cp %{SOURCE3} %{buildroot}%{_sysconfdir}/rpm/macros.d
178 %check
179 make test
180
181 %clean
182 rm -rf %{buildroot}
183
184 %files -f %{name}.list
185 %dir %{_docdir}/%{name}-%{version}
186 %{_docdir}/%{name}-%{version}/README
187 %{_bindir}/*
188 %dir %{_prefix}/lib/%{name}/
189 %{_libdir}/libruby.so.*
190 %{_prefix}/lib/%{name}/site_ruby
191 %{_mandir}/*/*
192 %{_datadir}/emacs/site-lisp/*
193 %config(noreplace) %{_sysconfdir}/emacs/site-start.d/*
194 %{_sysconfdir}/rpm/macros.d/%{name}.macros
195
196 %files doc
197 %{_datadir}/ri
198 %dir %{_docdir}/%{name}-%{version}
199 %{_docdir}/%{name}-%{version}/COPYING*
200 %{_docdir}/%{name}-%{version}/ChangeLog
201 %{_docdir}/%{name}-%{version}/README.*
202 %{_docdir}/%{name}-%{version}/FAQ.html
203 %{_docdir}/%{name}-%{version}/ToDo
204 %{_docdir}/%{name}-%{version}/sample
205 %{_docdir}/%{name}-%{version}/ProgrammingRuby*
206
207 %files devel
208 %{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/*.[ah]
209 %{_libdir}/libruby-static.a
210 %{_libdir}/libruby.so
211
212 %files tk
213 %{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/tcltk*
214 %{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/tk*
215 %{_prefix}/lib/%{name}/%{subver}/tcltk*
216 %{_prefix}/lib/%{name}/%{subver}/tk*
217 %{_prefix}/lib/%{name}/%{subver}/test/unit/ui/tk

  ViewVC Help
Powered by ViewVC 1.1.28