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