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

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

Parent Directory Parent Directory | Revision Log Revision Log


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

  ViewVC Help
Powered by ViewVC 1.1.30