json-c-vl.spec 3.7 KB

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