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

Revision 8999, 12.9 KB checked in by inagaki, 10 years ago (diff)

2014-10-05 Ryoichi INAGAKI <ryo1@…>

  • dtc, libXaw3dXft, protobuf, qdbm: update


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