protobuf-vl.spec 12 KB

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