michael@303: ##
michael@303: ## json.spec -- OpenPKG RPM Package Specification
michael@303: ## Copyright (c) 2000-2009 OpenPKG Foundation e.V.
michael@303: ##
michael@303: ## Permission to use, copy, modify, and distribute this software for
michael@303: ## any purpose with or without fee is hereby granted, provided that
michael@303: ## the above copyright notice and this permission notice appear in all
michael@303: ## copies.
michael@303: ##
michael@303: ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@303: ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@303: ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@303: ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@303: ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@303: ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@303: ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@303: ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@303: ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@303: ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@303: ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@303: ## SUCH DAMAGE.
michael@303: ##
michael@303:
michael@303: # package version
michael@303: %define V_api_c 0.9
michael@303: %define V_api_c2 1.1.0
michael@303: %define V_api_c3 0.3
michael@303: %define V_api_pl1 2.16
michael@304: %define V_api_pl2 0.39
michael@304: %define V_api_pl3 2.26
michael@304: %define V_api_pl4 0.011
michael@303: %define V_api_js1 20090929
michael@303: %define V_api_js2 20090929
michael@303:
michael@303: # package information
michael@303: Name: json
michael@303: Summary: JavaScript Object Notation (JSON)
michael@303: URL: http://www.json.org/
michael@303: Vendor: D. Crockford et al.
michael@303: Packager: OpenPKG Foundation e.V.
michael@303: Distribution: OpenPKG Community
michael@303: Class: PLUS
michael@303: Group: Language
michael@303: License: Open Source
michael@303: Version: %{V_api_js2}
michael@304: Release: 20091120
michael@303:
michael@303: # list of sources
michael@303: Source0: http://oss.metaparadigm.com/json-c/json-c-%{V_api_c}.tar.gz
michael@303: Source1: http://switch.dl.sourceforge.net/zzjson/zzjson-%{V_api_c2}.tar.gz
michael@303: Source2: http://projects.snarc.org/libjson/download/libjson-%{V_api_c3}.tar.bz2
michael@303: Source3: http://www.cpan.org/authors/id/M/MA/MAKAMAKA/JSON-%{V_api_pl1}.tar.gz
michael@304: Source4: http://www.cpan.org/authors/id/D/DO/DOWENS/JSON-DWIW-%{V_api_pl2}.tar.gz
michael@304: Source5: http://www.cpan.org/authors/id/M/ML/MLEHMANN/JSON-XS-%{V_api_pl3}.tar.gz
michael@304: Source6: http://www.cpan.org/authors/id/P/PE/PERLER/JavaScript-Dumper-%{V_api_pl4}.tar.gz
michael@304: Source7: ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/json-%{V_api_js1}.js
michael@304: Source8: ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/json2-%{V_api_js2}.js
michael@304: Source9: http://www.ietf.org/rfc/rfc4627.txt
michael@303: Patch0: json.patch
michael@303:
michael@303: # build information
michael@303: Prefix: %{l_prefix}
michael@303: BuildRoot: %{l_buildroot}
michael@303: BuildPreReq: OpenPKG, openpkg >= 20040130, perl, perl-openpkg, make
michael@303: PreReq: OpenPKG, openpkg >= 20040130, perl
michael@303: AutoReq: no
michael@303: AutoReqProv: no
michael@303:
michael@303: %description
michael@303: JSON (JavaScript Object Notation) is a lightweight data-interchange
michael@303: format. It is easy for humans to read and write. It is easy for
michael@303: machines to parse and generate. It is based on a subset of the
michael@303: JavaScript Programming Language, Standard ECMA-262 3rd Edition.
michael@303: JSON is a text format that is completely language independent but
michael@303: uses conventions that are familiar to programmers of the C-family
michael@303: of languages. These properties make JSON an ideal data-interchange
michael@303: language.
michael@303:
michael@303: %track
michael@303: prog json:json-c = {
michael@303: version = %{V_api_c}
michael@303: url = http://oss.metaparadigm.com/json-c/
michael@303: regex = json-c-(__VER__)\.tar\.gz
michael@303: }
michael@303: prog json:json-c2 = {
michael@303: version = %{V_api_c2}
michael@303: url = http://sourceforge.net/projects/zzjson/files/
michael@303: regex = zzjson-(__VER__)\.tar\.gz
michael@303: }
michael@303: prog json:json-c3 = {
michael@303: version = %{V_api_c3}
michael@303: url = http://projects.snarc.org/libjson/download/
michael@303: regex = libjson-(__VER__)\.tar\.bz2
michael@303: }
michael@303: prog json:json-pl1 = {
michael@303: version = %{V_api_pl1}
michael@303: url = http://www.cpan.org/authors/id/M/MA/MAKAMAKA/
michael@303: regex = JSON-(__VER__)\.tar\.gz
michael@303: }
michael@303: prog json:json-pl2 = {
michael@303: version = %{V_api_pl3}
michael@303: url = http://www.cpan.org/authors/id/D/DO/DOWENS/
michael@303: regex = JSON-DWIW-(__VER__)\.tar\.gz
michael@303: }
michael@304: prog json:json-pl3 = {
michael@303: version = %{V_api_pl4}
michael@303: url = http://www.cpan.org/authors/id/M/ML/MLEHMANN/
michael@303: regex = JSON-XS-(__VER__)\.tar\.gz
michael@303: }
michael@304: prog json:json-pl4 = {
michael@303: version = %{V_api_pl5}
michael@303: url = http://www.cpan.org/authors/id/P/PE/PERLER/
michael@303: regex = JavaScript-Dumper-(__VER__)\.tar\.gz
michael@303: }
michael@303: prog json:json-js1 = {
michael@303: version = %{V_api_js1}
michael@303: url = ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/
michael@303: regex = json-(__VER__)\.js
michael@303: }
michael@303: prog json:json-js2 = {
michael@303: version = %{V_api_js2}
michael@303: url = ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/
michael@303: regex = json2-(__VER__)\.js
michael@303: }
michael@303:
michael@303: %prep
michael@303: %setup -q -c
michael@303: %setup -q -T -D -a 1
michael@303: %setup -q -T -D -a 2
michael@303: %setup -q -T -D -a 3
michael@303: %setup -q -T -D -a 4
michael@303: %setup -q -T -D -a 5
michael@303: %setup -q -T -D -a 6
michael@303: cp %{SOURCE json-%{V_api_js1}.js} json.js
michael@303: cp %{SOURCE json2-%{V_api_js2}.js} json2.js
michael@303: %patch -p0
michael@304: %{l_shtool} subst \
michael@304: -e 's;\(AM_CFLAGS *=.*\)-Werror *;\1;' \
michael@304: json-c-%{V_api_c}/Makefile.in
michael@303:
michael@303: %build
michael@303: ( cd json-c-%{V_api_c}
michael@303: CC="%{l_cc}" \
michael@303: CFLAGS="%{l_cflags -O}" \
michael@303: ./configure \
michael@303: --prefix=%{l_prefix} \
michael@303: --disable-shared
michael@303: %{l_make} %{l_mflags -O}
michael@303: ) || exit $?
michael@303: ( cd zzjson-%{V_api_c2}
michael@303: CC="%{l_cc}" \
michael@303: %{l_bash} ./buildstatic.sh
michael@303: ) || exit $?
michael@303: ( cd libjson-%{V_api_c3}
michael@303: %{l_make} %{l_mflags} \
michael@303: CC="%{l_cc}" \
michael@303: CFLAGS="%{l_cflags -O}" \
michael@303: libjson.a
michael@303: ) || exit $?
michael@303: %{l_prefix}/bin/perl-openpkg prepare
michael@303: %{l_prefix}/bin/perl-openpkg -d JSON-%{V_api_pl1} configure build
michael@304: %{l_prefix}/bin/perl-openpkg -d JSON-DWIW-%{V_api_pl2} configure build
michael@304: %{l_prefix}/bin/perl-openpkg -d JSON-XS-%{V_api_pl3} configure build
michael@304: %{l_prefix}/bin/perl-openpkg -d JavaScript-Dumper-%{V_api_pl4} configure build
michael@303:
michael@303: %install
michael@303: rm -rf $RPM_BUILD_ROOT
michael@303: ( cd json-c-%{V_api_c}
michael@303: %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
michael@303: ) || exit $?
michael@303: ( cd zzjson-%{V_api_c2}
michael@303: %{l_shtool} install -c -m 644 \
michael@303: include/zzjson.h $RPM_BUILD_ROOT%{l_prefix}/include/
michael@303: %{l_shtool} install -c -m 644 \
michael@303: lib/libzzjson.a $RPM_BUILD_ROOT%{l_prefix}/lib/
michael@303: ) || exit $?
michael@303: ( cd libjson-%{V_api_c3}
michael@303: %{l_shtool} install -c -m 644 \
michael@303: json.h $RPM_BUILD_ROOT%{l_prefix}/include/
michael@303: %{l_shtool} install -c -m 644 \
michael@303: libjson.a $RPM_BUILD_ROOT%{l_prefix}/lib/
michael@303: ) || exit $?
michael@303: %{l_shtool} mkdir -f -p -m 755 \
michael@303: $RPM_BUILD_ROOT%{l_prefix}/share/json
michael@303: %{l_shtool} install -c -m 644 \
michael@303: json.js json2.js $RPM_BUILD_ROOT%{l_prefix}/share/json/
michael@303: %{l_shtool} install -c -m 644 \
michael@303: %{SOURCE rfc4627.txt} $RPM_BUILD_ROOT%{l_prefix}/share/json/
michael@303: %{l_shtool} mkdir -f -p -m 755 \
michael@303: $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d
michael@303: ( echo "Alias /openpkg-json/ %{l_prefix}/share/json/"
michael@303: echo ""
michael@303: echo " Options Indexes"
michael@303: echo " AllowOverride none"
michael@303: echo " Order allow,deny"
michael@303: echo " Allow from all"
michael@303: echo ""
michael@303: ) >json.conf
michael@303: %{l_shtool} install -c -m 644 \
michael@303: json.conf $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/
michael@303: %{l_prefix}/bin/perl-openpkg -d JSON-%{V_api_pl1} install
michael@304: %{l_prefix}/bin/perl-openpkg -d JSON-DWIW-%{V_api_pl2} install
michael@304: %{l_prefix}/bin/perl-openpkg -d JSON-XS-%{V_api_pl3} install
michael@304: %{l_prefix}/bin/perl-openpkg -d JavaScript-Dumper-%{V_api_pl4} install
michael@303: %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
michael@303: %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@303: %{l_files_std} `cat perl-openpkg-files` \
michael@303: '%config %{l_prefix}/etc/apache/apache.d/*'
michael@303:
michael@303: %files -f files
michael@303:
michael@303: %clean
michael@303: rm -rf $RPM_BUILD_ROOT
michael@303: