json/json.spec

Sat, 24 Mar 2012 21:40:49 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Sat, 24 Mar 2012 21:40:49 +0100
changeset 414
fd611cde817f
parent 303
2bd9bf3f6f03
child 694
5bd730820c5b
permissions
-rw-r--r--

Introduce many changes to the buildconf and source code including:
(01) clean up, update, and partially update default config files,
(02) seems that Melware is unable to perform release engineering so
update chan_capi to new daily snapshot to solve echo problems,
(03) correct Asterisk inadequate hard coded gmime version check,
(04) force postgresql pthreads linkage to solve build problem,
(05) remove buggy hard coded LibXML configure definitions,
(06) remove local architecture specification to allow GCC
internal logic to determine proper CPU type instead,
(07) remove vendor sound install target causing uncontrolled
downloads and non RPM managed file installation,
(08) solve long outstanding bug in tcptls causing Asterisk
to ignore any intermediate CA certificate signatures,
(09) back out Digium engineering team's bright idea of replacing the
very portable and pervasive POSIX rand(1) with ast_random(), and
then not even implementing it causing all references to fail in
platforms not providing the very new POSIX.1-2008 mkdtemp(3)
function only distributed by BSD and some Linux,
(10) withdraw advanced linker symbol manipulations from SVR5 builds
until either Binutils supports hybrid versioned and anonymous
linker scripts or GCC stops hard coding versioned linker scripts,
(11) correct missing library linkage, some tailored to a specific OS,
(12) remove outdated logic for the no longer distributed gmime-config(1),
(13) remove local gmime buildconf hacks now that Asterisk has corrected
their own build configuration to almost portably support gmime,
(14) solve build problems relating to undetected LibXML paths,
(15) correct erroneous out of tree include definitions,
(16) improve some variable and comment naming,
(17) simplify sound language path hierarchy creation,
and correct australian english installation logic.

     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.3
    28 %define       V_api_pl1 2.16
    29 %define       V_api_pl2 0.39
    30 %define       V_api_pl3 2.26
    31 %define       V_api_pl4 0.011
    32 %define       V_api_js1 20090929
    33 %define       V_api_js2 20090929
    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:      20091120
    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 Prefix:       %{l_prefix}
    63 BuildRoot:    %{l_buildroot}
    64 BuildPreReq:  OpenPKG, openpkg >= 20040130, perl, perl-openpkg, make
    65 PreReq:       OpenPKG, openpkg >= 20040130, perl
    66 AutoReq:      no
    67 AutoReqProv:  no
    69 %description
    70     JSON (JavaScript Object Notation) is a lightweight data-interchange
    71     format. It is easy for humans to read and write. It is easy for
    72     machines to parse and generate. It is based on a subset of the
    73     JavaScript Programming Language, Standard ECMA-262 3rd Edition.
    74     JSON is a text format that is completely language independent but
    75     uses conventions that are familiar to programmers of the C-family
    76     of languages. These properties make JSON an ideal data-interchange
    77     language.
    79 %track
    80     prog json:json-c = {
    81         version   = %{V_api_c}
    82         url       = http://oss.metaparadigm.com/json-c/
    83         regex     = json-c-(__VER__)\.tar\.gz
    84     }
    85     prog json:json-c2 = {
    86         version   = %{V_api_c2}
    87         url       = http://sourceforge.net/projects/zzjson/files/
    88         regex     = zzjson-(__VER__)\.tar\.gz
    89     }
    90     prog json:json-c3 = {
    91         version   = %{V_api_c3}
    92         url       = http://projects.snarc.org/libjson/download/
    93         regex     = libjson-(__VER__)\.tar\.bz2
    94     }
    95     prog json:json-pl1 = {
    96         version   = %{V_api_pl1}
    97         url       = http://www.cpan.org/authors/id/M/MA/MAKAMAKA/
    98         regex     = JSON-(__VER__)\.tar\.gz
    99     }
   100     prog json:json-pl2 = {
   101         version   = %{V_api_pl3}
   102         url       = http://www.cpan.org/authors/id/D/DO/DOWENS/
   103         regex     = JSON-DWIW-(__VER__)\.tar\.gz
   104     }
   105     prog json:json-pl3 = {
   106         version   = %{V_api_pl4}
   107         url       = http://www.cpan.org/authors/id/M/ML/MLEHMANN/
   108         regex     = JSON-XS-(__VER__)\.tar\.gz
   109     }
   110     prog json:json-pl4 = {
   111         version   = %{V_api_pl5}
   112         url       = http://www.cpan.org/authors/id/P/PE/PERLER/
   113         regex     = JavaScript-Dumper-(__VER__)\.tar\.gz
   114     }
   115     prog json:json-js1 = {
   116         version   = %{V_api_js1}
   117         url       = ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/
   118         regex     = json-(__VER__)\.js
   119     }
   120     prog json:json-js2 = {
   121         version   = %{V_api_js2}
   122         url       = ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/
   123         regex     = json2-(__VER__)\.js
   124     }
   126 %prep
   127     %setup -q -c
   128     %setup -q -T -D -a 1
   129     %setup -q -T -D -a 2
   130     %setup -q -T -D -a 3
   131     %setup -q -T -D -a 4
   132     %setup -q -T -D -a 5
   133     %setup -q -T -D -a 6
   134     cp %{SOURCE json-%{V_api_js1}.js} json.js
   135     cp %{SOURCE json2-%{V_api_js2}.js} json2.js
   136     %patch -p0
   137     %{l_shtool} subst \
   138         -e 's;\(AM_CFLAGS *=.*\)-Werror *;\1;' \
   139         json-c-%{V_api_c}/Makefile.in
   141 %build
   142     ( cd json-c-%{V_api_c}
   143       CC="%{l_cc}" \
   144       CFLAGS="%{l_cflags -O}" \
   145       ./configure \
   146           --prefix=%{l_prefix} \
   147           --disable-shared
   148       %{l_make} %{l_mflags -O}
   149     ) || exit $?
   150     ( cd zzjson-%{V_api_c2}
   151       CC="%{l_cc}" \
   152       %{l_bash} ./buildstatic.sh
   153     ) || exit $?
   154     ( cd libjson-%{V_api_c3}
   155       %{l_make} %{l_mflags} \
   156           CC="%{l_cc}" \
   157           CFLAGS="%{l_cflags -O}" \
   158           libjson.a
   159     ) || exit $?
   160     %{l_prefix}/bin/perl-openpkg prepare
   161     %{l_prefix}/bin/perl-openpkg -d JSON-%{V_api_pl1} configure build
   162     %{l_prefix}/bin/perl-openpkg -d JSON-DWIW-%{V_api_pl2} configure build
   163     %{l_prefix}/bin/perl-openpkg -d JSON-XS-%{V_api_pl3} configure build
   164     %{l_prefix}/bin/perl-openpkg -d JavaScript-Dumper-%{V_api_pl4} configure build
   166 %install
   167     rm -rf $RPM_BUILD_ROOT
   168     ( cd json-c-%{V_api_c}
   169       %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
   170     ) || exit $?
   171     ( cd zzjson-%{V_api_c2}
   172       %{l_shtool} install -c -m 644 \
   173           include/zzjson.h $RPM_BUILD_ROOT%{l_prefix}/include/
   174       %{l_shtool} install -c -m 644 \
   175           lib/libzzjson.a $RPM_BUILD_ROOT%{l_prefix}/lib/
   176     ) || exit $?
   177     ( cd libjson-%{V_api_c3}
   178       %{l_shtool} install -c -m 644 \
   179           json.h $RPM_BUILD_ROOT%{l_prefix}/include/
   180       %{l_shtool} install -c -m 644 \
   181           libjson.a $RPM_BUILD_ROOT%{l_prefix}/lib/
   182     ) || exit $?
   183     %{l_shtool} mkdir -f -p -m 755 \
   184         $RPM_BUILD_ROOT%{l_prefix}/share/json
   185     %{l_shtool} install -c -m 644 \
   186         json.js json2.js $RPM_BUILD_ROOT%{l_prefix}/share/json/
   187     %{l_shtool} install -c -m 644 \
   188         %{SOURCE rfc4627.txt} $RPM_BUILD_ROOT%{l_prefix}/share/json/
   189     %{l_shtool} mkdir -f -p -m 755 \
   190         $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d
   191     ( echo "Alias /openpkg-json/ %{l_prefix}/share/json/"
   192       echo "<Directory %{l_prefix}/share/json/>"
   193       echo "    Options       Indexes"
   194       echo "    AllowOverride none"
   195       echo "    Order         allow,deny"
   196       echo "    Allow         from all"
   197       echo "</Directory>"
   198     ) >json.conf
   199     %{l_shtool} install -c -m 644 \
   200         json.conf $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/
   201     %{l_prefix}/bin/perl-openpkg -d JSON-%{V_api_pl1} install
   202     %{l_prefix}/bin/perl-openpkg -d JSON-DWIW-%{V_api_pl2} install
   203     %{l_prefix}/bin/perl-openpkg -d JSON-XS-%{V_api_pl3} install
   204     %{l_prefix}/bin/perl-openpkg -d JavaScript-Dumper-%{V_api_pl4} install
   205     %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
   206     %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
   207         %{l_files_std} `cat perl-openpkg-files` \
   208         '%config %{l_prefix}/etc/apache/apache.d/*'
   210 %files -f files
   212 %clean
   213     rm -rf $RPM_BUILD_ROOT

mercurial