##
## yaml.spec -- OpenPKG RPM Package Specification
## Copyright (c) 2000-2006 OpenPKG Foundation e.V.
## Copyright (c) 2000-2006 Ralf S. Engelschall
##
## Permission to use, copy, modify, and distribute this software for
## any purpose with or without fee is hereby granted, provided that
## the above copyright notice and this permission notice appear in all
## copies.
##
## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
## SUCH DAMAGE.
##
# package version
%define V_libsyck 0.55
%define V_libyaml 0.0.1
%define V_perl_yaml 0.62
%define V_perl_yaml_syck 0.72
%define V_perl_yaml_tiny 0.11
%define V_perl_yaml_appconfig 0.16
%define V_yaml_javascript 0.03
%define V_yaml_spec 2004-12-28
# package information
Name: yaml
Summary: YAML Ain't Markup Language (YAML)
URL: http://yaml.org/
Vendor: B. Ingerson, C. Evans, O. Ben-Kiki et al.
Packager: OpenPKG Foundation e.V.
Distribution: OpenPKG Community
Class: PLUS
Group: Language
License: BSD/Artistic
Version: 20061126
Release: 20061126
# package options
%option with_perl no
%option with_php no
%option with_ruby no
# list of sources
Source0: http://rubyforge-files.ruby-forum.com/syck/syck-%{V_libsyck}.tar.gz
Source1: http://pyyaml.org/download/libyaml/yaml-%{V_libyaml}.tar.gz
Source2: http://www.cpan.org/modules/by-module/YAML/YAML-%{V_perl_yaml}.tar.gz
Source3: http://www.cpan.org/modules/by-module/YAML/YAML-Syck-%{V_perl_yaml_syck}.tar.gz
Source4: http://www.cpan.org/modules/by-module/YAML/YAML-Tiny-%{V_perl_yaml_tiny}.tar.gz
Source5: http://www.cpan.org/modules/by-module/YAML/YAML-AppConfig-%{V_perl_yaml_appconfig}.tar.gz
Source6: http://osdn.dl.sourceforge.net/yaml-javascript/yaml-javascript-%{V_yaml_javascript}.tar.gz
Source7: http://yaml.org/spec/history/%{V_yaml_spec}/%{V_yaml_spec}.pdf
Source8: yaml.yml
Patch0: yaml.patch
# build information
Prefix: %{l_prefix}
BuildRoot: %{l_buildroot}
BuildPreReq: OpenPKG, openpkg >= 20040130, make
PreReq: OpenPKG, openpkg >= 20040130
%if "%{with_perl}" == "yes"
BuildPreReq: perl, perl-openpkg
PreReq: perl
%endif
%if "%{with_php}" == "yes"
BuildPreReq: php
PreReq: php
%endif
%if "%{with_ruby}" == "yes"
BuildPreReq: ruby
PreReq: ruby
%endif
AutoReq: no
AutoReqProv: no
%description
YAML Ain't Markup Language (YAML) is an international collaboration
to make a sophisticated data serialization language which is both
human readable and computationally powerful. This OpenPKG package
provides C, and JavaScript plus optionally Perl, PHP, and Ruby APIs
for the generation and parsing of YAML.
%track
prog yaml:libsyck = {
version = %{V_libsyck}
url = http://whytheluckystiff.net/syck/
regex = syck-(__VER__)\.tar\.gz
}
prog yaml:libyaml = {
version = %{V_libyaml}
url = http://pyyaml.org/wiki/LibYAML
regex = yaml-(__VER__)\.tar\.gz
}
prog yaml:YAML = {
version = %{V_perl_yaml}
url = http://www.cpan.org/modules/by-module/YAML/
regex = YAML-(__VER__)\.tar\.gz
}
prog yaml:YAML-Syck = {
version = %{V_perl_yaml_syck}
url = http://www.cpan.org/modules/by-module/YAML/
regex = YAML-Syck-(__VER__)\.tar\.gz
}
prog yaml:YAML-Tiny = {
version = %{V_perl_yaml_tiny}
url = http://www.cpan.org/modules/by-module/YAML/
regex = YAML-Tiny-(__VER__)\.tar\.gz
}
prog yaml:YAML-AppConfig = {
version = %{V_perl_yaml_appconfig}
url = http://www.cpan.org/modules/by-module/YAML/
regex = YAML-AppConfig-(__VER__)\.tar\.gz
}
prog yaml:yaml-javascript = {
version = %{V_perl_yaml_appconfig}
url = http://prdownloads.sourceforge.net/yaml-javascript/
regex = yaml-javascript-(__VER__)\.tar\.gz
}
prog yaml:yaml-spec = {
version = %{V_yaml_spec}
url = http://yaml.org/spec/
regex = (\d{4}-\d{2}-\d{2})\.pdf
}
%prep
%setup -q -c
%setup -q -T -D -a 1
%setup -q -T -D -a 2
%setup -q -T -D -a 3
%setup -q -T -D -a 4
%setup -q -T -D -a 5
%setup -q -T -D -a 6
%patch -p0
%build
# build YAML C API
( cd yaml-%{V_libyaml}
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
./configure \
--prefix=%{l_prefix} \
--disable-shared
%{l_make} %{l_mflags -O}
) || exit $?
# build Syck C API
( cd syck-%{V_libsyck}
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
./configure \
--prefix=%{l_prefix} \
--disable-shared
%{l_make} %{l_mflags -O}
) || exit $?
# build PHP API
%if "%{with_php}" == "yes"
( cd syck-%{V_libsyck}/ext/php
%{l_prefix}/bin/phpize
CC="%{l_cc}" \
CFLAGS="%{l_cflags -O}" \
CPPFLAGS="-I`pwd`/../../lib" \
LDFLAGS="-L`pwd`/../../lib" \
./configure \
--with-syck=`pwd`/../..
) || exit $?
%endif
# build Ruby API
%if "%{with_ruby}" == "yes"
( cd syck-%{V_libsyck}/ext/ruby
%{l_prefix}/bin/ruby install.rb config --prefix=%{l_prefix}
%{l_prefix}/bin/ruby install.rb setup
) || exit $?
%endif
# build Perl API
%if "%{with_perl}" == "yes"
%{l_prefix}/bin/perl-openpkg prepare
%{l_prefix}/bin/perl-openpkg -d YAML-%{V_perl_yaml} configure build
%{l_prefix}/bin/perl-openpkg -d YAML-Syck-%{V_perl_yaml_syck} configure build
%{l_prefix}/bin/perl-openpkg -d YAML-Tiny-%{V_perl_yaml_tiny} configure build
%{l_prefix}/bin/perl-openpkg -d YAML-AppConfig-%{V_perl_yaml_appconfig} configure build
%endif
%install
rm -rf $RPM_BUILD_ROOT
# install YAML C API
( cd yaml-%{V_libyaml}
%{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
) || exit $?
# install Syck C API
( cd syck-%{V_libsyck}
%{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
) || exit $?
# install PHP API
%if "%{with_php}" == "yes"
( cd syck-%{V_libsyck}/ext/php
%{l_make} %{l_mflags} install INSTALL_ROOT=$RPM_BUILD_ROOT
) || exit $?
%endif
# install Ruby API
%if "%{with_ruby}" == "yes"
( cd syck-%{V_libsyck}/ext/ruby
%{l_prefix}/bin/ruby install.rb install --prefix=$RPM_BUILD_ROOT
) || exit $?
%endif
# install Perl API
%if "%{with_perl}" == "yes"
%{l_prefix}/bin/perl-openpkg -d YAML-%{V_perl_yaml} install
%{l_prefix}/bin/perl-openpkg -d YAML-Syck-%{V_perl_yaml_syck} install
%{l_prefix}/bin/perl-openpkg -d YAML-Tiny-%{V_perl_yaml_tiny} install
%{l_prefix}/bin/perl-openpkg -d YAML-AppConfig-%{V_perl_yaml_appconfig} install
%{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
%else
>perl-openpkg-files
%endif
# install JavaScript API
%{l_shtool} mkdir -f -p -m 755 \
$RPM_BUILD_ROOT%{l_prefix}/share/yaml
%{l_shtool} install -c -m 644 \
yaml-javascript-%{V_yaml_javascript}/yaml_dumper.js \
$RPM_BUILD_ROOT%{l_prefix}/share/yaml/
# install YAML specification and quick reference
%{l_shtool} install -c -m 644 \
%{SOURCE %{V_yaml_spec}.pdf} \
$RPM_BUILD_ROOT%{l_prefix}/share/yaml/yaml.pdf
%{l_shtool} install -c -m 644 \
%{SOURCE yaml.yml} \
$RPM_BUILD_ROOT%{l_prefix}/share/yaml/
# determine installation files
%{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
%{l_files_std} `cat perl-openpkg-files`
%files -f files
%clean
rm -rf $RPM_BUILD_ROOT