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.

michael@303 1 ##
michael@303 2 ## json.spec -- OpenPKG RPM Package Specification
michael@303 3 ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
michael@303 4 ##
michael@303 5 ## Permission to use, copy, modify, and distribute this software for
michael@303 6 ## any purpose with or without fee is hereby granted, provided that
michael@303 7 ## the above copyright notice and this permission notice appear in all
michael@303 8 ## copies.
michael@303 9 ##
michael@303 10 ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
michael@303 11 ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
michael@303 12 ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
michael@303 13 ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
michael@303 14 ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
michael@303 15 ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
michael@303 16 ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
michael@303 17 ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
michael@303 18 ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
michael@303 19 ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
michael@303 20 ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
michael@303 21 ## SUCH DAMAGE.
michael@303 22 ##
michael@303 23
michael@303 24 # package version
michael@303 25 %define V_api_c 0.9
michael@303 26 %define V_api_c2 1.1.0
michael@694 27 %define V_api_c3 0.8
michael@694 28 %define V_api_pl1 2.53
michael@694 29 %define V_api_pl2 0.47
michael@694 30 %define V_api_pl3 2.33
michael@304 31 %define V_api_pl4 0.011
michael@694 32 %define V_api_js1 20091209
michael@694 33 %define V_api_js2 20091209
michael@303 34
michael@303 35 # package information
michael@303 36 Name: json
michael@303 37 Summary: JavaScript Object Notation (JSON)
michael@303 38 URL: http://www.json.org/
michael@303 39 Vendor: D. Crockford et al.
michael@303 40 Packager: OpenPKG Foundation e.V.
michael@303 41 Distribution: OpenPKG Community
michael@303 42 Class: PLUS
michael@303 43 Group: Language
michael@303 44 License: Open Source
michael@303 45 Version: %{V_api_js2}
michael@694 46 Release: 20120800
michael@303 47
michael@303 48 # list of sources
michael@303 49 Source0: http://oss.metaparadigm.com/json-c/json-c-%{V_api_c}.tar.gz
michael@303 50 Source1: http://switch.dl.sourceforge.net/zzjson/zzjson-%{V_api_c2}.tar.gz
michael@303 51 Source2: http://projects.snarc.org/libjson/download/libjson-%{V_api_c3}.tar.bz2
michael@303 52 Source3: http://www.cpan.org/authors/id/M/MA/MAKAMAKA/JSON-%{V_api_pl1}.tar.gz
michael@304 53 Source4: http://www.cpan.org/authors/id/D/DO/DOWENS/JSON-DWIW-%{V_api_pl2}.tar.gz
michael@304 54 Source5: http://www.cpan.org/authors/id/M/ML/MLEHMANN/JSON-XS-%{V_api_pl3}.tar.gz
michael@304 55 Source6: http://www.cpan.org/authors/id/P/PE/PERLER/JavaScript-Dumper-%{V_api_pl4}.tar.gz
michael@304 56 Source7: ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/json-%{V_api_js1}.js
michael@304 57 Source8: ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/json2-%{V_api_js2}.js
michael@304 58 Source9: http://www.ietf.org/rfc/rfc4627.txt
michael@303 59 Patch0: json.patch
michael@303 60
michael@303 61 # build information
michael@694 62 BuildPreReq: OpenPKG, openpkg >= 20100101, perl, perl-openpkg, make
michael@694 63 PreReq: OpenPKG, openpkg >= 20100101, perl
michael@303 64
michael@303 65 %description
michael@303 66 JSON (JavaScript Object Notation) is a lightweight data-interchange
michael@303 67 format. It is easy for humans to read and write. It is easy for
michael@303 68 machines to parse and generate. It is based on a subset of the
michael@303 69 JavaScript Programming Language, Standard ECMA-262 3rd Edition.
michael@303 70 JSON is a text format that is completely language independent but
michael@303 71 uses conventions that are familiar to programmers of the C-family
michael@303 72 of languages. These properties make JSON an ideal data-interchange
michael@303 73 language.
michael@303 74
michael@303 75 %track
michael@303 76 prog json:json-c = {
michael@303 77 version = %{V_api_c}
michael@303 78 url = http://oss.metaparadigm.com/json-c/
michael@303 79 regex = json-c-(__VER__)\.tar\.gz
michael@303 80 }
michael@303 81 prog json:json-c2 = {
michael@303 82 version = %{V_api_c2}
michael@303 83 url = http://sourceforge.net/projects/zzjson/files/
michael@303 84 regex = zzjson-(__VER__)\.tar\.gz
michael@303 85 }
michael@303 86 prog json:json-c3 = {
michael@303 87 version = %{V_api_c3}
michael@303 88 url = http://projects.snarc.org/libjson/download/
michael@303 89 regex = libjson-(__VER__)\.tar\.bz2
michael@303 90 }
michael@303 91 prog json:json-pl1 = {
michael@303 92 version = %{V_api_pl1}
michael@303 93 url = http://www.cpan.org/authors/id/M/MA/MAKAMAKA/
michael@303 94 regex = JSON-(__VER__)\.tar\.gz
michael@303 95 }
michael@303 96 prog json:json-pl2 = {
michael@303 97 version = %{V_api_pl3}
michael@303 98 url = http://www.cpan.org/authors/id/D/DO/DOWENS/
michael@303 99 regex = JSON-DWIW-(__VER__)\.tar\.gz
michael@303 100 }
michael@304 101 prog json:json-pl3 = {
michael@303 102 version = %{V_api_pl4}
michael@303 103 url = http://www.cpan.org/authors/id/M/ML/MLEHMANN/
michael@303 104 regex = JSON-XS-(__VER__)\.tar\.gz
michael@303 105 }
michael@304 106 prog json:json-pl4 = {
michael@303 107 version = %{V_api_pl5}
michael@303 108 url = http://www.cpan.org/authors/id/P/PE/PERLER/
michael@303 109 regex = JavaScript-Dumper-(__VER__)\.tar\.gz
michael@303 110 }
michael@303 111 prog json:json-js1 = {
michael@303 112 version = %{V_api_js1}
michael@303 113 url = ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/
michael@303 114 regex = json-(__VER__)\.js
michael@303 115 }
michael@303 116 prog json:json-js2 = {
michael@303 117 version = %{V_api_js2}
michael@303 118 url = ftp://ftp.openpkg.org/sources/CPY/VERSIONED/json/
michael@303 119 regex = json2-(__VER__)\.js
michael@303 120 }
michael@303 121
michael@303 122 %prep
michael@303 123 %setup -q -c
michael@303 124 %setup -q -T -D -a 1
michael@303 125 %setup -q -T -D -a 2
michael@303 126 %setup -q -T -D -a 3
michael@303 127 %setup -q -T -D -a 4
michael@303 128 %setup -q -T -D -a 5
michael@303 129 %setup -q -T -D -a 6
michael@303 130 cp %{SOURCE json-%{V_api_js1}.js} json.js
michael@303 131 cp %{SOURCE json2-%{V_api_js2}.js} json2.js
michael@303 132 %patch -p0
michael@304 133 %{l_shtool} subst \
michael@304 134 -e 's;\(AM_CFLAGS *=.*\)-Werror *;\1;' \
michael@304 135 json-c-%{V_api_c}/Makefile.in
michael@303 136
michael@303 137 %build
michael@303 138 ( cd json-c-%{V_api_c}
michael@303 139 CC="%{l_cc}" \
michael@303 140 CFLAGS="%{l_cflags -O}" \
michael@303 141 ./configure \
michael@303 142 --prefix=%{l_prefix} \
michael@303 143 --disable-shared
michael@303 144 %{l_make} %{l_mflags -O}
michael@303 145 ) || exit $?
michael@303 146 ( cd zzjson-%{V_api_c2}
michael@303 147 CC="%{l_cc}" \
michael@303 148 %{l_bash} ./buildstatic.sh
michael@303 149 ) || exit $?
michael@303 150 ( cd libjson-%{V_api_c3}
michael@303 151 %{l_make} %{l_mflags} \
michael@303 152 CC="%{l_cc}" \
michael@303 153 CFLAGS="%{l_cflags -O}" \
michael@303 154 libjson.a
michael@303 155 ) || exit $?
michael@303 156 %{l_prefix}/bin/perl-openpkg prepare
michael@303 157 %{l_prefix}/bin/perl-openpkg -d JSON-%{V_api_pl1} configure build
michael@304 158 %{l_prefix}/bin/perl-openpkg -d JSON-DWIW-%{V_api_pl2} configure build
michael@304 159 %{l_prefix}/bin/perl-openpkg -d JSON-XS-%{V_api_pl3} configure build
michael@304 160 %{l_prefix}/bin/perl-openpkg -d JavaScript-Dumper-%{V_api_pl4} configure build
michael@303 161
michael@303 162 %install
michael@303 163 ( cd json-c-%{V_api_c}
michael@303 164 %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
michael@303 165 ) || exit $?
michael@303 166 ( cd zzjson-%{V_api_c2}
michael@303 167 %{l_shtool} install -c -m 644 \
michael@303 168 include/zzjson.h $RPM_BUILD_ROOT%{l_prefix}/include/
michael@303 169 %{l_shtool} install -c -m 644 \
michael@303 170 lib/libzzjson.a $RPM_BUILD_ROOT%{l_prefix}/lib/
michael@303 171 ) || exit $?
michael@303 172 ( cd libjson-%{V_api_c3}
michael@303 173 %{l_shtool} install -c -m 644 \
michael@303 174 json.h $RPM_BUILD_ROOT%{l_prefix}/include/
michael@303 175 %{l_shtool} install -c -m 644 \
michael@303 176 libjson.a $RPM_BUILD_ROOT%{l_prefix}/lib/
michael@303 177 ) || exit $?
michael@303 178 %{l_shtool} mkdir -f -p -m 755 \
michael@303 179 $RPM_BUILD_ROOT%{l_prefix}/share/json
michael@303 180 %{l_shtool} install -c -m 644 \
michael@303 181 json.js json2.js $RPM_BUILD_ROOT%{l_prefix}/share/json/
michael@303 182 %{l_shtool} install -c -m 644 \
michael@303 183 %{SOURCE rfc4627.txt} $RPM_BUILD_ROOT%{l_prefix}/share/json/
michael@303 184 %{l_shtool} mkdir -f -p -m 755 \
michael@303 185 $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d
michael@303 186 ( echo "Alias /openpkg-json/ %{l_prefix}/share/json/"
michael@303 187 echo "<Directory %{l_prefix}/share/json/>"
michael@303 188 echo " Options Indexes"
michael@303 189 echo " AllowOverride none"
michael@303 190 echo " Order allow,deny"
michael@303 191 echo " Allow from all"
michael@303 192 echo "</Directory>"
michael@303 193 ) >json.conf
michael@303 194 %{l_shtool} install -c -m 644 \
michael@303 195 json.conf $RPM_BUILD_ROOT%{l_prefix}/etc/apache/apache.d/
michael@303 196 %{l_prefix}/bin/perl-openpkg -d JSON-%{V_api_pl1} install
michael@304 197 %{l_prefix}/bin/perl-openpkg -d JSON-DWIW-%{V_api_pl2} install
michael@304 198 %{l_prefix}/bin/perl-openpkg -d JSON-XS-%{V_api_pl3} install
michael@304 199 %{l_prefix}/bin/perl-openpkg -d JavaScript-Dumper-%{V_api_pl4} install
michael@303 200 %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
michael@303 201 %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
michael@303 202 %{l_files_std} `cat perl-openpkg-files` \
michael@303 203 '%config %{l_prefix}/etc/apache/apache.d/*'
michael@303 204
michael@303 205 %files -f files
michael@303 206
michael@303 207 %clean
michael@303 208

mercurial