Wed, 05 Oct 2011 22:10:11 +0200
Match modules list in both build and install blocks.
1 ##
2 ## yaml.spec -- OpenPKG RPM Package Specification
3 ## Copyright (c) 2000-2011 OpenPKG Foundation e.V. <http://openpkg.net/>
4 ##
5 ## Permission to use, copy, modify, and distribute this software for
6 ## any purpose with or without fee is hereby granted, provided that
7 ## the above copyright notice and this permission notice appear in all
8 ## copies.
9 ##
10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
21 ## SUCH DAMAGE.
22 ##
24 # package version
25 %define V_libsyck 0.70
26 %define V_libyaml 0.1.4
27 %define V_perl_yaml 0.73
28 %define V_perl_yaml_syck 1.17
29 %define V_perl_yaml_tiny 1.50
30 %define V_perl_yaml_appconfig 0.16
31 %define V_perl_yaml_libyaml 0.35
32 %define V_perl_yaml_active 1.100810
33 %define V_perl_yaml_object 0.04
34 %define V_perl_io_yaml 0.08
35 %define V_yaml_javascript 0.03
36 %define V_yaml_spec 2004-12-28
37 %define V_java_jvyaml 0.2.1
38 %define V_java_jyaml 1.3
39 %define V_php_syck 0.9.3
40 %define V_php_yaml 1.0.1
42 # package information
43 Name: yaml
44 Summary: YAML Ain't Markup Language (YAML)
45 URL: http://yaml.org/
46 Vendor: B. Ingerson, C. Evans, O. Ben-Kiki et al.
47 Packager: OpenPKG Foundation e.V.
48 Distribution: OpenPKG Community
49 Class: PLUS
50 Group: Language
51 License: BSD/Artistic
52 Version: 0
53 Release: 20110914
55 # package options
56 %option with_perl no
57 %option with_php no
58 %option with_ruby no
59 %option with_java no
61 # list of sources
62 Source0: http://cloud.github.com/downloads/indeyets/syck/syck-%{V_libsyck}.tar.gz
63 Source1: http://pyyaml.org/download/libyaml/yaml-%{V_libyaml}.tar.gz
64 Source2: http://www.cpan.org/modules/by-module/YAML/YAML-%{V_perl_yaml}.tar.gz
65 Source3: http://www.cpan.org/modules/by-module/YAML/YAML-Syck-%{V_perl_yaml_syck}.tar.gz
66 Source4: http://www.cpan.org/modules/by-module/YAML/YAML-Tiny-%{V_perl_yaml_tiny}.tar.gz
67 Source5: http://www.cpan.org/modules/by-module/YAML/YAML-AppConfig-%{V_perl_yaml_appconfig}.tar.gz
68 Source6: http://www.cpan.org/modules/by-module/YAML/YAML-LibYAML-%{V_perl_yaml_libyaml}.tar.gz
69 Source7: http://www.cpan.org/modules/by-module/YAML/YAML-Active-%{V_perl_yaml_active}.tar.gz
70 Source8: http://www.cpan.org/authors/id/N/NK/NKUITSE/IO-YAML-%{V_perl_io_yaml}.tar.gz
71 Source9: http://osdn.dl.sourceforge.net/yaml-javascript/yaml-javascript-%{V_yaml_javascript}.tar.gz
72 Source10: https://jvyaml.dev.java.net/files/documents/5215/41455/jvyaml-src-%{V_java_jvyaml}.tar.gz
73 Source11: http://switch.dl.sourceforge.net/jyaml/jyaml-src-%{V_java_jyaml}.tgz
74 Source12: http://www.cpan.org/authors/id/E/EI/EIDOLON/YAML-Object-%{V_perl_yaml_object}.tar.gz
75 Source13: http://pecl.php.net/get/syck-%{V_php_syck}.tgz
76 Source14: http://pecl.php.net/get/yaml-%{V_php_yaml}.tgz
77 Source15: http://yaml.org/spec/history/%{V_yaml_spec}/%{V_yaml_spec}.pdf
78 Source16: yaml.yml
79 Patch0: yaml.patch
81 # build information
82 Prefix: %{l_prefix}
83 BuildRoot: %{l_buildroot}
84 BuildPreReq: OpenPKG, openpkg >= 20060823, make, bison
85 PreReq: OpenPKG, openpkg >= 20060823
86 %if "%{with_perl}" == "yes"
87 BuildPreReq: perl, perl-openpkg, perl-module
88 PreReq: perl
89 %endif
90 %if "%{with_php}" == "yes"
91 BuildPreReq: php, autoconf
92 PreReq: php
93 %endif
94 %if "%{with_ruby}" == "yes"
95 BuildPreReq: ruby
96 PreReq: ruby
97 %endif
98 %if "%{with_java}" == "yes"
99 BuildPreReq: java, JAVA-JDK, ant
100 PreReq: java, JAVA-JDK
101 %endif
102 AutoReq: no
103 AutoReqProv: no
105 %description
106 YAML Ain't Markup Language (YAML) is an international collaboration
107 to make a sophisticated data serialization language which is both
108 human readable and computationally powerful. This OpenPKG package
109 provides C, and JavaScript plus optionally Perl, PHP, and Ruby APIs
110 for the generation and parsing of YAML.
112 %track
113 prog yaml:libsyck = {
114 version = %{V_libsyck}
115 url = http://github.com/indeyets/syck/downloads
116 regex = syck-(__VER__)\.tar\.gz
117 }
118 prog yaml:libyaml = {
119 version = %{V_libyaml}
120 url = http://pyyaml.org/download/libyaml/
121 regex = yaml-(__VER__)\.tar\.gz
122 }
123 prog yaml:YAML = {
124 version = %{V_perl_yaml}
125 url = http://www.cpan.org/modules/by-module/YAML/
126 regex = YAML-(__VER__)\.tar\.gz
127 }
128 prog yaml:YAML-Syck = {
129 version = %{V_perl_yaml_syck}
130 url = http://www.cpan.org/modules/by-module/YAML/
131 regex = YAML-Syck-(__VER__)\.tar\.gz
132 }
133 prog yaml:YAML-Tiny = {
134 version = %{V_perl_yaml_tiny}
135 url = http://www.cpan.org/modules/by-module/YAML/
136 regex = YAML-Tiny-(__VER__)\.tar\.gz
137 }
138 prog yaml:YAML-AppConfig = {
139 version = %{V_perl_yaml_appconfig}
140 url = http://www.cpan.org/modules/by-module/YAML/
141 regex = YAML-AppConfig-(__VER__)\.tar\.gz
142 }
143 prog yaml:YAML-LibYAML = {
144 version = %{V_perl_yaml_libyaml}
145 url = http://www.cpan.org/modules/by-module/YAML/
146 regex = YAML-LibYAML-(__VER__)\.tar\.gz
147 }
148 prog yaml:YAML-Active = {
149 comment = "rse: 1.08 requires Class::Accessor::Complex and this too many others"
150 version = %{V_perl_yaml_active}
151 url = http://www.cpan.org/modules/by-module/YAML/
152 regex = YAML-Active-(__VER__)\.tar\.gz
153 }
154 prog yaml:IO-YAML = {
155 version = %{V_perl_io_yaml}
156 url = http://www.cpan.org/authors/id/N/NK/NKUITSE/
157 regex = IO-YAML-(__VER__)\.tar\.gz
158 }
159 prog yaml:yaml-javascript = {
160 version = %{V_yaml_javascript}
161 url = http://sourceforge.net/projects/yaml-javascript/files/
162 regex = yaml-javascript-(__VER__)\.tar\.gz
163 }
164 prog yaml:yaml-spec = {
165 disabled
166 comment = "rse: website references not existing 2004-12-30 and no updates since recently anyway"
167 version = %{V_yaml_spec}
168 url = http://yaml.org/spec/
169 regex = (\d{4}-\d{2}-\d{2})\.pdf
170 }
171 prog yaml:java-jvyaml = {
172 version = %{V_java_jvyaml}
173 url = http://jvyaml.dev.java.net/servlets/ProjectDocumentList
174 regex = jvyaml-src-(__VER__)\.tar\.gz
175 }
176 prog yaml:java-jyaml = {
177 version = %{V_java_jyaml}
178 url = http://sourceforge.net/projects/jyaml/files/
179 regex = jyaml-src-(__VER__)\.tgz
180 }
181 prog yaml:YAML-Object = {
182 version = %{V_perl_yaml_object}
183 url = http://www.cpan.org/authors/id/E/EI/EIDOLON/
184 regex = YAML-Object-(__VER__)\.tar\.gz
185 }
186 prog yaml:PHP-Syck = {
187 version = %{V_php_syck}
188 url = http://pecl.php.net/package/syck
189 regex = syck-(__VER__)\.tgz
190 }
191 prog yaml:PHP-YAML = {
192 version = %{V_php_yaml}
193 url = http://pecl.php.net/package/yaml
194 regex = yaml-(__VER__)\.tgz
195 }
197 %prep
198 %setup -q -c
199 %setup -q -T -D -a 1
200 %setup -q -T -D -a 2
201 %setup -q -T -D -a 3
202 %setup -q -T -D -a 4
203 %setup -q -T -D -a 5
204 %setup -q -T -D -a 6
205 %setup -q -T -D -a 7
206 %setup -q -T -D -a 8
207 %setup -q -T -D -a 9
208 %setup -q -T -D -a 10
209 %setup -q -T -D -a 11
210 %setup -q -T -D -a 12
211 %setup -q -T -D -a 13
212 %setup -q -T -D -a 14
213 %patch -p0
215 %build
216 # build YAML C API
217 ( cd yaml-%{V_libyaml}
218 CC="%{l_cc}" \
219 CFLAGS="%{l_cflags -O}" \
220 ./configure \
221 --prefix=%{l_prefix} \
222 --disable-shared
223 %{l_make} %{l_mflags -O}
224 ) || exit $?
226 # build Syck C API
227 ( cd syck-%{V_libsyck}
228 CC="%{l_cc}" \
229 CFLAGS="%{l_cflags -O}" \
230 ./configure \
231 --prefix=%{l_prefix} \
232 --disable-shared
233 %{l_make} %{l_mflags}
234 ) || exit $?
236 # build PHP API
237 %if "%{with_php}" == "yes"
238 ( cd syck-%{V_php_syck}
239 %{l_prefix}/bin/phpize
240 CC="%{l_cc}" \
241 CFLAGS="%{l_cflags -O}" \
242 CPPFLAGS="-I`pwd`/../syck-%{V_libsyck}/lib" \
243 LDFLAGS="-L`pwd`/../syck-%{V_libsyck}/lib" \
244 ./configure \
245 --with-syck=`pwd`/../syck-%{V_libsyck}
246 %{l_make} %{l_mflags}
247 ) || exit $?
248 ( cd yaml-%{V_php_yaml}
249 %{l_prefix}/bin/phpize
250 CC="%{l_cc}" \
251 CFLAGS="%{l_cflags -O}" \
252 CPPFLAGS="-I`pwd`/../yaml-%{V_libyaml}/include" \
253 LDFLAGS="-L`pwd`/../yaml-%{V_libyaml}/src/.libs" \
254 ./configure \
255 --with-yaml=`pwd`/../yaml-%{V_libyaml}
256 %{l_make} %{l_mflags}
257 ) || exit $?
258 %endif
260 # build Ruby API
261 %if "%{with_ruby}" == "yes"
262 ( cd syck-%{V_libsyck}/ext/ruby
263 %{l_prefix}/bin/ruby install.rb config --prefix=%{l_prefix}
264 %{l_prefix}/bin/ruby install.rb setup
265 ) || exit $?
266 %endif
268 # build Perl API
269 %if "%{with_perl}" == "yes"
270 %{l_prefix}/bin/perl-openpkg prepare
271 %{l_prefix}/bin/perl-openpkg -d YAML-%{V_perl_yaml} configure build
272 %{l_prefix}/bin/perl-openpkg -d YAML-Syck-%{V_perl_yaml_syck} configure build
273 %{l_prefix}/bin/perl-openpkg -d YAML-Tiny-%{V_perl_yaml_tiny} configure build
274 %{l_prefix}/bin/perl-openpkg -d YAML-AppConfig-%{V_perl_yaml_appconfig} configure build
275 %{l_prefix}/bin/perl-openpkg -d YAML-LibYAML-%{V_perl_yaml_libyaml} configure build
276 %{l_prefix}/bin/perl-openpkg -d YAML-Active-%{V_perl_yaml_active} configure build
277 %{l_prefix}/bin/perl-openpkg -d YAML-Object-%{V_perl_yaml_object} configure build
278 %{l_prefix}/bin/perl-openpkg -d IO-YAML-%{V_perl_io_yaml} configure build
279 %endif
281 # build Java API
282 %if "%{with_java}" == "yes"
283 ( cd jvyaml-%{V_java_jvyaml}
284 %{l_prefix}/bin/ant
285 ) || exit $?
286 ( cd jyaml
287 %{l_prefix}/bin/ant
288 ) || exit $?
289 %endif
291 %install
292 rm -rf $RPM_BUILD_ROOT
294 # install YAML C API
295 ( cd yaml-%{V_libyaml}
296 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
297 ) || exit $?
299 # install Syck C API
300 ( cd syck-%{V_libsyck}
301 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
302 ) || exit $?
304 # install PHP API
305 %if "%{with_php}" == "yes"
306 ( cd syck-%{V_php_syck}
307 %{l_make} %{l_mflags} install INSTALL_ROOT=$RPM_BUILD_ROOT
308 ) || exit $?
309 ( cd yaml-%{V_php_yaml}
310 %{l_make} %{l_mflags} install INSTALL_ROOT=$RPM_BUILD_ROOT
311 ) || exit $?
312 %endif
314 # install Ruby API
315 %if "%{with_ruby}" == "yes"
316 ( cd syck-%{V_libsyck}/ext/ruby
317 %{l_prefix}/bin/ruby install.rb install --prefix=$RPM_BUILD_ROOT
318 ) || exit $?
319 %endif
321 # install Perl API
322 %if "%{with_perl}" == "yes"
323 %{l_prefix}/bin/perl-openpkg -d YAML-%{V_perl_yaml} install
324 %{l_prefix}/bin/perl-openpkg -d YAML-Syck-%{V_perl_yaml_syck} install
325 %{l_prefix}/bin/perl-openpkg -d YAML-Tiny-%{V_perl_yaml_tiny} install
326 %{l_prefix}/bin/perl-openpkg -d YAML-AppConfig-%{V_perl_yaml_appconfig} install
327 %{l_prefix}/bin/perl-openpkg -d YAML-LibYAML-%{V_perl_yaml_libyaml} install
328 %{l_prefix}/bin/perl-openpkg -d YAML-Active-%{V_perl_yaml_active} install
329 %{l_prefix}/bin/perl-openpkg -d YAML-Object-%{V_perl_yaml_object} install
330 %{l_prefix}/bin/perl-openpkg -d IO-YAML-%{V_perl_io_yaml} install
331 %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
332 %else
333 >perl-openpkg-files
334 %endif
336 # install Java API
337 %if "%{with_java}" == "yes"
338 %{l_shtool} mkdir -f -p -m 755 \
339 $RPM_BUILD_ROOT%{l_prefix}/lib/yaml
340 %{l_shtool} install -c -m 644 \
341 jvyaml-%{V_java_jvyaml}/lib/jvyaml.jar \
342 $RPM_BUILD_ROOT%{l_prefix}/lib/yaml/
343 %{l_shtool} install -c -m 644 \
344 jyaml/dist/jyaml-*.jar \
345 $RPM_BUILD_ROOT%{l_prefix}/lib/yaml/jyaml.jar
346 %endif
348 # install JavaScript API
349 %{l_shtool} mkdir -f -p -m 755 \
350 $RPM_BUILD_ROOT%{l_prefix}/share/yaml
351 %{l_shtool} install -c -m 644 \
352 yaml-javascript-%{V_yaml_javascript}/yaml_dumper.js \
353 $RPM_BUILD_ROOT%{l_prefix}/share/yaml/
355 # install YAML specification and quick reference
356 %{l_shtool} install -c -m 644 \
357 %{SOURCE %{V_yaml_spec}.pdf} \
358 $RPM_BUILD_ROOT%{l_prefix}/share/yaml/yaml.pdf
359 %{l_shtool} install -c -m 644 \
360 %{SOURCE yaml.yml} \
361 $RPM_BUILD_ROOT%{l_prefix}/share/yaml/
363 # determine installation files
364 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
365 %{l_files_std} `cat perl-openpkg-files`
367 %files -f files
369 %clean
370 rm -rf $RPM_BUILD_ROOT