protobuf-vl.spec 13 KB

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