~derks/+junk/protobuf-buildroot

« back to all changes in this revision

Viewing changes to SPECS/protobuf.spec

  • Committer: wdierkes
  • Date: 2010-03-16 00:32:20 UTC
  • Revision ID: wdierkes@derks-linux-20100316003220-ptyjueyen1q1fpd0
initial import

Show diffs side-by-side

added added

removed removed

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