| 1 | %define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0} |
|---|
| 2 | |
|---|
| 3 | %define pkg_version 0.14 |
|---|
| 4 | %define pkg_date 20200419 |
|---|
| 5 | |
|---|
| 6 | Summary: A JSON implementation in C |
|---|
| 7 | Name: json-c |
|---|
| 8 | Version: %{pkg_version} |
|---|
| 9 | Release: 1%{?_dist_release} |
|---|
| 10 | Group: System Environment/Libraries |
|---|
| 11 | Vendor: Project Vine |
|---|
| 12 | Distribution: Vine Linux |
|---|
| 13 | |
|---|
| 14 | |
|---|
| 15 | License: MIT |
|---|
| 16 | URL: https://github.com/json-c/json-c/wiki |
|---|
| 17 | Source0: https://github.com/json-c/json-c/archive/json-c-%{version}-%{pkg_date}.tar.gz |
|---|
| 18 | Patch1000: CVE-2020-12762.patch |
|---|
| 19 | |
|---|
| 20 | BuildRoot: %{_tmppath}/%{name}-%{version}-root |
|---|
| 21 | BuildRequires: cmake |
|---|
| 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 | |
|---|
| 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 | |
|---|
| 72 | %prep |
|---|
| 73 | %setup -q -n json-c-json-c-%{version}-%{pkg_date} |
|---|
| 74 | %patch1000 -p1 |
|---|
| 75 | |
|---|
| 76 | |
|---|
| 77 | %build |
|---|
| 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 |
|---|
| 87 | |
|---|
| 88 | |
|---|
| 89 | %install |
|---|
| 90 | %{__rm} -rf $RPM_BUILD_ROOT |
|---|
| 91 | pushd build |
|---|
| 92 | %{__make} install DESTDIR=$RPM_BUILD_ROOT |
|---|
| 93 | |
|---|
| 94 | %{__rm} -f $RPM_BUILD_ROOT%{_libdir}/*.la |
|---|
| 95 | popd |
|---|
| 96 | |
|---|
| 97 | |
|---|
| 98 | %check |
|---|
| 99 | pushd build |
|---|
| 100 | make %{_smp_mflags} test |
|---|
| 101 | popd |
|---|
| 102 | |
|---|
| 103 | |
|---|
| 104 | %clean |
|---|
| 105 | %{__rm} -rf $RPM_BUILD_ROOT |
|---|
| 106 | |
|---|
| 107 | |
|---|
| 108 | %post -p /sbin/ldconfig |
|---|
| 109 | |
|---|
| 110 | %postun -p /sbin/ldconfig |
|---|
| 111 | |
|---|
| 112 | %post -n compat32-%{name} -p /sbin/ldconfig |
|---|
| 113 | |
|---|
| 114 | %postun -n compat32-%{name} -p /sbin/ldconfig |
|---|
| 115 | |
|---|
| 116 | |
|---|
| 117 | %files |
|---|
| 118 | %defattr(-,root,root,-) |
|---|
| 119 | %license COPYING |
|---|
| 120 | %doc AUTHORS ChangeLog NEWS README* |
|---|
| 121 | %{_libdir}/libjson-c.so.* |
|---|
| 122 | |
|---|
| 123 | %files devel |
|---|
| 124 | %defattr(-,root,root,-) |
|---|
| 125 | %dir %{_includedir}/json-c |
|---|
| 126 | %{_includedir}/json-c/* |
|---|
| 127 | %{_libdir}/libjson-c.so |
|---|
| 128 | %{_libdir}/pkgconfig/json-c.pc |
|---|
| 129 | %dir %{_libdir}/cmake/json-c |
|---|
| 130 | %{_libdir}/cmake/json-c/*.cmake |
|---|
| 131 | |
|---|
| 132 | %files doc |
|---|
| 133 | %defattr(-,root,root,-) |
|---|
| 134 | %doc doc/html/* |
|---|
| 135 | |
|---|
| 136 | %if %{build_compat32} |
|---|
| 137 | %files -n compat32-%{name} |
|---|
| 138 | %defattr(-,root,root,-) |
|---|
| 139 | %{_libdir}/libjson-c.so.* |
|---|
| 140 | |
|---|
| 141 | %files -n compat32-%{name}-devel |
|---|
| 142 | %defattr(-,root,root,-) |
|---|
| 143 | %{_libdir}/libjson-c.so |
|---|
| 144 | %endif |
|---|
| 145 | |
|---|
| 146 | |
|---|
| 147 | %changelog |
|---|
| 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 | |
|---|
| 152 | * Tue Jan 01 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 0.13.1-1 |
|---|
| 153 | - updated to 0.13.1. |
|---|
| 154 | |
|---|
| 155 | * Sat Jan 17 2015 Daisuke SUZUKI <daisuke@vinelinux.org> 0.11-1 |
|---|
| 156 | - update to 0.11 |
|---|
| 157 | |
|---|
| 158 | * Wed Nov 28 2012 Daisuke SUZUKI <daisuke@linux.or.jp> 0.10-1 |
|---|
| 159 | - update to 0.10 |
|---|
| 160 | - update URL |
|---|
| 161 | |
|---|
| 162 | * Sat Oct 08 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9-2 |
|---|
| 163 | - create compat32 sub packages |
|---|
| 164 | |
|---|
| 165 | * Fri Oct 07 2011 Yoji TOYODA <bsyamato@sea.plala.or.jp> 0.9-1 |
|---|
| 166 | - initial build for Vine Linux |
|---|
| 167 | |
|---|