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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 401798 - (show annotations) (download)
Fri Mar 8 18:47:46 2013 UTC (8 years, 4 months ago) by luigiwalser
File size: 6791 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 p357
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: libgdbm-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
64 %package devel
65 Summary: Development file for the powerful language Ruby
66 Group: Development/Ruby
67 Requires: %{name} = %{version}
68
69 %package tk
70 Summary: Tk extension for the powerful language Ruby
71 Group: Development/Ruby
72 Requires: %{name} = %{version}
73
74 %description
75 Ruby is the interpreted scripting language for quick and
76 easy object-oriented programming. It has many features to
77 process text files and to do system management tasks (as in
78 Perl). It is simple, straight-forward, and extensible.
79
80 %description doc
81 Ruby is the interpreted scripting language for quick and
82 easy object-oriented programming. It has many features to
83 process text files and to do system management tasks (as in
84 Perl). It is simple, straight-forward, and extensible.
85
86 This package contains the Ruby's documentation
87
88 %description devel
89 Ruby is the interpreted scripting language for quick and
90 easy object-oriented programming. It has many features to
91 process text files and to do system management tasks (as in
92 Perl). It is simple, straight-forward, and extensible.
93
94 This package contains the Ruby's devel files.
95
96 %description tk
97 Ruby is the interpreted scripting language for quick and
98 easy object-oriented programming. It has many features to
99 process text files and to do system management tasks (as in
100 Perl). It is simple, straight-forward, and extensible.
101
102 This package contains the Tk extension for Ruby.
103
104 %prep
105 %setup -q -n ruby-%{rubyver}-%{patchversion}
106 %patch0 -p0 -b .lib64
107 %patch1 -p0 -b .ri
108 %patch2 -p2 -b .old
109 %patch3 -p2 -b .undefined
110 %patch4 -p1 -b .CVE-2011-0188
111 %patch5 -p1 -b .CVE-2012-4466-CVE-2012-4481
112 %patch6 -p1 -b .CVE-2013-1821
113 %patch7 -p0 -b .rexml
114
115 autoreconf
116
117 %build
118 echo '.text' | gcc -shared -o libdummy.so.0 -xassembler - -ltcl -ltk >& /dev/null && {
119 if %{_bindir}/ldd libdummy.so.0 | grep -q "lib\(tcl\|tk\).so"; then
120 echo "Your tcl/tk is broken, get one with versioning in the libraries."
121 exit 1
122 fi
123 rm -f libdummy.so.0
124 }
125
126 CFLAGS=`echo %{optflags} | sed 's/-fomit-frame-pointer//'`
127 %configure2_5x --enable-shared --disable-rpath --enable-pthread \
128 --with-sitedir=%{_prefix}/lib/ruby/site_ruby \
129 --with-vendordir=%{_prefix}/lib/ruby/vendor_ruby \
130 --with-old-os=linux-gnu
131
132 %make
133
134
135 %install
136 rm -rf %{buildroot}
137 %makeinstall_std install-doc
138
139 install -d %{buildroot}%{_docdir}/%{name}-%{version}
140 cp -a COPYING* ChangeLog README* ToDo sample %{buildroot}%{_docdir}/%{name}-%{version}
141 bzcat %{SOURCE1} > %{buildroot}%{_docdir}/%{name}-%{version}/FAQ.html
142
143 install -d %{buildroot}%{_datadir}/emacs/site-lisp
144 cp -a misc/ruby-mode.el %{buildroot}%{_datadir}/emacs/site-lisp
145
146 install -d %{buildroot}%{_sysconfdir}/emacs/site-start.d
147 cat <<EOF >%{buildroot}%{_sysconfdir}/emacs/site-start.d/%{name}.el
148 (autoload 'ruby-mode "ruby-mode" "Ruby editing mode." t)
149 (add-to-list 'auto-mode-alist '("\\\\.rb$" . ruby-mode))
150 (add-to-list 'interpreter-mode-alist '("ruby" . ruby-mode))
151 EOF
152
153 (cd %{buildroot}%{_docdir}/%{name}-%{version} ; tar xfj %{SOURCE2} ; cd Pro*; mv -f html/* . ; rm -rf html xml)
154
155 # Make the file/dirs list, filtering out tcl/tk and devel files
156 ( cd %{buildroot} \
157 && find usr/lib/ruby/%{subver} \
158 \( -not -type d -printf "/%%p\n" \) \
159 -or \( -type d -printf "%%%%dir /%%p\n" \) \
160 ) | egrep -v '/(tcl)?tk|(%{my_target_cpu}-%{_target_os}%{abi}/.*[ha]$)' > %{name}.list
161
162 # Fix scripts permissions and location
163 find %{buildroot} sample -type f | file -i -f - | grep text | cut -d: -f1 >text.list
164 cat text.list | xargs chmod 0644
165 # Magic grepping to get only files with '#!' in the first line
166 cat text.list | xargs grep -n '^#!' | grep ':1:#!' | cut -d: -f1 >shebang.list
167 cat shebang.list | xargs sed -i -e 's|/usr/local/bin|/usr/bin|; s|\./ruby|/usr/bin/ruby|'
168 cat shebang.list | xargs chmod 0755
169
170
171 # Install the rpm macros
172 mkdir -p %{buildroot}%{_sysconfdir}/rpm/macros.d
173 cp %{SOURCE3} %{buildroot}%{_sysconfdir}/rpm/macros.d
174 %check
175 make test
176
177 %clean
178 rm -rf %{buildroot}
179
180 %files -f %{name}.list
181 %dir %{_docdir}/%{name}-%{version}
182 %{_docdir}/%{name}-%{version}/README
183 %{_bindir}/*
184 %dir %{_prefix}/lib/%{name}/
185 %{_libdir}/libruby.so.*
186 %{_prefix}/lib/%{name}/site_ruby
187 %{_mandir}/*/*
188 %{_datadir}/emacs/site-lisp/*
189 %config(noreplace) %{_sysconfdir}/emacs/site-start.d/*
190 %{_sysconfdir}/rpm/macros.d/%{name}.macros
191
192 %files doc
193 %{_datadir}/ri
194 %dir %{_docdir}/%{name}-%{version}
195 %{_docdir}/%{name}-%{version}/COPYING*
196 %{_docdir}/%{name}-%{version}/ChangeLog
197 %{_docdir}/%{name}-%{version}/README.*
198 %{_docdir}/%{name}-%{version}/FAQ.html
199 %{_docdir}/%{name}-%{version}/ToDo
200 %{_docdir}/%{name}-%{version}/sample
201 %{_docdir}/%{name}-%{version}/ProgrammingRuby*
202
203 %files devel
204 %{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/*.[ah]
205 %{_libdir}/libruby-static.a
206 %{_libdir}/libruby.so
207
208 %files tk
209 %{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/tcltk*
210 %{_prefix}/lib/%{name}/%{subver}/%{my_target_cpu}-%{_target_os}%{abi}/tk*
211 %{_prefix}/lib/%{name}/%{subver}/tcltk*
212 %{_prefix}/lib/%{name}/%{subver}/tk*
213 %{_prefix}/lib/%{name}/%{subver}/test/unit/ui/tk

  ViewVC Help
Powered by ViewVC 1.1.28