/[packages]/cauldron/ruby/current/SPECS/ruby.spec
ViewVC logotype

Annotation of /cauldron/ruby/current/SPECS/ruby.spec

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30