source: projects/specs/trunk/p/protobuf/protobuf-vl.spec @ 10445

Revision 10445, 13.1 KB checked in by tomop, 8 years ago (diff)

protobuf-2.6.1-1

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