source: projects/specs/branches/6/p/protobuf/protobuf-vl.spec @ 1954

Revision 1954, 12.5 KB checked in by owa, 14 years ago (diff)

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