| 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 | |
|---|
| 16 | Summary: Protocol Buffers - Google's data interchange format |
|---|
| 17 | Name: protobuf |
|---|
| 18 | Version: 2.4.1 |
|---|
| 19 | Release: 1%{?_dist_release} |
|---|
| 20 | License: BSD |
|---|
| 21 | Group: Development/Libraries |
|---|
| 22 | Source: http://protobuf.googlecode.com/files/%{name}-%{version}.tar.bz2 |
|---|
| 23 | Source1: ftdetect-proto.vim |
|---|
| 24 | Patch1: protobuf-2.3.0-fedora-gtest.patch |
|---|
| 25 | Patch2: protobuf-java-fixes.patch |
|---|
| 26 | URL: http://code.google.com/p/protobuf/ |
|---|
| 27 | BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX) |
|---|
| 28 | BuildRequires: automake autoconf libtool pkgconfig |
|---|
| 29 | %if !%{without_gtest} |
|---|
| 30 | BuildRequires: gtest-devel |
|---|
| 31 | %endif |
|---|
| 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 | %if %{with_static} |
|---|
| 67 | %package static |
|---|
| 68 | Summary: Static development files for %{name} |
|---|
| 69 | Group: Development/Libraries |
|---|
| 70 | Requires: %{name} = %{version}-%{release} |
|---|
| 71 | |
|---|
| 72 | %description static |
|---|
| 73 | Static libraries for Protocol Buffers |
|---|
| 74 | %endif |
|---|
| 75 | |
|---|
| 76 | %package lite |
|---|
| 77 | Summary: Protocol Buffers LITE_RUNTIME libraries |
|---|
| 78 | Group: Development/Libraries |
|---|
| 79 | |
|---|
| 80 | %description lite |
|---|
| 81 | Protocol Buffers built with optimize_for = LITE_RUNTIME. |
|---|
| 82 | |
|---|
| 83 | The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code |
|---|
| 84 | which only depends libprotobuf-lite, which is much smaller than libprotobuf but |
|---|
| 85 | lacks descriptors, reflection, and some other features. |
|---|
| 86 | |
|---|
| 87 | %package lite-devel |
|---|
| 88 | Summary: Protocol Buffers LITE_RUNTIME development libraries |
|---|
| 89 | Group: Development/Libraries |
|---|
| 90 | Requires: %{name}-devel = %{version}-%{release} |
|---|
| 91 | Requires: %{name}-lite = %{version}-%{release} |
|---|
| 92 | |
|---|
| 93 | %description lite-devel |
|---|
| 94 | This package contains development libraries built with |
|---|
| 95 | optimize_for = LITE_RUNTIME. |
|---|
| 96 | |
|---|
| 97 | The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code |
|---|
| 98 | which only depends libprotobuf-lite, which is much smaller than libprotobuf but |
|---|
| 99 | lacks descriptors, reflection, and some other features. |
|---|
| 100 | |
|---|
| 101 | %if %{with_static} |
|---|
| 102 | %package lite-static |
|---|
| 103 | Summary: Static development files for %{name}-lite |
|---|
| 104 | Group: Development/Libraries |
|---|
| 105 | Requires: %{name}-devel = %{version}-%{release} |
|---|
| 106 | |
|---|
| 107 | %description lite-static |
|---|
| 108 | This package contains static development libraries built with |
|---|
| 109 | optimize_for = LITE_RUNTIME. |
|---|
| 110 | |
|---|
| 111 | The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code |
|---|
| 112 | which only depends libprotobuf-lite, which is much smaller than libprotobuf but |
|---|
| 113 | lacks descriptors, reflection, and some other features. |
|---|
| 114 | %endif |
|---|
| 115 | |
|---|
| 116 | %if %{with_python} |
|---|
| 117 | %package python |
|---|
| 118 | Summary: Python bindings for Google Protocol Buffers |
|---|
| 119 | Group: Development/Languages |
|---|
| 120 | BuildRequires: python-devel |
|---|
| 121 | BuildRequires: python-setuptools |
|---|
| 122 | Conflicts: %{name}-compiler > %{version} |
|---|
| 123 | Conflicts: %{name}-compiler < %{version} |
|---|
| 124 | |
|---|
| 125 | %description python |
|---|
| 126 | This package contains Python libraries for Google Protocol Buffers |
|---|
| 127 | %endif |
|---|
| 128 | |
|---|
| 129 | %package vim |
|---|
| 130 | Summary: Vim syntax highlighting for Google Protocol Buffers descriptions |
|---|
| 131 | Group: Development/Libraries |
|---|
| 132 | Requires: vim |
|---|
| 133 | |
|---|
| 134 | %description vim |
|---|
| 135 | This package contains syntax highlighting for Google Protocol Buffers |
|---|
| 136 | descriptions in Vim editor |
|---|
| 137 | |
|---|
| 138 | %if %{with_java} |
|---|
| 139 | %package java |
|---|
| 140 | Summary: Java Protocol Buffers runtime library |
|---|
| 141 | Group: Development/Languages |
|---|
| 142 | BuildRequires: java-devel >= 1.6 |
|---|
| 143 | BuildRequires: jpackage-utils |
|---|
| 144 | BuildRequires: maven2 |
|---|
| 145 | BuildRequires: maven2-plugin-compiler |
|---|
| 146 | BuildRequires: maven2-plugin-install |
|---|
| 147 | BuildRequires: maven2-plugin-jar |
|---|
| 148 | BuildRequires: maven2-plugin-javadoc |
|---|
| 149 | BuildRequires: maven2-plugin-release |
|---|
| 150 | BuildRequires: maven2-plugin-resources |
|---|
| 151 | BuildRequires: maven2-plugin-surefire |
|---|
| 152 | BuildRequires: maven2-plugin-antrun |
|---|
| 153 | Requires: java |
|---|
| 154 | Requires: jpackage-utils |
|---|
| 155 | Requires(post): jpackage-utils |
|---|
| 156 | Requires(postun): jpackage-utils |
|---|
| 157 | Conflicts: %{name}-compiler > %{version} |
|---|
| 158 | Conflicts: %{name}-compiler < %{version} |
|---|
| 159 | |
|---|
| 160 | %description java |
|---|
| 161 | This package contains Java Protocol Buffers runtime library. |
|---|
| 162 | |
|---|
| 163 | %package javadoc |
|---|
| 164 | Summary: Javadocs for %{name}-java |
|---|
| 165 | Group: Documentation |
|---|
| 166 | Requires: jpackage-utils |
|---|
| 167 | Requires: %{name}-java = %{version}-%{release} |
|---|
| 168 | |
|---|
| 169 | %description javadoc |
|---|
| 170 | This package contains the API documentation for %{name}-java. |
|---|
| 171 | %endif |
|---|
| 172 | |
|---|
| 173 | |
|---|
| 174 | %prep |
|---|
| 175 | %setup -q |
|---|
| 176 | %if !%{without_gtest} |
|---|
| 177 | rm -rf gtest |
|---|
| 178 | %patch1 -p1 |
|---|
| 179 | %endif |
|---|
| 180 | chmod 644 examples/* |
|---|
| 181 | %if %{with_java} |
|---|
| 182 | %patch2 |
|---|
| 183 | rm -rf java/src/test |
|---|
| 184 | %endif |
|---|
| 185 | |
|---|
| 186 | %build |
|---|
| 187 | iconv -f iso8859-1 -t utf-8 CONTRIBUTORS.txt > CONTRIBUTORS.txt.utf8 |
|---|
| 188 | mv CONTRIBUTORS.txt.utf8 CONTRIBUTORS.txt |
|---|
| 189 | export PTHREAD_LIBS="-lpthread" |
|---|
| 190 | %configure \ |
|---|
| 191 | %if %{with_static} |
|---|
| 192 | --enable-static |
|---|
| 193 | %else |
|---|
| 194 | --disable-static |
|---|
| 195 | %endif |
|---|
| 196 | |
|---|
| 197 | make %{?_smp_mflags} |
|---|
| 198 | |
|---|
| 199 | %if %{with_python} |
|---|
| 200 | pushd python |
|---|
| 201 | python ./setup.py build |
|---|
| 202 | sed -i -e 1d build/lib/google/protobuf/descriptor_pb2.py |
|---|
| 203 | popd |
|---|
| 204 | %endif |
|---|
| 205 | |
|---|
| 206 | %if %{with_java} |
|---|
| 207 | pushd java |
|---|
| 208 | export MAVEN_REPO_LOCAL=$(pwd)/.m2/repository |
|---|
| 209 | mkdir -p $MAVEN_REPO_LOCAL |
|---|
| 210 | mvn-jpp -Dmaven.repo.local=$MAVEN_REPO_LOCAL install javadoc:javadoc |
|---|
| 211 | popd |
|---|
| 212 | %endif |
|---|
| 213 | |
|---|
| 214 | %check |
|---|
| 215 | make %{?_smp_mflags} check |
|---|
| 216 | |
|---|
| 217 | %install |
|---|
| 218 | rm -rf %{buildroot} |
|---|
| 219 | make %{?_smp_mflags} install DESTDIR=%{buildroot} STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p" |
|---|
| 220 | find %{buildroot} -type f -name "*.la" -exec rm -f {} \; |
|---|
| 221 | |
|---|
| 222 | %if %{with_python} |
|---|
| 223 | pushd python |
|---|
| 224 | python ./setup.py install --root=%{buildroot} --single-version-externally-managed --record=INSTALLED_FILES --optimize=1 |
|---|
| 225 | popd |
|---|
| 226 | %endif |
|---|
| 227 | install -p -m 644 -D %{SOURCE1} %{buildroot}%{_datadir}/vim/vimfiles/ftdetect/proto.vim |
|---|
| 228 | install -p -m 644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/proto.vim |
|---|
| 229 | |
|---|
| 230 | %if %{with_java} |
|---|
| 231 | pushd java |
|---|
| 232 | install -d -m 755 %{buildroot}%{_javadir} |
|---|
| 233 | install -pm 644 target/%{name}-java-%{version}.jar %{buildroot}%{_javadir}/%{name}-%{version}.jar |
|---|
| 234 | |
|---|
| 235 | install -d -m 755 %{buildroot}%{_javadocdir}/%{name} |
|---|
| 236 | cp -rp target/site/apidocs %{buildroot}%{_javadocdir}/%{name} |
|---|
| 237 | |
|---|
| 238 | install -d -m 755 %{buildroot}%{_datadir}/maven2/poms |
|---|
| 239 | install -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 |
|---|
| 262 | rm -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 Feb 16 2012 Yoji TOYODA <bsyamato@sea.plala.or.jp> 2.4.1-1 |
|---|
| 337 | - update to 2.4.1 |
|---|
| 338 | |
|---|
| 339 | * Thu Sep 30 2010 Shu KONNO <owa@bg.wakwak.com> 2.3.0-3 |
|---|
| 340 | - rebuilt with rpm-4.8.1 for pkg-config |
|---|
| 341 | |
|---|
| 342 | * Tue May 25 2010 IWAI, Masaharu <iwai@alib.jp> 2.3.0-2 |
|---|
| 343 | - add missing Group tag for protobuf-lite-devel |
|---|
| 344 | - fix files list in python sub package |
|---|
| 345 | |
|---|
| 346 | * Sun May 23 2010 Kazutaka HARADA <kazutaka@vinelinux.org> 2.3.0-1 |
|---|
| 347 | - initial build for Vine Linux based on fedora development |
|---|
| 348 | |
|---|
| 349 | * Tue May 4 2010 Conrad Meyer <konrad@tylerc.org> - 2.3.0-1 |
|---|
| 350 | - bump to 2.3.0 |
|---|
| 351 | |
|---|
| 352 | * Wed Sep 30 2009 Lev Shamardin <shamardin@gmail.com> - 2.2.0-2 |
|---|
| 353 | - added export PTHREAD_LIBS="-lpthread" |
|---|
| 354 | |
|---|
| 355 | * Fri Sep 18 2009 Lev Shamardin <shamardin@gmail.com> - 2.2.0-1 |
|---|
| 356 | - Upgraded to upstream protobuf-2.2.0 |
|---|
| 357 | - New -lite packages |
|---|
| 358 | |
|---|
| 359 | * Sun Mar 01 2009 Caolán McNamra <caolanm@redhat.com> - 2.0.2-8 |
|---|
| 360 | - add stdio.h for sprintf, perror, etc. |
|---|
| 361 | |
|---|
| 362 | * Thu Feb 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.0.2-7 |
|---|
| 363 | - Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild |
|---|
| 364 | |
|---|
| 365 | * Tue Dec 23 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-6 |
|---|
| 366 | - Small fixes for python 2.6 eggs. |
|---|
| 367 | - Temporarily disabled java subpackage due to build problems, will be fixed and |
|---|
| 368 | turned back on in future. |
|---|
| 369 | |
|---|
| 370 | * Thu Nov 27 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-5 |
|---|
| 371 | - No problems with ppc & ppc64 arch in rawhide, had to do a release bump. |
|---|
| 372 | |
|---|
| 373 | * Sat Nov 22 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-4 |
|---|
| 374 | - Added patch from subversion r70 to workaround gcc 4.3.0 bug (see |
|---|
| 375 | http://code.google.com/p/protobuf/issues/detail?id=45 for more |
|---|
| 376 | details). |
|---|
| 377 | |
|---|
| 378 | * Tue Nov 11 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-3 |
|---|
| 379 | - Added conflicts to java and python subpackages to prevent using with |
|---|
| 380 | wrong compiler versions. |
|---|
| 381 | - Fixed license. |
|---|
| 382 | - Fixed BuildRequires for -python subpackage. |
|---|
| 383 | - Fixed Requires and Group for -javadoc subpackage. |
|---|
| 384 | - Fixed Requires for -devel subpackage. |
|---|
| 385 | - Fixed issue with wrong shebang in descriptor_pb2.py. |
|---|
| 386 | - Specify build options via --with/--without. |
|---|
| 387 | - Use Fedora-packaged gtest library instead of a bundled one by |
|---|
| 388 | default (optional). |
|---|
| 389 | |
|---|
| 390 | * Fri Oct 31 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-2 |
|---|
| 391 | - Use python_sitelib macro instead of INSTALLED_FILES. |
|---|
| 392 | - Fix the license. |
|---|
| 393 | - Fix redundant requirement for -devel subpackage. |
|---|
| 394 | - Fix wrong dependences for -python subpackage. |
|---|
| 395 | - Fix typo in requirements for -javadoc subpackage. |
|---|
| 396 | - Use -p option for cp and install to preserve timestamps. |
|---|
| 397 | - Remove unneeded ldconfig call for post scripts of -devel subpackage. |
|---|
| 398 | - Fix directories ownership. |
|---|
| 399 | |
|---|
| 400 | * Sun Oct 12 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.2-1 |
|---|
| 401 | - Update to version 2.0.2 |
|---|
| 402 | - New -java and -javadoc subpackages. |
|---|
| 403 | - Options to disable building of -python and -java* subpackages |
|---|
| 404 | |
|---|
| 405 | * Mon Sep 15 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.1-2 |
|---|
| 406 | - Added -p switch to install commands to preserve timestamps. |
|---|
| 407 | - Fixed Version and Libs in pkgconfig script. |
|---|
| 408 | - Added pkgconfig requires for -devel package. |
|---|
| 409 | - Removed libtool archives from -devel package. |
|---|
| 410 | |
|---|
| 411 | * Thu Sep 04 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.1-1 |
|---|
| 412 | - Updated to 2.0.1 version. |
|---|
| 413 | |
|---|
| 414 | * Wed Aug 13 2008 Lev Shamardin <shamardin@gmail.com> - 2.0.0-0.1.beta |
|---|
| 415 | - Initial package version. Credits for vim subpackage and pkgconfig go |
|---|
| 416 | to Rick L Vinyard Jr <rvinyard@cs.nmsu.edu> |
|---|
| 417 | |
|---|