[4878] | 1 | %define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0} |
---|
| 2 | |
---|
[12401] | 3 | %define pkg_version 0.14 |
---|
| 4 | %define pkg_date 20200419 |
---|
[4876] | 5 | |
---|
| 6 | Summary: A JSON implementation in C |
---|
| 7 | Name: json-c |
---|
| 8 | Version: %{pkg_version} |
---|
[12401] | 9 | Release: 1%{?_dist_release} |
---|
| 10 | Group: System Environment/Libraries |
---|
| 11 | Vendor: Project Vine |
---|
| 12 | Distribution: Vine Linux |
---|
[4876] | 13 | |
---|
| 14 | |
---|
| 15 | License: MIT |
---|
[12005] | 16 | URL: https://github.com/json-c/json-c/wiki |
---|
[12401] | 17 | Source0: https://github.com/json-c/json-c/archive/json-c-%{version}-%{pkg_date}.tar.gz |
---|
| 18 | Patch1000: CVE-2020-12762.patch |
---|
[4876] | 19 | |
---|
| 20 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
---|
[12401] | 21 | BuildRequires: cmake |
---|
[4876] | 22 | |
---|
| 23 | |
---|
| 24 | %description |
---|
| 25 | JSON-C implements a reference counting object model that allows you to easily |
---|
| 26 | construct JSON objects in C, output them as JSON formatted strings and parse |
---|
| 27 | JSON formatted strings back into the C representation of JSON objects. |
---|
| 28 | |
---|
| 29 | |
---|
| 30 | %package devel |
---|
| 31 | Summary: Development files for json-c |
---|
| 32 | Group: Development/Libraries |
---|
| 33 | Requires: %{name} = %{version}-%{release} |
---|
| 34 | Requires: pkgconfig |
---|
| 35 | |
---|
| 36 | %description devel |
---|
| 37 | This package contains the libraries and header files that are needed |
---|
| 38 | for writing applications that are using json-c. |
---|
| 39 | |
---|
| 40 | |
---|
| 41 | %package doc |
---|
| 42 | Summary: Documentation for json-c |
---|
| 43 | Group: Documentation |
---|
| 44 | Requires: %{name} = %{version}-%{release} |
---|
| 45 | BuildArch: noarch |
---|
| 46 | |
---|
| 47 | %description doc |
---|
| 48 | This package contains documentation for json-c. |
---|
| 49 | |
---|
| 50 | |
---|
[4878] | 51 | %package -n compat32-%{name} |
---|
| 52 | Summary: A JSON implementation in C |
---|
| 53 | Group: System Environment/Libraries |
---|
| 54 | Requires: %{name} = %{version}-%{release} |
---|
| 55 | |
---|
| 56 | %description -n compat32-%{name} |
---|
| 57 | JSON-C implements a reference counting object model that allows you to easily |
---|
| 58 | construct JSON objects in C, output them as JSON formatted strings and parse |
---|
| 59 | JSON formatted strings back into the C representation of JSON objects. |
---|
| 60 | |
---|
| 61 | %package -n compat32-%{name}-devel |
---|
| 62 | Summary: Development files for json-c |
---|
| 63 | Group: Development/Libraries |
---|
| 64 | Requires: compat32-%{name} = %{version}-%{release} |
---|
| 65 | Requires: pkgconfig |
---|
| 66 | |
---|
| 67 | %description -n compat32-%{name}-devel |
---|
| 68 | This package contains the libraries and header files that are needed |
---|
| 69 | for writing applications that are using json-c. |
---|
| 70 | |
---|
| 71 | |
---|
[4876] | 72 | %prep |
---|
[12005] | 73 | %setup -q -n json-c-json-c-%{version}-%{pkg_date} |
---|
[12401] | 74 | %patch1000 -p1 |
---|
[4876] | 75 | |
---|
[7171] | 76 | |
---|
[4876] | 77 | %build |
---|
[12401] | 78 | mkdir -p build |
---|
| 79 | pushd build |
---|
| 80 | %cmake \ |
---|
| 81 | -DBUILD_SHARED_LIBS=ON \ |
---|
| 82 | -DBUILD_STATIC_LIBS=OFF \ |
---|
| 83 | -DENABLE_RDRAND=ON \ |
---|
| 84 | ../ |
---|
| 85 | make %{_smp_mflags} |
---|
| 86 | popd |
---|
[4876] | 87 | |
---|
[12401] | 88 | |
---|
[4876] | 89 | %install |
---|
| 90 | %{__rm} -rf $RPM_BUILD_ROOT |
---|
[12401] | 91 | pushd build |
---|
[4876] | 92 | %{__make} install DESTDIR=$RPM_BUILD_ROOT |
---|
| 93 | |
---|
| 94 | %{__rm} -f $RPM_BUILD_ROOT%{_libdir}/*.la |
---|
[12401] | 95 | popd |
---|
[4876] | 96 | |
---|
[12401] | 97 | |
---|
| 98 | %check |
---|
| 99 | pushd build |
---|
| 100 | make %{_smp_mflags} test |
---|
| 101 | popd |
---|
| 102 | |
---|
| 103 | |
---|
[4876] | 104 | %clean |
---|
| 105 | %{__rm} -rf $RPM_BUILD_ROOT |
---|
| 106 | |
---|
[12401] | 107 | |
---|
[4876] | 108 | %post -p /sbin/ldconfig |
---|
| 109 | |
---|
| 110 | %postun -p /sbin/ldconfig |
---|
| 111 | |
---|
[4878] | 112 | %post -n compat32-%{name} -p /sbin/ldconfig |
---|
| 113 | |
---|
| 114 | %postun -n compat32-%{name} -p /sbin/ldconfig |
---|
| 115 | |
---|
[12401] | 116 | |
---|
[4876] | 117 | %files |
---|
| 118 | %defattr(-,root,root,-) |
---|
[12005] | 119 | %license COPYING |
---|
| 120 | %doc AUTHORS ChangeLog NEWS README* |
---|
[9311] | 121 | %{_libdir}/libjson-c.so.* |
---|
[4876] | 122 | |
---|
| 123 | %files devel |
---|
| 124 | %defattr(-,root,root,-) |
---|
[12005] | 125 | %dir %{_includedir}/json-c |
---|
[9311] | 126 | %{_includedir}/json-c/* |
---|
| 127 | %{_libdir}/libjson-c.so |
---|
| 128 | %{_libdir}/pkgconfig/json-c.pc |
---|
[12401] | 129 | %dir %{_libdir}/cmake/json-c |
---|
| 130 | %{_libdir}/cmake/json-c/*.cmake |
---|
[4876] | 131 | |
---|
| 132 | %files doc |
---|
| 133 | %defattr(-,root,root,-) |
---|
| 134 | %doc doc/html/* |
---|
| 135 | |
---|
[4878] | 136 | %if %{build_compat32} |
---|
| 137 | %files -n compat32-%{name} |
---|
| 138 | %defattr(-,root,root,-) |
---|
[9311] | 139 | %{_libdir}/libjson-c.so.* |
---|
[4876] | 140 | |
---|
[4878] | 141 | %files -n compat32-%{name}-devel |
---|
| 142 | %defattr(-,root,root,-) |
---|
[9311] | 143 | %{_libdir}/libjson-c.so |
---|
[4878] | 144 | %endif |
---|
| 145 | |
---|
| 146 | |
---|
[4876] | 147 | %changelog |
---|
[12401] | 148 | * Sat May 16 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.14-1 |
---|
| 149 | - updated to 0.14. |
---|
| 150 | - added Patch1000 to fix CVE-2020-12762. |
---|
| 151 | |
---|
[12005] | 152 | * Tue Jan 01 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.13.1-1 |
---|
[12401] | 153 | - updated to 0.13.1. |
---|
[12005] | 154 | |
---|
[9311] | 155 | * Sat Jan 17 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 0.11-1 |
---|
| 156 | - update to 0.11 |
---|
| 157 | |
---|
[7171] | 158 | * Wed Nov 28 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.10-1 |
---|
| 159 | - update to 0.10 |
---|
| 160 | - update URL |
---|
| 161 | |
---|
[4878] | 162 | * Sat Oct 08 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9-2 |
---|
| 163 | - create compat32 sub packages |
---|
| 164 | |
---|
[4876] | 165 | * Fri Oct 07 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9-1 |
---|
| 166 | - initial build for Vine Linux |
---|
| 167 | |
---|