protobuf-vl.spec 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384
  1. %global gtest_version 1.14.0
  2. %global absl_version 20230802.1
  3. # build -python subpackage
  4. %define with_python %{?_without_python: 0} %{?!_without_python: 1}
  5. # don't require gtest for building
  6. %define without_gtest %{?_without_gtest: 0} %{?!_without_gtest: 1}
  7. # don't build static subpackages
  8. %define with_static %{?_with_static: 1} %{?!_with_static: 0}
  9. Summary: Protocol Buffers - Google's data interchange format
  10. Summary(ja): Protocol Buffers - Google のデータ交換フォーマット
  11. Name: protobuf
  12. Version: 24.4
  13. Release: 1%{?_dist_release}
  14. Group: system
  15. Vendor: Project Vine
  16. Distribution: Vine Linux
  17. License: BSD
  18. URL: https://github.com/protocolbuffers/protobuf
  19. Source: https://github.com/protocolbuffers/protobuf/archive/v%{version}%{?rcver}/%{name}-%{version}%{?rcver}-all.tar.gz
  20. Source1: ftdetect-proto.vim
  21. Source3: https://github.com/google/googletest/archive/refs/tags/v%{gtest_version}.tar.gz#/googletest-%{gtest_version}.tar.gz
  22. Patch1: add-missing-stdint-header.patch
  23. BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  24. BuildRequires: cmake pkgconfig
  25. BuildRequires: abseil-cpp-devel
  26. %if !%{without_gtest}
  27. BuildRequires: gtest-devel
  28. %endif
  29. BuildRequires: zlib-devel
  30. %description
  31. Protocol Buffers are a way of encoding structured data in an efficient
  32. yet extensible format. Google uses Protocol Buffers for almost all of
  33. its internal RPC protocols and file formats.
  34. Protocol buffers are a flexible, efficient, automated mechanism for
  35. serializing structured data – think XML, but smaller, faster, and
  36. simpler. You define how you want your data to be structured once, then
  37. you can use special generated source code to easily write and read
  38. your structured data to and from a variety of data streams and using a
  39. variety of languages. You can even update your data structure without
  40. breaking deployed programs that are compiled against the "old" format.
  41. %package compiler
  42. Summary: Protocol Buffers compiler
  43. Group: programming
  44. Requires: %{name} = %{version}-%{release}
  45. %description compiler
  46. This package contains Protocol Buffers compiler for all programming
  47. languages
  48. %package devel
  49. Summary: Protocol Buffers C++ headers and libraries
  50. Group: programming
  51. Requires: %{name} = %{version}-%{release}
  52. Requires: %{name}-compiler = %{version}-%{release}
  53. Requires: pkgconfig
  54. %description devel
  55. This package contains Protocol Buffers compiler for all languages and
  56. C++ headers and libraries
  57. %if %{with_static}
  58. %package static
  59. Summary: Static development files for %{name}
  60. Group: programming
  61. Requires: %{name} = %{version}-%{release}
  62. %description static
  63. Static libraries for Protocol Buffers
  64. %endif
  65. %package lite
  66. Summary: Protocol Buffers LITE_RUNTIME libraries
  67. Group: system
  68. %description lite
  69. Protocol Buffers built with optimize_for = LITE_RUNTIME.
  70. The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code
  71. which only depends libprotobuf-lite, which is much smaller than libprotobuf but
  72. lacks descriptors, reflection, and some other features.
  73. %package lite-devel
  74. Summary: Protocol Buffers LITE_RUNTIME development libraries
  75. Group: programming
  76. Requires: %{name}-devel = %{version}-%{release}
  77. Requires: %{name}-lite = %{version}-%{release}
  78. %description lite-devel
  79. This package contains development libraries built with
  80. optimize_for = LITE_RUNTIME.
  81. The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code
  82. which only depends libprotobuf-lite, which is much smaller than libprotobuf but
  83. lacks descriptors, reflection, and some other features.
  84. %if %{with_static}
  85. %package lite-static
  86. Summary: Static development files for %{name}-lite
  87. Group: programming
  88. Requires: %{name}-devel = %{version}-%{release}
  89. %description lite-static
  90. This package contains static development libraries built with
  91. optimize_for = LITE_RUNTIME.
  92. The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code
  93. which only depends libprotobuf-lite, which is much smaller than libprotobuf but
  94. lacks descriptors, reflection, and some other features.
  95. %endif
  96. %if %{with_python}
  97. %package -n python3-%{name}
  98. Summary: Python bindings for Google Protocol Buffers
  99. Group: programming
  100. BuildRequires: python3-devel
  101. BuildRequires: python3-setuptools
  102. BuildRequires: python3-six
  103. Conflicts: %{name}-compiler > %{version}
  104. Conflicts: %{name}-compiler < %{version}
  105. Obsoletes: %{name}-python < %{version}-%{release}
  106. Provides: %{name}-python3 = %{version}-%{release}
  107. %description -n python3-%{name}
  108. This package contains Python libraries for Google Protocol Buffers
  109. %endif
  110. %package vim
  111. Summary: Vim syntax highlighting for Google Protocol Buffers descriptions
  112. Group: accessories
  113. Requires(pre): vim
  114. Requires: vim
  115. %description vim
  116. This package contains syntax highlighting for Google Protocol Buffers
  117. descriptions in Vim editor
  118. %debug_package
  119. %prep
  120. %setup -a 3
  121. %patch1 -p1
  122. rm -rf examples/go/*
  123. mv googletest-%{gtest_version}/* third_party/googletest/
  124. find -name \*.cc -o -name \*.h | xargs chmod -x
  125. chmod 644 examples/*
  126. %if %{with_python}
  127. sed -i '/apputils/d' python/setup.py
  128. sed -i '/google_test_dir/d' python/setup.py
  129. %endif
  130. # kill shebang that we do not really want
  131. sed -i -e '/env python/d' python/google/protobuf/internal/*.py
  132. %build
  133. iconv -f iso8859-1 -t utf-8 CONTRIBUTORS.txt > CONTRIBUTORS.txt.utf8
  134. mv CONTRIBUTORS.txt.utf8 CONTRIBUTORS.txt
  135. %cmake \
  136. -Dprotobuf_BUILD_TESTS=OFF \
  137. -Dprotobuf_ABSL_PROVIDER=package
  138. %cmake_build
  139. %if %{with_python}
  140. export PROTOC=../%{_vpath_builddir}/protoc
  141. pushd python
  142. %py3_build
  143. popd
  144. %endif
  145. %install
  146. %cmake_install
  147. install -Dm 0644 editors/proto.vim %{buildroot}%{_datadir}/vim/site/syntax/proto.vim
  148. %if %{with_python}
  149. export PROTOC=../%{_vpath_builddir}/protoc
  150. pushd python
  151. %py3_install
  152. find %{buildroot}%{python3_sitelib} -name \*.py |
  153. xargs sed -i -e '1{\@^#!@d}'
  154. popd
  155. %endif
  156. install -p -m 644 -D %{SOURCE1} %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/proto.vim
  157. install -p -m 644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/proto.vim
  158. rm -f %{buildroot}%{_datadir}/vim/site/syntax/proto.vim
  159. %if !%{without_gtest}
  160. %check
  161. %ctest
  162. %endif
  163. %clean
  164. rm -rf %{buildroot}
  165. %files
  166. %defattr(-, root, root, -)
  167. %{_libdir}/libprotobuf.so.*
  168. %doc CONTRIBUTORS.txt README.md
  169. %license LICENSE
  170. %files compiler
  171. %defattr(-, root, root, -)
  172. %{_bindir}/protoc
  173. %{_bindir}/protoc-*
  174. %{_libdir}/libprotoc.so.*
  175. %doc README.md
  176. %license LICENSE
  177. %files devel
  178. %defattr(-, root, root, -)
  179. %dir %{_includedir}/google
  180. %{_includedir}/google/protobuf/
  181. %{_includedir}/utf8_*
  182. %{_libdir}/cmake/protobuf
  183. %{_libdir}/cmake/utf8_range
  184. %{_libdir}/libprotobuf.so
  185. %{_libdir}/libprotoc.so
  186. %{_libdir}/libutf8_range.a
  187. %{_libdir}/libutf8_validity.a
  188. %{_libdir}/pkgconfig/protobuf.pc
  189. %{_libdir}/pkgconfig/utf8_range.pc
  190. %doc examples/add_person.cc examples/addressbook.proto examples/list_people.cc examples/Makefile examples/README.md
  191. %if %{with_static}
  192. %files static
  193. %defattr(-, root, root, -)
  194. %{_libdir}/libprotobuf.a
  195. %{_libdir}/libprotoc.a
  196. %endif
  197. %files lite
  198. %defattr(-, root, root, -)
  199. %{_libdir}/libprotobuf-lite.so.*
  200. %files lite-devel
  201. %defattr(-, root, root, -)
  202. %{_libdir}/libprotobuf-lite.so
  203. %{_libdir}/pkgconfig/protobuf-lite.pc
  204. %if %{with_static}
  205. %files lite-static
  206. %defattr(-, root, root, -)
  207. %{_libdir}/libprotobuf-lite.a
  208. %endif
  209. %if %{with_python}
  210. %files -n python3-%{name}
  211. %defattr(-, root, root, -)
  212. %dir %{python3_sitelib}/google
  213. %{python3_sitelib}/google/protobuf/
  214. %{python3_sitelib}/protobuf-*.egg-info/
  215. %{python3_sitelib}/protobuf-*-nspkg.pth
  216. %doc python/README.md
  217. %doc examples/add_person.py examples/list_people.py examples/addressbook.proto
  218. %endif
  219. %files vim
  220. %defattr(-, root, root, -)
  221. %{_datadir}/vim/vimfiles/ftdetect/proto.vim
  222. %{_datadir}/vim/vimfiles/syntax/proto.vim
  223. %changelog
  224. * Thu Sep 09 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 3.17.3-1
  225. - new upstream release.
  226. - dropped java stuff.
  227. - dropped ldconfig scriptlets.
  228. - dropped Patch0 and 1.
  229. - imported Patch1 from upstream.
  230. * Thu Jun 30 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6.1-1
  231. - updated to 2.6.1.
  232. * Sat Oct 4 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 2.5.0-2
  233. - moved main and protobuf-lite to System Environment/Libraries Group
  234. * Sun Mar 31 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 2.5.0-1
  235. - update to 2.5.0
  236. * Thu Feb 16 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.4.1-1
  237. - update to 2.4.1
  238. * Thu Sep 30 2010 Shu KONNO <owa@bg.wakwak.com> 2.3.0-3
  239. - rebuilt with rpm-4.8.1 for pkg-config
  240. * Tue May 25 2010 IWAI, Masaharu <iwai@alib.jp> 2.3.0-2
  241. - add missing Group tag for protobuf-lite-devel
  242. - fix files list in python sub package
  243. * Sun May 23 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 2.3.0-1
  244. - initial build for Vine Linux based on fedora development
  245. * Tue May 4 2010 Conrad Meyer <konrad@tylerc.org> - 2.3.0-1
  246. - bump to 2.3.0
  247. * Wed Sep 30 2009 Lev Shamardin <shamardin@gmail.com> - 2.2.0-2
  248. - added export PTHREAD_LIBS="-lpthread"
  249. * Fri Sep 18 2009 Lev Shamardin <shamardin@gmail.com> - 2.2.0-1
  250. - Upgraded to upstream protobuf-2.2.0
  251. - New -lite packages
  252. * Sun Mar 01 2009 Caolán McNamra <caolanm@redhat.com> - 2.0.2-8
  253. - add stdio.h for sprintf, perror, etc.
  254. * Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.2-7
  255. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  256. * Tue Dec 23 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-6
  257. - Small fixes for python 2.6 eggs.
  258. - Temporarily disabled java subpackage due to build problems, will be fixed and
  259. turned back on in future.
  260. * Thu Nov 27 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-5
  261. - No problems with ppc & ppc64 arch in rawhide, had to do a release bump.
  262. * Sat Nov 22 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-4
  263. - Added patch from subversion r70 to workaround gcc 4.3.0 bug (see
  264. http://code.google.com/p/protobuf/issues/detail?id=45 for more
  265. details).
  266. * Tue Nov 11 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-3
  267. - Added conflicts to java and python subpackages to prevent using with
  268. wrong compiler versions.
  269. - Fixed license.
  270. - Fixed BuildRequires for -python subpackage.
  271. - Fixed Requires and Group for -javadoc subpackage.
  272. - Fixed Requires for -devel subpackage.
  273. - Fixed issue with wrong shebang in descriptor_pb2.py.
  274. - Specify build options via --with/--without.
  275. - Use Fedora-packaged gtest library instead of a bundled one by
  276. default (optional).
  277. * Fri Oct 31 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-2
  278. - Use python_sitelib macro instead of INSTALLED_FILES.
  279. - Fix the license.
  280. - Fix redundant requirement for -devel subpackage.
  281. - Fix wrong dependences for -python subpackage.
  282. - Fix typo in requirements for -javadoc subpackage.
  283. - Use -p option for cp and install to preserve timestamps.
  284. - Remove unneeded ldconfig call for post scripts of -devel subpackage.
  285. - Fix directories ownership.
  286. * Sun Oct 12 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-1
  287. - Update to version 2.0.2
  288. - New -java and -javadoc subpackages.
  289. - Options to disable building of -python and -java* subpackages
  290. * Mon Sep 15 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.1-2
  291. - Added -p switch to install commands to preserve timestamps.
  292. - Fixed Version and Libs in pkgconfig script.
  293. - Added pkgconfig requires for -devel package.
  294. - Removed libtool archives from -devel package.
  295. * Thu Sep 04 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.1-1
  296. - Updated to 2.0.1 version.
  297. * Wed Aug 13 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.0-0.1.beta
  298. - Initial package version. Credits for vim subpackage and pkgconfig go
  299. to Rick L Vinyard Jr <rvinyard@cs.nmsu.edu>