protobuf-vl.spec 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. # build -python subpackage
  2. %define with_python %{?_without_python: 0} %{?!_without_python: 1}
  3. # build -java subpackages
  4. #%define with_java %{?_without_java: 0} %{?!_without_java: 1}
  5. # but currently diabled
  6. %define with_java 0
  7. # don't require gtest for building
  8. %define without_gtest %{?_without_gtest: 0} %{?!_without_gtest: 1}
  9. # don't build static subpackages
  10. %define with_static %{?_with_static: 1} %{?!_with_static: 0}
  11. %if %{with_python}
  12. %define python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
  13. %endif
  14. Summary: Protocol Buffers - Google's data interchange format
  15. Summary(ja): Protocol Buffers - Google のデータ交換フォーマット
  16. Name: protobuf
  17. Version: 2.6.1
  18. Release: 1%{?_dist_release}
  19. License: BSD
  20. Group: System Environment/Libraries
  21. Source: http://protobuf.googlecode.com/files/%{name}-%{version}.tar.bz2
  22. Source1: ftdetect-proto.vim
  23. Patch0: protobuf-2.5.0-emacs-24.4.patch
  24. Patch1: protobuf-2.5.0-fedora-gtest.patch
  25. URL: http://code.google.com/p/protobuf/
  26. Vendor: Project Vine
  27. Distribution: Vine Linux
  28. BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  29. BuildRequires: automake autoconf libtool pkgconfig
  30. %if !%{without_gtest}
  31. BuildRequires: gtest-devel
  32. %endif
  33. BuildRequires: zlib-devel
  34. %description
  35. Protocol Buffers are a way of encoding structured data in an efficient
  36. yet extensible format. Google uses Protocol Buffers for almost all of
  37. its internal RPC protocols and file formats.
  38. Protocol buffers are a flexible, efficient, automated mechanism for
  39. serializing structured data – think XML, but smaller, faster, and
  40. simpler. You define how you want your data to be structured once, then
  41. you can use special generated source code to easily write and read
  42. your structured data to and from a variety of data streams and using a
  43. variety of languages. You can even update your data structure without
  44. breaking deployed programs that are compiled against the "old" format.
  45. %package compiler
  46. Summary: Protocol Buffers compiler
  47. Group: Development/Tools
  48. Requires: %{name} = %{version}-%{release}
  49. %description compiler
  50. This package contains Protocol Buffers compiler for all programming
  51. languages
  52. %package devel
  53. Summary: Protocol Buffers C++ headers and libraries
  54. Group: Development/Libraries
  55. Requires: %{name} = %{version}-%{release}
  56. Requires: %{name}-compiler = %{version}-%{release}
  57. Requires: pkgconfig
  58. %description devel
  59. This package contains Protocol Buffers compiler for all languages and
  60. C++ headers and libraries
  61. %if %{with_static}
  62. %package static
  63. Summary: Static development files for %{name}
  64. Group: Development/Libraries
  65. Requires: %{name} = %{version}-%{release}
  66. %description static
  67. Static libraries for Protocol Buffers
  68. %endif
  69. %package lite
  70. Summary: Protocol Buffers LITE_RUNTIME libraries
  71. Group: System Environment/Libraries
  72. %description lite
  73. Protocol Buffers built with optimize_for = LITE_RUNTIME.
  74. The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code
  75. which only depends libprotobuf-lite, which is much smaller than libprotobuf but
  76. lacks descriptors, reflection, and some other features.
  77. %package lite-devel
  78. Summary: Protocol Buffers LITE_RUNTIME development libraries
  79. Group: Development/Libraries
  80. Requires: %{name}-devel = %{version}-%{release}
  81. Requires: %{name}-lite = %{version}-%{release}
  82. %description lite-devel
  83. This package contains development libraries built with
  84. optimize_for = LITE_RUNTIME.
  85. The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code
  86. which only depends libprotobuf-lite, which is much smaller than libprotobuf but
  87. lacks descriptors, reflection, and some other features.
  88. %if %{with_static}
  89. %package lite-static
  90. Summary: Static development files for %{name}-lite
  91. Group: Development/Libraries
  92. Requires: %{name}-devel = %{version}-%{release}
  93. %description lite-static
  94. This package contains static development libraries built with
  95. optimize_for = LITE_RUNTIME.
  96. The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code
  97. which only depends libprotobuf-lite, which is much smaller than libprotobuf but
  98. lacks descriptors, reflection, and some other features.
  99. %endif
  100. %if %{with_python}
  101. %package python
  102. Summary: Python bindings for Google Protocol Buffers
  103. Group: Development/Languages
  104. BuildRequires: python-devel
  105. BuildRequires: python-setuptools
  106. Conflicts: %{name}-compiler > %{version}
  107. Conflicts: %{name}-compiler < %{version}
  108. %description python
  109. This package contains Python libraries for Google Protocol Buffers
  110. %endif
  111. %package vim
  112. Summary: Vim syntax highlighting for Google Protocol Buffers descriptions
  113. Group: Applications/Editors
  114. Requires(pre): vim
  115. Requires: vim
  116. %description vim
  117. This package contains syntax highlighting for Google Protocol Buffers
  118. descriptions in Vim editor
  119. %if %{with_java}
  120. %package java
  121. Summary: Java Protocol Buffers runtime library
  122. Group: Development/Languages
  123. BuildRequires: java-devel >= 1.6
  124. BuildRequires: jpackage-utils
  125. BuildRequires: maven2
  126. BuildRequires: maven2-plugin-compiler
  127. BuildRequires: maven2-plugin-install
  128. BuildRequires: maven2-plugin-jar
  129. BuildRequires: maven2-plugin-javadoc
  130. BuildRequires: maven2-plugin-release
  131. BuildRequires: maven2-plugin-resources
  132. BuildRequires: maven2-plugin-surefire
  133. BuildRequires: maven2-plugin-antrun
  134. Requires: java
  135. Requires: jpackage-utils
  136. Requires(post): jpackage-utils
  137. Requires(postun): jpackage-utils
  138. Conflicts: %{name}-compiler > %{version}
  139. Conflicts: %{name}-compiler < %{version}
  140. %description java
  141. This package contains Java Protocol Buffers runtime library.
  142. %package javadoc
  143. Summary: Javadocs for %{name}-java
  144. Group: Documentation
  145. Requires: jpackage-utils
  146. Requires: %{name}-java = %{version}-%{release}
  147. %description javadoc
  148. This package contains the API documentation for %{name}-java.
  149. %endif
  150. %prep
  151. %setup -q
  152. %patch0 -p1 -b .emacs
  153. %if !%{without_gtest}
  154. rm -rf gtest
  155. %patch1 -p1
  156. %endif
  157. chmod 644 examples/*
  158. %if %{with_java}
  159. %patch2
  160. rm -rf java/src/test
  161. %endif
  162. %build
  163. iconv -f iso8859-1 -t utf-8 CONTRIBUTORS.txt > CONTRIBUTORS.txt.utf8
  164. mv CONTRIBUTORS.txt.utf8 CONTRIBUTORS.txt
  165. export PTHREAD_LIBS="-lpthread"
  166. %configure \
  167. %if %{with_static}
  168. --enable-static
  169. %else
  170. --disable-static
  171. %endif
  172. make %{?_smp_mflags}
  173. %if %{with_python}
  174. pushd python
  175. python ./setup.py build
  176. sed -i -e 1d build/lib/google/protobuf/descriptor_pb2.py
  177. popd
  178. %endif
  179. %if %{with_java}
  180. pushd java
  181. export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository
  182. mkdir -p $MAVEN_REPO_LOCAL
  183. mvn-jpp -Dmaven.repo.local=$MAVEN_REPO_LOCAL install javadoc:javadoc
  184. popd
  185. %endif
  186. %check
  187. make %{?_smp_mflags} check
  188. %install
  189. rm -rf %{buildroot}
  190. make %{?_smp_mflags} install DESTDIR=%{buildroot} STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p"
  191. find %{buildroot} -type f -name "*.la" -exec rm -f {} \;
  192. %if %{with_python}
  193. pushd python
  194. python ./setup.py install --root=%{buildroot} --single-version-externally-managed --record=INSTALLED_FILES --optimize=1
  195. popd
  196. %endif
  197. install -p -m 644 -D %{SOURCE1} %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/proto.vim
  198. install -p -m 644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/proto.vim
  199. %if %{with_java}
  200. pushd java
  201. install -d -m 755 %{buildroot}%{_javadir}
  202. install -pm 644 target/%{name}-java-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar
  203. install -d -m 755 %{buildroot}%{_javadocdir}/%{name}
  204. cp -rp target/site/apidocs %{buildroot}%{_javadocdir}/%{name}
  205. install -d -m 755 %{buildroot}%{_datadir}/maven2/poms
  206. install -pm 644 pom.xml %{buildroot}%{_datadir}/maven2/poms/JPP-%{name}.pom
  207. %add_to_maven_depmap org.apache.maven %{name} %{version} JPP %{name}
  208. %endif
  209. %post -p /sbin/ldconfig
  210. %postun -p /sbin/ldconfig
  211. %post lite -p /sbin/ldconfig
  212. %postun lite -p /sbin/ldconfig
  213. %post compiler -p /sbin/ldconfig
  214. %postun compiler -p /sbin/ldconfig
  215. %if %{with_java}
  216. %post java
  217. %update_maven_depmap
  218. %postun java
  219. %update_maven_depmap
  220. %endif
  221. %clean
  222. rm -rf %{buildroot}
  223. %files
  224. %defattr(-, root, root, -)
  225. %{_libdir}/libprotobuf.so.*
  226. %doc CHANGES.txt CONTRIBUTORS.txt README.md
  227. %license LICENSE
  228. %files compiler
  229. %defattr(-, root, root, -)
  230. %{_bindir}/protoc
  231. %{_libdir}/libprotoc.so.*
  232. %doc README.md
  233. %license LICENSE
  234. %files devel
  235. %defattr(-, root, root, -)
  236. %dir %{_includedir}/google
  237. %{_includedir}/google/protobuf/
  238. %{_libdir}/libprotobuf.so
  239. %{_libdir}/libprotoc.so
  240. %{_libdir}/pkgconfig/protobuf.pc
  241. %doc examples/add_person.cc examples/addressbook.proto examples/list_people.cc examples/Makefile examples/README.txt
  242. %if %{with_static}
  243. %files static
  244. %defattr(-, root, root, -)
  245. %{_libdir}/libprotobuf.a
  246. %{_libdir}/libprotoc.a
  247. %endif
  248. %files lite
  249. %defattr(-, root, root, -)
  250. %{_libdir}/libprotobuf-lite.so.*
  251. %files lite-devel
  252. %defattr(-, root, root, -)
  253. %{_libdir}/libprotobuf-lite.so
  254. %{_libdir}/pkgconfig/protobuf-lite.pc
  255. %if %{with_static}
  256. %files lite-static
  257. %defattr(-, root, root, -)
  258. %{_libdir}/libprotobuf-lite.a
  259. %endif
  260. %if %{with_python}
  261. %files python
  262. %defattr(-, root, root, -)
  263. %dir %{python_sitelib}/google
  264. %{python_sitelib}/google/protobuf/
  265. %{python_sitelib}/protobuf-%{version}-py*.egg-info/
  266. %{python_sitelib}/protobuf-%{version}-py*-nspkg.pth
  267. %doc python/README.txt
  268. %doc examples/add_person.py examples/list_people.py examples/addressbook.proto
  269. %endif
  270. %files vim
  271. %defattr(-, root, root, -)
  272. %{_datadir}/vim/vimfiles/ftdetect/proto.vim
  273. %{_datadir}/vim/vimfiles/syntax/proto.vim
  274. %if %{with_java}
  275. %files java
  276. %defattr(-, root, root, -)
  277. %{_datadir}/maven2/poms/JPP-protobuf.pom
  278. %{_mavendepmapfragdir}/protobuf
  279. %{_javadir}/*
  280. %doc examples/AddPerson.java examples/ListPeople.java
  281. %files javadoc
  282. %defattr(-, root, root, -)
  283. %{_javadocdir}/%{name}
  284. %endif
  285. %changelog
  286. * Thu Jun 30 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 2.6.1-1
  287. - updated to 2.6.1.
  288. * Sat Oct 4 2014 Ryoichi INAGAKI <ryo1@toki.waseda.jp> 2.5.0-2
  289. - moved main and protobuf-lite to System Environment/Libraries Group
  290. * Sun Mar 31 2013 Daisuke SUZUKI <daisuke@linux.or.jp> 2.5.0-1
  291. - update to 2.5.0
  292. * Thu Feb 16 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.4.1-1
  293. - update to 2.4.1
  294. * Thu Sep 30 2010 Shu KONNO <owa@bg.wakwak.com> 2.3.0-3
  295. - rebuilt with rpm-4.8.1 for pkg-config
  296. * Tue May 25 2010 IWAI, Masaharu <iwai@alib.jp> 2.3.0-2
  297. - add missing Group tag for protobuf-lite-devel
  298. - fix files list in python sub package
  299. * Sun May 23 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 2.3.0-1
  300. - initial build for Vine Linux based on fedora development
  301. * Tue May 4 2010 Conrad Meyer <konrad@tylerc.org> - 2.3.0-1
  302. - bump to 2.3.0
  303. * Wed Sep 30 2009 Lev Shamardin <shamardin@gmail.com> - 2.2.0-2
  304. - added export PTHREAD_LIBS="-lpthread"
  305. * Fri Sep 18 2009 Lev Shamardin <shamardin@gmail.com> - 2.2.0-1
  306. - Upgraded to upstream protobuf-2.2.0
  307. - New -lite packages
  308. * Sun Mar 01 2009 Caolán McNamra <caolanm@redhat.com> - 2.0.2-8
  309. - add stdio.h for sprintf, perror, etc.
  310. * Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.2-7
  311. - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
  312. * Tue Dec 23 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-6
  313. - Small fixes for python 2.6 eggs.
  314. - Temporarily disabled java subpackage due to build problems, will be fixed and
  315. turned back on in future.
  316. * Thu Nov 27 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-5
  317. - No problems with ppc & ppc64 arch in rawhide, had to do a release bump.
  318. * Sat Nov 22 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-4
  319. - Added patch from subversion r70 to workaround gcc 4.3.0 bug (see
  320. http://code.google.com/p/protobuf/issues/detail?id=45 for more
  321. details).
  322. * Tue Nov 11 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-3
  323. - Added conflicts to java and python subpackages to prevent using with
  324. wrong compiler versions.
  325. - Fixed license.
  326. - Fixed BuildRequires for -python subpackage.
  327. - Fixed Requires and Group for -javadoc subpackage.
  328. - Fixed Requires for -devel subpackage.
  329. - Fixed issue with wrong shebang in descriptor_pb2.py.
  330. - Specify build options via --with/--without.
  331. - Use Fedora-packaged gtest library instead of a bundled one by
  332. default (optional).
  333. * Fri Oct 31 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-2
  334. - Use python_sitelib macro instead of INSTALLED_FILES.
  335. - Fix the license.
  336. - Fix redundant requirement for -devel subpackage.
  337. - Fix wrong dependences for -python subpackage.
  338. - Fix typo in requirements for -javadoc subpackage.
  339. - Use -p option for cp and install to preserve timestamps.
  340. - Remove unneeded ldconfig call for post scripts of -devel subpackage.
  341. - Fix directories ownership.
  342. * Sun Oct 12 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-1
  343. - Update to version 2.0.2
  344. - New -java and -javadoc subpackages.
  345. - Options to disable building of -python and -java* subpackages
  346. * Mon Sep 15 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.1-2
  347. - Added -p switch to install commands to preserve timestamps.
  348. - Fixed Version and Libs in pkgconfig script.
  349. - Added pkgconfig requires for -devel package.
  350. - Removed libtool archives from -devel package.
  351. * Thu Sep 04 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.1-1
  352. - Updated to 2.0.1 version.
  353. * Wed Aug 13 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.0-0.1.beta
  354. - Initial package version. Credits for vim subpackage and pkgconfig go
  355. to Rick L Vinyard Jr <rvinyard@cs.nmsu.edu>