Thu, 15 Sep 2011 17:10:15 +0200
Import package vendor original specs for necessary manipulations,
requiring YAML module for upcoming davical package database update.
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
41 %define V_php_spyc 0.4.5
43 # package information
44 Name: yaml
45 Summary: YAML Ain't Markup Language (YAML)
46 URL: http://yaml.org/
47 Vendor: B. Ingerson, C. Evans, O. Ben-Kiki et al.
48 Packager: OpenPKG Foundation e.V.
49 Distribution: OpenPKG Community
50 Class: PLUS
51 Group: Language
52 License: BSD/Artistic
53 Version: 0
54 Release: 20110624
56 # package options
57 %option with_perl no
58 %option with_php no
59 %option with_ruby no
60 %option with_java no
62 # list of sources
63 Source0: http://cloud.github.com/downloads/indeyets/syck/syck-%{V_libsyck}.tar.gz
64 Source1: http://pyyaml.org/download/libyaml/yaml-%{V_libyaml}.tar.gz
65 Source2: http://www.cpan.org/modules/by-module/YAML/YAML-%{V_perl_yaml}.tar.gz
66 Source3: http://www.cpan.org/modules/by-module/YAML/YAML-Syck-%{V_perl_yaml_syck}.tar.gz
67 Source4: http://www.cpan.org/modules/by-module/YAML/YAML-Tiny-%{V_perl_yaml_tiny}.tar.gz
68 Source5: http://www.cpan.org/modules/by-module/YAML/YAML-AppConfig-%{V_perl_yaml_appconfig}.tar.gz
69 Source6: http://www.cpan.org/modules/by-module/YAML/YAML-LibYAML-%{V_perl_yaml_libyaml}.tar.gz
70 Source7: http://www.cpan.org/modules/by-module/YAML/YAML-Active-%{V_perl_yaml_active}.tar.gz
71 Source8: http://www.cpan.org/authors/id/N/NK/NKUITSE/IO-YAML-%{V_perl_io_yaml}.tar.gz
72 Source9: http://osdn.dl.sourceforge.net/yaml-javascript/yaml-javascript-%{V_yaml_javascript}.tar.gz
73 Source10: https://jvyaml.dev.java.net/files/documents/5215/41455/jvyaml-src-%{V_java_jvyaml}.tar.gz
74 Source11: http://switch.dl.sourceforge.net/jyaml/jyaml-src-%{V_java_jyaml}.tgz
75 Source12: http://www.cpan.org/authors/id/E/EI/EIDOLON/YAML-Object-%{V_perl_yaml_object}.tar.gz
76 Source13: http://pecl.php.net/get/syck-%{V_php_syck}.tgz
77 Source14: http://pecl.php.net/get/yaml-%{V_php_yaml}.tgz
78 Source15: http://spyc.googlecode.com/files/spyc-%{V_php_spyc}.zip
79 Source16: http://yaml.org/spec/history/%{V_yaml_spec}/%{V_yaml_spec}.pdf
80 Source17: yaml.yml
81 Patch0: yaml.patch
83 # build information
84 BuildPreReq: OpenPKG, openpkg >= 20100101, make, bison
85 PreReq: OpenPKG, openpkg >= 20100101
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
103 %description
104 YAML Ain't Markup Language (YAML) is an international collaboration
105 to make a sophisticated data serialization language which is both
106 human readable and computationally powerful. This OpenPKG package
107 provides C, and JavaScript plus optionally Perl, PHP, and Ruby APIs
108 for the generation and parsing of YAML.
110 %track
111 prog yaml:libsyck = {
112 version = %{V_libsyck}
113 url = http://github.com/indeyets/syck/downloads
114 regex = syck-(__VER__)\.tar\.gz
115 }
116 prog yaml:libyaml = {
117 version = %{V_libyaml}
118 url = http://pyyaml.org/download/libyaml/
119 regex = yaml-(__VER__)\.tar\.gz
120 }
121 prog yaml:YAML = {
122 version = %{V_perl_yaml}
123 url = http://www.cpan.org/modules/by-module/YAML/
124 regex = YAML-(__VER__)\.tar\.gz
125 }
126 prog yaml:YAML-Syck = {
127 version = %{V_perl_yaml_syck}
128 url = http://www.cpan.org/modules/by-module/YAML/
129 regex = YAML-Syck-(__VER__)\.tar\.gz
130 }
131 prog yaml:YAML-Tiny = {
132 version = %{V_perl_yaml_tiny}
133 url = http://www.cpan.org/modules/by-module/YAML/
134 regex = YAML-Tiny-(__VER__)\.tar\.gz
135 }
136 prog yaml:YAML-AppConfig = {
137 version = %{V_perl_yaml_appconfig}
138 url = http://www.cpan.org/modules/by-module/YAML/
139 regex = YAML-AppConfig-(__VER__)\.tar\.gz
140 }
141 prog yaml:YAML-LibYAML = {
142 version = %{V_perl_yaml_libyaml}
143 url = http://www.cpan.org/modules/by-module/YAML/
144 regex = YAML-LibYAML-(__VER__)\.tar\.gz
145 }
146 prog yaml:YAML-Active = {
147 comment = "rse: 1.08 requires Class::Accessor::Complex and this too many others"
148 version = %{V_perl_yaml_active}
149 url = http://www.cpan.org/modules/by-module/YAML/
150 regex = YAML-Active-(__VER__)\.tar\.gz
151 }
152 prog yaml:IO-YAML = {
153 version = %{V_perl_io_yaml}
154 url = http://www.cpan.org/authors/id/N/NK/NKUITSE/
155 regex = IO-YAML-(__VER__)\.tar\.gz
156 }
157 prog yaml:yaml-javascript = {
158 version = %{V_yaml_javascript}
159 url = http://sourceforge.net/projects/yaml-javascript/files/
160 regex = yaml-javascript-(__VER__)\.tar\.gz
161 }
162 prog yaml:yaml-spec = {
163 disabled
164 comment = "rse: website references not existing 2004-12-30 and no updates since recently anyway"
165 version = %{V_yaml_spec}
166 url = http://yaml.org/spec/
167 regex = (\d{4}-\d{2}-\d{2})\.pdf
168 }
169 prog yaml:java-jvyaml = {
170 version = %{V_java_jvyaml}
171 url = http://jvyaml.dev.java.net/servlets/ProjectDocumentList
172 regex = jvyaml-src-(__VER__)\.tar\.gz
173 }
174 prog yaml:java-jyaml = {
175 version = %{V_java_jyaml}
176 url = http://sourceforge.net/projects/jyaml/files/
177 regex = jyaml-src-(__VER__)\.tgz
178 }
179 prog yaml:YAML-Object = {
180 version = %{V_perl_yaml_object}
181 url = http://www.cpan.org/authors/id/E/EI/EIDOLON/
182 regex = YAML-Object-(__VER__)\.tar\.gz
183 }
184 prog yaml:PHP-Syck = {
185 version = %{V_php_syck}
186 url = http://pecl.php.net/package/syck
187 regex = syck-(__VER__)\.tgz
188 }
189 prog yaml:PHP-YAML = {
190 version = %{V_php_yaml}
191 url = http://pecl.php.net/package/yaml
192 regex = yaml-(__VER__)\.tgz
193 }
194 prog yaml:PHP-spyc = {
195 version = %{V_php_spyc}
196 url = http://spyc.googlecode.com/files/
197 regex = spyc-(__VER__)\.zip
198 }
200 %prep
201 %setup -q -c
202 %setup -q -T -D -a 1
203 %setup -q -T -D -a 2
204 %setup -q -T -D -a 3
205 %setup -q -T -D -a 4
206 %setup -q -T -D -a 5
207 %setup -q -T -D -a 6
208 %setup -q -T -D -a 7
209 %setup -q -T -D -a 8
210 %setup -q -T -D -a 9
211 %setup -q -T -D -a 10
212 %setup -q -T -D -a 11
213 %setup -q -T -D -a 12
214 %setup -q -T -D -a 13
215 %setup -q -T -D -a 14
216 %setup -q -T -D -a 15
217 %patch -p0
219 %build
220 # build YAML C API
221 ( cd yaml-%{V_libyaml}
222 CC="%{l_cc}" \
223 CFLAGS="%{l_cflags -O}" \
224 ./configure \
225 --prefix=%{l_prefix} \
226 --disable-shared
227 %{l_make} %{l_mflags -O}
228 ) || exit $?
230 # build Syck C API
231 ( cd syck-%{V_libsyck}
232 CC="%{l_cc}" \
233 CFLAGS="%{l_cflags -O}" \
234 ./configure \
235 --prefix=%{l_prefix} \
236 --disable-shared
237 %{l_make} %{l_mflags}
238 ) || exit $?
240 # build PHP API
241 %if "%{with_php}" == "yes"
242 ( cd syck-%{V_php_syck}
243 %{l_prefix}/bin/phpize
244 CC="%{l_cc}" \
245 CFLAGS="%{l_cflags -O}" \
246 CPPFLAGS="-I`pwd`/../syck-%{V_libsyck}/lib" \
247 LDFLAGS="-L`pwd`/../syck-%{V_libsyck}/lib" \
248 ./configure \
249 --with-syck=`pwd`/../syck-%{V_libsyck}
250 %{l_make} %{l_mflags}
251 ) || exit $?
252 ( cd yaml-%{V_php_yaml}
253 %{l_prefix}/bin/phpize
254 CC="%{l_cc}" \
255 CFLAGS="%{l_cflags -O}" \
256 CPPFLAGS="-I`pwd`/../yaml-%{V_libyaml}/include" \
257 LDFLAGS="-L`pwd`/../yaml-%{V_libyaml}/src/.libs" \
258 ./configure \
259 --with-yaml=`pwd`/../yaml-%{V_libyaml}
260 %{l_make} %{l_mflags}
261 ) || exit $?
262 %endif
264 # build Ruby API
265 %if "%{with_ruby}" == "yes"
266 ( cd syck-%{V_libsyck}/ext/ruby
267 %{l_prefix}/bin/ruby install.rb config --prefix=%{l_prefix}
268 %{l_prefix}/bin/ruby install.rb setup
269 ) || exit $?
270 %endif
272 # build Perl API
273 %if "%{with_perl}" == "yes"
274 %{l_prefix}/bin/perl-openpkg prepare
275 %{l_prefix}/bin/perl-openpkg -d YAML-%{V_perl_yaml} configure build
276 %{l_prefix}/bin/perl-openpkg -d YAML-Syck-%{V_perl_yaml_syck} configure build
277 %{l_prefix}/bin/perl-openpkg -d YAML-Tiny-%{V_perl_yaml_tiny} configure build
278 %{l_prefix}/bin/perl-openpkg -d YAML-AppConfig-%{V_perl_yaml_appconfig} configure build
279 %{l_prefix}/bin/perl-openpkg -d YAML-LibYAML-%{V_perl_yaml_libyaml} configure build
280 %{l_prefix}/bin/perl-openpkg -d YAML-Active-%{V_perl_yaml_active} configure build
281 %{l_prefix}/bin/perl-openpkg -d YAML-Object-%{V_perl_yaml_object} configure build
282 %{l_prefix}/bin/perl-openpkg -d IO-YAML-%{V_perl_io_yaml} configure build
283 %endif
285 # build Java API
286 %if "%{with_java}" == "yes"
287 ( cd jvyaml-%{V_java_jvyaml}
288 %{l_prefix}/bin/ant
289 ) || exit $?
290 ( cd jyaml
291 %{l_prefix}/bin/ant
292 ) || exit $?
293 %endif
295 %install
297 # install YAML C API
298 ( cd yaml-%{V_libyaml}
299 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
300 ) || exit $?
302 # install Syck C API
303 ( cd syck-%{V_libsyck}
304 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
305 ) || exit $?
307 # install PHP API
308 %if "%{with_php}" == "yes"
309 ( cd syck-%{V_php_syck}
310 %{l_make} %{l_mflags} install INSTALL_ROOT=$RPM_BUILD_ROOT
311 ) || exit $?
312 ( cd yaml-%{V_php_yaml}
313 %{l_make} %{l_mflags} install INSTALL_ROOT=$RPM_BUILD_ROOT
314 ) || exit $?
315 ( cd spyc-%{V_php_spyc}
316 %{l_shtool} mkdir -f -p -m 755 \
317 $RPM_BUILD_ROOT%{l_prefix}/share/yaml
318 %{l_shtool} install -c -m 644 \
319 spyc.php $RPM_BUILD_ROOT%{l_prefix}/share/yaml/
320 ) || exit $?
321 %endif
323 # install Ruby API
324 %if "%{with_ruby}" == "yes"
325 ( cd syck-%{V_libsyck}/ext/ruby
326 %{l_prefix}/bin/ruby install.rb install --prefix=$RPM_BUILD_ROOT
327 ) || exit $?
328 %endif
330 # install Perl API
331 %if "%{with_perl}" == "yes"
332 %{l_prefix}/bin/perl-openpkg -d YAML-%{V_perl_yaml} install
333 %{l_prefix}/bin/perl-openpkg -d YAML-Syck-%{V_perl_yaml_syck} install
334 %{l_prefix}/bin/perl-openpkg -d YAML-Tiny-%{V_perl_yaml_tiny} install
335 %{l_prefix}/bin/perl-openpkg -d YAML-AppConfig-%{V_perl_yaml_appconfig} install
336 %{l_prefix}/bin/perl-openpkg -d YAML-LibYAML-%{V_perl_yaml_libyaml} install
337 %{l_prefix}/bin/perl-openpkg -d YAML-Active-%{V_perl_yaml_active} install
338 %{l_prefix}/bin/perl-openpkg -d YAML-Object-%{V_perl_yaml_object} install
339 %{l_prefix}/bin/perl-openpkg -d IO-YAML-%{V_perl_io_yaml} install
340 %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
341 %else
342 >perl-openpkg-files
343 %endif
345 # install Java API
346 %if "%{with_java}" == "yes"
347 %{l_shtool} mkdir -f -p -m 755 \
348 $RPM_BUILD_ROOT%{l_prefix}/lib/yaml
349 %{l_shtool} install -c -m 644 \
350 jvyaml-%{V_java_jvyaml}/lib/jvyaml.jar \
351 $RPM_BUILD_ROOT%{l_prefix}/lib/yaml/
352 %{l_shtool} install -c -m 644 \
353 jyaml/dist/jyaml-*.jar \
354 $RPM_BUILD_ROOT%{l_prefix}/lib/yaml/jyaml.jar
355 %endif
357 # install JavaScript API
358 %{l_shtool} mkdir -f -p -m 755 \
359 $RPM_BUILD_ROOT%{l_prefix}/share/yaml
360 %{l_shtool} install -c -m 644 \
361 yaml-javascript-%{V_yaml_javascript}/yaml_dumper.js \
362 $RPM_BUILD_ROOT%{l_prefix}/share/yaml/
364 # install YAML specification and quick reference
365 %{l_shtool} install -c -m 644 \
366 %{SOURCE %{V_yaml_spec}.pdf} \
367 $RPM_BUILD_ROOT%{l_prefix}/share/yaml/yaml.pdf
368 %{l_shtool} install -c -m 644 \
369 %{SOURCE yaml.yml} \
370 $RPM_BUILD_ROOT%{l_prefix}/share/yaml/
372 # determine installation files
373 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
374 %{l_files_std} `cat perl-openpkg-files`
376 %files -f files
378 %clean