packaging: Rebase 3.12.3 commit
[platform/upstream/protobuf.git] / packaging / protobuf.spec
1
2 Name:           protobuf
3 Summary:        Protocol Buffers - Google's data interchange format
4 License:        BSD-3-Clause
5 Group:          Development/Libraries
6 Version:        3.12.3
7 Release:        1
8 Source0:        protobuf-%{version}.tar.gz
9 Source1001:     protobuf.manifest
10 URL:            https://github.com/google/protobuf
11 BuildRequires:  automake autoconf libtool pkgconfig zlib-devel
12
13 %description
14 Protocol Buffers are a way of encoding structured data in an efficient
15 yet extensible format. Google uses Protocol Buffers for almost all of
16 its internal RPC protocols and file formats.
17
18 Protocol buffers are a flexible, efficient, automated mechanism for
19 serializing structured data – think XML, but smaller, faster, and
20 simpler. You define how you want your data to be structured once, then
21 you can use special generated source code to easily write and read
22 your structured data to and from a variety of data streams and using a
23 variety of languages. You can even update your data structure without
24 breaking deployed programs that are compiled against the "old" format.
25
26 %package compiler
27 Summary: Protocol Buffers compiler
28 Group: Development/Libraries
29 Requires: %{name} = %{version}-%{release}
30
31 %description compiler
32 This package contains Protocol Buffers compiler for all programming
33 languages
34
35 %package devel
36 Summary: Protocol Buffers C++ headers and libraries
37 Group: Development/Libraries
38 Requires: %{name} = %{version}-%{release}
39 Requires: %{name}-compiler = %{version}-%{release}
40 Requires: pkgconfig
41
42 %description devel
43 This package contains Protocol Buffers compiler for all languages and
44 C++ headers and libraries
45
46 %package static
47 Summary: Static development files for %{name}
48 Group: Development/Libraries
49 Requires: %{name} = %{version}-%{release}
50
51 %description static
52 Static libraries for Protocol Buffers
53
54 %package lite
55 Summary: Protocol Buffers LITE_RUNTIME libraries
56 Group: Development/Libraries
57
58 %description lite
59 Protocol Buffers built with optimize_for = LITE_RUNTIME.
60
61 The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code
62 which only depends libprotobuf-lite, which is much smaller than libprotobuf but
63 lacks descriptors, reflection, and some other features.
64
65 %package lite-devel
66 Summary: Protocol Buffers LITE_RUNTIME development libraries
67 Requires: %{name}-devel = %{version}-%{release}
68 Requires: %{name}-lite = %{version}-%{release}
69
70 %description lite-devel
71 This package contains development libraries built with
72 optimize_for = LITE_RUNTIME.
73
74 The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code
75 which only depends libprotobuf-lite, which is much smaller than libprotobuf but
76 lacks descriptors, reflection, and some other features.
77
78 %package lite-static
79 Summary: Static development files for %{name}-lite
80 Group: Development/Libraries
81 Requires: %{name}-devel = %{version}-%{release}
82
83 %description lite-static
84 This package contains static development libraries built with
85 optimize_for = LITE_RUNTIME.
86
87 The "optimize_for = LITE_RUNTIME" option causes the compiler to generate code
88 which only depends libprotobuf-lite, which is much smaller than libprotobuf but
89 lacks descriptors, reflection, and some other features.
90
91 %package vim
92 Summary: Vim syntax highlighting for Google Protocol Buffers descriptions
93 Group: Development/Libraries
94 Requires: vim-enhanced
95
96 %description vim
97 This package contains syntax highlighting for Google Protocol Buffers
98 descriptions in Vim editor
99
100 %prep
101 %setup -q
102 cp %{SOURCE1001} .
103 chmod 644 examples/*
104
105 #%patch3 -p1 -b .generic-atomics
106 #%patch4 -p1 -b .generic-atomics-makefile
107
108 %build
109 iconv -f iso8859-1 -t utf-8 CONTRIBUTORS.txt > CONTRIBUTORS.txt.utf8
110 mv CONTRIBUTORS.txt.utf8 CONTRIBUTORS.txt
111 export PTHREAD_LIBS="-lpthread"
112 ./autogen.sh
113 %configure
114
115 make %{?_smp_mflags}
116
117 %check
118 #make %{?_smp_mflags} check
119
120 %install
121 rm -rf %{buildroot}
122 make %{?_smp_mflags} install DESTDIR=%{buildroot} STRIPBINARIES=no INSTALL="%{__install} -p" CPPROG="cp -p"
123 find %{buildroot} -type f -name "*.la" -exec rm -f {} \;
124
125 install -p -m 644 -D editors/proto.vim %{buildroot}%{_datadir}/vim/vimfiles/syntax/proto.vim
126
127 %post -p /sbin/ldconfig
128 %postun -p /sbin/ldconfig
129
130 %post lite -p /sbin/ldconfig
131 %postun lite -p /sbin/ldconfig
132
133 %post compiler -p /sbin/ldconfig
134 %postun compiler -p /sbin/ldconfig
135
136 %files
137 %manifest protobuf.manifest
138 %defattr(-, root, root, -)
139 %{_libdir}/libprotobuf.so.*
140 %doc CHANGES.txt CONTRIBUTORS.txt README.md
141
142 %files compiler
143 %manifest protobuf.manifest
144 %defattr(-, root, root, -)
145 %{_bindir}/protoc
146 %{_libdir}/libprotoc.so.*
147 %doc README.md
148
149 %files devel
150 %manifest protobuf.manifest
151 %defattr(-, root, root, -)
152 %dir %{_includedir}/google
153 %{_includedir}/google/protobuf/
154 %{_libdir}/libprotobuf.so
155 %{_libdir}/libprotoc.so
156 %{_libdir}/pkgconfig/protobuf.pc
157 %doc examples/add_person.cc examples/addressbook.proto examples/list_people.cc examples/CMakeLists.txt
158
159 %files static
160 %manifest protobuf.manifest
161 %defattr(-, root, root, -)
162 %{_libdir}/libprotobuf.a
163 %{_libdir}/libprotoc.a
164
165 %files lite
166 %manifest protobuf.manifest
167 %defattr(-, root, root, -)
168 %{_libdir}/libprotobuf-lite.so.*
169
170 %files lite-devel
171 %manifest protobuf.manifest
172 %defattr(-, root, root, -)
173 %{_libdir}/libprotobuf-lite.so
174 %{_libdir}/pkgconfig/protobuf-lite.pc
175
176 %files lite-static
177 %manifest protobuf.manifest
178 %defattr(-, root, root, -)
179 %{_libdir}/libprotobuf-lite.a
180
181 %files vim
182 %manifest protobuf.manifest
183 %defattr(-, root, root, -)
184 %{_datadir}/vim/vimfiles/syntax/proto.vim