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

Revision 1066, 12.2 KB checked in by kazutaka, 14 years ago (diff)

add new package protobuf

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