json/json.spec

Mon, 28 Jan 2013 17:37:18 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Mon, 28 Jan 2013 17:37:18 +0100
changeset 758
a2c6460cfb16
parent 304
fbf6cb91be09
permissions
-rw-r--r--

Correct socket error reporting improvement with IPv6 portable code,
after helpful recommendation by Saúl Ibarra Corretgé on OSips devlist.

     1 ##
     2 ##  json.spec -- OpenPKG RPM Package Specification
     3 ##  Copyright (c) 2000-2009 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_api_c   0.9
    26 %define       V_api_c2  1.1.0
    27 %define       V_api_c3  0.8
    28 %define       V_api_pl1 2.53
    29 %define       V_api_pl2 0.47
    30 %define       V_api_pl3 2.33
    31 %define       V_api_pl4 0.011
    32 %define       V_api_js1 20091209
    33 %define       V_api_js2 20091209
    35 #   package information
    36 Name:         json
    37 Summary:      JavaScript Object Notation (JSON)
    38 URL:          http://www.json.org/
    39 Vendor:       D. Crockford et al.
    40 Packager:     OpenPKG Foundation e.V.
    41 Distribution: OpenPKG Community
    42 Class:        PLUS
    43 Group:        Language
    44 License:      Open Source
    45 Version:      %{V_api_js2}
    46 Release:      20120800
    48 #   list of sources
    49 Source0:      http://oss.metaparadigm.com/json-c/json-c-%{V_api_c}.tar.gz
    50 Source1:      http://switch.dl.sourceforge.net/zzjson/zzjson-%{V_api_c2}.tar.gz
    51 Source2:      http://projects.snarc.org/libjson/download/libjson-%{V_api_c3}.tar.bz2
    52 Source3:      http://www.cpan.org/authors/id/M/MA/MAKAMAKA/JSON-%{V_api_pl1}.tar.gz
    53 Source4:      http://www.cpan.org/authors/id/D/DO/DOWENS/JSON-DWIW-%{V_api_pl2}.tar.gz
    54 Source5:      http://www.cpan.org/authors/id/M/ML/MLEHMANN/JSON-XS-%{V_api_pl3}.tar.gz
    55 Source6:      http://www.cpan.org/authors/id/P/PE/PERLER/JavaScript-Dumper-%{V_api_pl4}.tar.gz
    56 Source7:      ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/json-%{V_api_js1}.js
    57 Source8:      ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/json2-%{V_api_js2}.js
    58 Source9:      http://www.ietf.org/rfc/rfc4627.txt
    59 Patch0:       json.patch
    61 #   build information
    62 BuildPreReq:  OpenPKG, openpkg >= 20100101, perl, perl-openpkg, make
    63 PreReq:       OpenPKG, openpkg >= 20100101, perl
    65 %description
    66     JSON (JavaScript Object Notation) is a lightweight data-interchange
    67     format. It is easy for humans to read and write. It is easy for
    68     machines to parse and generate. It is based on a subset of the
    69     JavaScript Programming Language, Standard ECMA-262 3rd Edition.
    70     JSON is a text format that is completely language independent but
    71     uses conventions that are familiar to programmers of the C-family
    72     of languages. These properties make JSON an ideal data-interchange
    73     language.
    75 %track
    76     prog json:json-c = {
    77         version   = %{V_api_c}
    78         url       = http://oss.metaparadigm.com/json-c/
    79         regex     = json-c-(__VER__)\.tar\.gz
    80     }
    81     prog json:json-c2 = {
    82         version   = %{V_api_c2}
    83         url       = http://sourceforge.net/projects/zzjson/files/
    84         regex     = zzjson-(__VER__)\.tar\.gz
    85     }
    86     prog json:json-c3 = {
    87         version   = %{V_api_c3}
    88         url       = http://projects.snarc.org/libjson/download/
    89         regex     = libjson-(__VER__)\.tar\.bz2
    90     }
    91     prog json:json-pl1 = {
    92         version   = %{V_api_pl1}
    93         url       = http://www.cpan.org/authors/id/M/MA/MAKAMAKA/
    94         regex     = JSON-(__VER__)\.tar\.gz
    95     }
    96     prog json:json-pl2 = {
    97         version   = %{V_api_pl3}
    98         url       = http://www.cpan.org/authors/id/D/DO/DOWENS/
    99         regex     = JSON-DWIW-(__VER__)\.tar\.gz
   100     }
   101     prog json:json-pl3 = {
   102         version   = %{V_api_pl4}
   103         url       = http://www.cpan.org/authors/id/M/ML/MLEHMANN/
   104         regex     = JSON-XS-(__VER__)\.tar\.gz
   105     }
   106     prog json:json-pl4 = {
   107         version   = %{V_api_pl5}
   108         url       = http://www.cpan.org/authors/id/P/PE/PERLER/
   109         regex     = JavaScript-Dumper-(__VER__)\.tar\.gz
   110     }
   111     prog json:json-js1 = {
   112         version   = %{V_api_js1}
   113         url       = ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/
   114         regex     = json-(__VER__)\.js
   115     }
   116     prog json:json-js2 = {
   117         version   = %{V_api_js2}
   118         url       = ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/
   119         regex     = json2-(__VER__)\.js
   120     }
   122 %prep
   123     %setup -q -c
   124     %setup -q -T -D -a 1
   125     %setup -q -T -D -a 2
   126     %setup -q -T -D -a 3
   127     %setup -q -T -D -a 4
   128     %setup -q -T -D -a 5
   129     %setup -q -T -D -a 6
   130     cp %{SOURCE json-%{V_api_js1}.js} json.js
   131     cp %{SOURCE json2-%{V_api_js2}.js} json2.js
   132     %patch -p0
   133     %{l_shtool} subst \
   134         -e 's;\(AM_CFLAGS *=.*\)-Werror *;\1;' \
   135         json-c-%{V_api_c}/Makefile.in
   137 %build
   138     ( cd json-c-%{V_api_c}
   139       CC="%{l_cc}" \
   140       CFLAGS="%{l_cflags -O}" \
   141       ./configure \
   142           --prefix=%{l_prefix} \
   143           --disable-shared
   144       %{l_make} %{l_mflags -O}
   145     ) || exit $?
   146     ( cd zzjson-%{V_api_c2}
   147       CC="%{l_cc}" \
   148       %{l_bash} ./buildstatic.sh
   149     ) || exit $?
   150     ( cd libjson-%{V_api_c3}
   151       %{l_make} %{l_mflags} \
   152           CC="%{l_cc}" \
   153           CFLAGS="%{l_cflags -O}" \
   154           libjson.a
   155     ) || exit $?
   156     %{l_prefix}/bin/perl-openpkg prepare
   157     %{l_prefix}/bin/perl-openpkg -d JSON-%{V_api_pl1} configure build
   158     %{l_prefix}/bin/perl-openpkg -d JSON-DWIW-%{V_api_pl2} configure build
   159     %{l_prefix}/bin/perl-openpkg -d JSON-XS-%{V_api_pl3} configure build
   160     %{l_prefix}/bin/perl-openpkg -d JavaScript-Dumper-%{V_api_pl4} configure build
   162 %install
   163     ( cd json-c-%{V_api_c}
   164       %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
   165     ) || exit $?
   166     ( cd zzjson-%{V_api_c2}
   167       %{l_shtool} install -c -m 644 \
   168           include/zzjson.h $RPM_BUILD_ROOT%{l_prefix}/include/
   169       %{l_shtool} install -c -m 644 \
   170           lib/libzzjson.a $RPM_BUILD_ROOT%{l_prefix}/lib/
   171     ) || exit $?
   172     ( cd libjson-%{V_api_c3}
   173       %{l_shtool} install -c -m 644 \
   174           json.h $RPM_BUILD_ROOT%{l_prefix}/include/
   175       %{l_shtool} install -c -m 644 \
   176           libjson.a $RPM_BUILD_ROOT%{l_prefix}/lib/
   177     ) || exit $?
   178     %{l_shtool} mkdir -f -p -m 755 \
   179         $RPM_BUILD_ROOT%{l_prefix}/share/json
   180     %{l_shtool} install -c -m 644 \
   181         json.js json2.js $RPM_BUILD_ROOT%{l_prefix}/share/json/
   182     %{l_shtool} install -c -m 644 \
   183         %{SOURCE rfc4627.txt} $RPM_BUILD_ROOT%{l_prefix}/share/json/
   184     %{l_shtool} mkdir -f -p -m 755 \
   185         $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d
   186     ( echo "Alias /openpkg-json/ %{l_prefix}/share/json/"
   187       echo "<Directory %{l_prefix}/share/json/>"
   188       echo "    Options       Indexes"
   189       echo "    AllowOverride none"
   190       echo "    Order         allow,deny"
   191       echo "    Allow         from all"
   192       echo "</Directory>"
   193     ) >json.conf
   194     %{l_shtool} install -c -m 644 \
   195         json.conf $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/
   196     %{l_prefix}/bin/perl-openpkg -d JSON-%{V_api_pl1} install
   197     %{l_prefix}/bin/perl-openpkg -d JSON-DWIW-%{V_api_pl2} install
   198     %{l_prefix}/bin/perl-openpkg -d JSON-XS-%{V_api_pl3} install
   199     %{l_prefix}/bin/perl-openpkg -d JavaScript-Dumper-%{V_api_pl4} install
   200     %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
   201     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   202         %{l_files_std} `cat perl-openpkg-files` \
   203         '%config %{l_prefix}/etc/apache/apache.d/*'
   205 %files -f files
   207 %clean

mercurial