zlib-ng-vl.spec 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278
  1. %bcond_without compat
  2. %bcond_without sanitizers
  3. %bcond_with abitest
  4. %define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}
  5. # Compatible with the following zlib version.
  6. # see ZLIB_VERSION from https://github.com/zlib-ng/zlib-ng/blob/develop/zlib.h.in
  7. %global zlib_ver 1.3.1
  8. # Obsoletes zlib versions less than.
  9. %global zlib_obsoletes 1.3
  10. # ABI files for ix86 and s390x are not available upstream.
  11. %global supported_abi_test aarch64 ppc64le x86_64
  12. Name: zlib-ng
  13. Summary: Zlib replacement with optimizations
  14. Summary(ja): 最適化されたZlib代替パッケージ
  15. Version: 2.1.7
  16. Release: 1%{?_dist_release}
  17. Group: system
  18. Vendor: Project Vine
  19. Distribution: Vine Linux
  20. License: Zlib
  21. Url: https://github.com/zlib-ng/zlib-ng
  22. Source0: https://github.com/zlib-ng/zlib-ng/archive/%{version}/%{name}-%{version}.tar.gz
  23. Source99: Changelog.fedora
  24. Patch: far.diff
  25. BuildRequires: cmake >= 3.1
  26. BuildRequires: gcc-c++
  27. BuildRequires: cmake(GTest) gmock
  28. %if %{with abitest}
  29. BuildRequires: libabigail
  30. %endif
  31. %global __provides_exclude_from ^%{_libdir}/pkgconfig/zlib\.pc$
  32. %description
  33. zlib-ng is a zlib replacement that provides optimizations for "next generation"
  34. systems.
  35. %package devel
  36. Summary: Development files for %{name}
  37. Group: programming
  38. Requires: %{name}%{?_isa} = %{version}-%{release}
  39. %description devel
  40. The %{name}-devel package contains libraries and header files for developing
  41. application that use %{name}.
  42. %if %{with compat}
  43. %package compat
  44. Summary: Zlib implementation provided by %{name}
  45. Group: system
  46. Provides: zlib = %{zlib_ver}
  47. Provides: zlib%{?_isa} = %{zlib_ver}
  48. Conflicts: zlib%{?_isa}
  49. Obsoletes: zlib < %{zlib_obsoletes}
  50. %description compat
  51. zlib-ng is a zlib replacement that provides optimizations for "next generation"
  52. systems.
  53. The %{name}-compat package contains the library that is API and binary
  54. compatible with zlib.
  55. %package compat-devel
  56. Summary: Development files for %{name}-compat
  57. Group: programming
  58. Requires: %{name}-compat%{?_isa} = %{version}-%{release}
  59. Provides: zlib-devel = %{zlib_ver}
  60. Provides: zlib-devel%{?_isa} = %{zlib_ver}
  61. Conflicts: zlib-devel%{?_isa}
  62. Obsoletes: zlib-devel < %{zlib_obsoletes}
  63. Provides: pkgconfig(zlib) = %{zlib_ver}.zlib-ng
  64. %description compat-devel
  65. The %{name}-compat-devel package contains libraries and header files for
  66. developing application that use zlib.
  67. %package compat-static
  68. Summary: Static libraries for %{name}-compat
  69. Group: programming
  70. Requires: %{name}-compat-devel%{?_isa} = %{version}-%{release}
  71. Provides: zlib-static = %{zlib_ver}
  72. Provides: zlib-static%{?_isa} = %{zlib_ver}
  73. Conflicts: zlib-static%{?_isa}
  74. Obsoletes: zlib-static < %{zlib_obsoletes}
  75. %description compat-static
  76. The %{name}-compat-static package contains static libraries needed for
  77. developing applications that use zlib.
  78. %package -n compat32-zlib-ng-compat
  79. Summary: Zlib replacement with optimizations (32bit)
  80. Summary(ja): 最適化されたZlib代替パッケージ (32bit)
  81. Group: system,legacy
  82. Requires: zlib-ng-compat = %{version}-%{release}
  83. Provides: compat32-zlib = %{zlib_ver}
  84. %description -n compat32-zlib-ng-compat
  85. This package contains 32bit version of zlib-ng-compat.
  86. %package -n compat32-zlib-ng-compat-devel
  87. Summary: Development files for %{name}-compat (32bit)
  88. Summary(ja): zlib-ng-compatを使ったプログラム開発に必要なヘッダファイル/ライブラリ (32bit)
  89. Group: programming,legacy
  90. Requires: zlib-ng-compat = %{version}-%{release}
  91. Requires: zlib-ng-compat-devel = %{version}-%{release}
  92. Provides: compat32-zlib-devel = %{zlib_ver}
  93. %description -n compat32-zlib-ng-compat-devel
  94. This package contains 32bit version of zlib-ng-compat-devel.
  95. %endif
  96. %debug_package
  97. %prep
  98. %autosetup -p1 -n %{name}-%{version}
  99. cp -f %{SOURCE99} ./
  100. %build
  101. cat <<_EOF_
  102. ###########################################################################
  103. #
  104. # Build the default zlib-ng library
  105. #
  106. ###########################################################################
  107. _EOF_
  108. # zlib-ng uses a different macro for library directory.
  109. %global cmake_param %{?with_sanitizers:-DWITH_SANITIZER=ON}
  110. # Setting __cmake_builddir is not necessary in this step, but do it anyway for symmetry.
  111. %global __cmake_builddir %{_vpath_builddir}
  112. %cmake %{cmake_param}
  113. %cmake_build
  114. %if %{with compat}
  115. cat <<_EOF_
  116. ###########################################################################
  117. #
  118. # Build the compat mode library
  119. #
  120. ###########################################################################
  121. _EOF_
  122. %global __cmake_builddir %{_vpath_builddir}-compat
  123. # defining BUILD_SHARED_LIBS disables the static library
  124. %undefine _cmake_shared_libs
  125. # Disable new strategies in order to keep compatibility with zlib.
  126. %cmake %{cmake_param} -DZLIB_COMPAT=ON -DWITH_NEW_STRATEGIES=OFF
  127. %cmake_build
  128. %endif
  129. %check
  130. cat <<_EOF_
  131. ###########################################################################
  132. #
  133. # Run the zlib-ng tests
  134. #
  135. ###########################################################################
  136. _EOF_
  137. %global __cmake_builddir %{_vpath_builddir}
  138. %ctest
  139. %ifarch ppc64le
  140. # Workaround Copr, that sets _target_cpu to ppc64le.
  141. %global target_cpu powerpc64le
  142. %else
  143. %global target_cpu %{_target_cpu}
  144. %endif
  145. %ifarch x86_64
  146. %global vendor pc
  147. %else
  148. %global vendor unknown
  149. %endif
  150. %if %{with abitest}
  151. %ifarch %{supported_abi_test}
  152. CHOST=%{target_cpu}-%{vendor}-linux-gnu sh test/abicheck.sh
  153. %endif
  154. %endif
  155. %if %{with compat}
  156. cat <<_EOF_
  157. ###########################################################################
  158. #
  159. # Run the compat mode tests
  160. #
  161. ###########################################################################
  162. _EOF_
  163. %global __cmake_builddir %{_vpath_builddir}-compat
  164. %ctest
  165. %if %{with abitest}
  166. %ifarch %{supported_abi_test}
  167. CHOST=%{target_cpu}-%{vendor}-linux-gnu sh test/abicheck.sh --zlib-compat
  168. %endif
  169. %endif
  170. %endif
  171. %install
  172. %global __cmake_builddir %{_vpath_builddir}
  173. %cmake_install
  174. %if %{with compat}
  175. %global __cmake_builddir %{_vpath_builddir}-compat
  176. %cmake_install
  177. %endif
  178. %files
  179. %license LICENSE.md
  180. %doc README.md Changelog.fedora
  181. %{_libdir}/libz-ng.so.*
  182. %files devel
  183. %{_includedir}/zconf-ng.h
  184. %{_includedir}/zlib-ng.h
  185. %{_includedir}/zlib_name_mangling-ng.h
  186. %{_libdir}/libz-ng.so
  187. %{_libdir}/pkgconfig/%{name}.pc
  188. %{_libdir}/cmake/zlib-ng/*
  189. %if %{with compat}
  190. %files compat
  191. %{_libdir}/libz.so.*
  192. %files compat-devel
  193. %{_includedir}/zconf.h
  194. %{_includedir}/zlib.h
  195. %{_includedir}/zlib_name_mangling.h
  196. %{_libdir}/libz.so
  197. %{_libdir}/pkgconfig/zlib.pc
  198. %{_libdir}/cmake/ZLIB/*
  199. %files compat-static
  200. %{_libdir}/libz.a
  201. %if %{build_compat32}
  202. %files -n compat32-%{name}-compat
  203. %defattr(-,root,root)
  204. %{_libdir}/libz.so.*
  205. %files -n compat32-%{name}-compat-devel
  206. %defattr(-,root,root)
  207. %{_libdir}/libz.so
  208. %{_libdir}/pkgconfig/zlib.pc
  209. %{_libdir}/cmake/ZLIB/*
  210. %endif
  211. %endif
  212. %changelog
  213. * Wed Jun 26 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.1.7-1
  214. - new upstream release.
  215. * Sun Jun 09 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.1.6-4
  216. - added compat32-* packages.
  217. * Tue Apr 09 2024 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> - 2.1.6-3
  218. - initial build for Vine Linux.