Browse code

Add protobuf-c, build protobuf static lib.

Change-Id: I652265ae98aa2e73ed9252715e396f5bef944eb2
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/2161
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>

Vinay Kulkarni authored on 2017/03/21 12:57:01
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,75 @@
0
+Summary:        Google's data interchange format - C implementation
1
+Name:           protobuf-c
2
+Version:        1.2.1
3
+Release:        1%{?dist}
4
+License:        BSD-3-Clause
5
+Group:          Development/Libraries
6
+Vendor:         VMware, Inc.
7
+Distribution:   Photon
8
+URL:            https://github.com/google/protobuf-c/
9
+Source0:        %{name}-%{version}.tar.gz
10
+%define         sha1 protobuf-c=3ecd015299d5a8ab8304bf5eeea2fd0f75c1f6bb
11
+BuildRequires:  protobuf >= 2.6.0
12
+BuildRequires:  protobuf-devel >= 2.6.0
13
+BuildRequires:  autoconf
14
+BuildRequires:  automake
15
+BuildRequires:  libtool
16
+BuildRequires:  libstdc++
17
+BuildRequires:  curl
18
+BuildRequires:  make
19
+BuildRequires:  unzip
20
+Requires:       protobuf
21
+
22
+%description
23
+Protocol Buffers (a.k.a., protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. You can find protobuf's documentation on the Google Developers site. This is the C implementation.
24
+
25
+%package        devel
26
+Summary:        Development files for protobuf
27
+Group:          Development/Libraries
28
+Requires:       protobuf-c = %{version}-%{release}
29
+
30
+%description    devel
31
+The protobuf-c-devel package contains libraries and header files for
32
+developing applications that use protobuf-c.
33
+
34
+%package        static
35
+Summary:        protobuf-c static lib
36
+Group:          Development/Libraries
37
+Requires:       protobuf = %{version}-%{release}
38
+
39
+%description    static
40
+The protobuf-c-static package contains static protobuf-c libraries.
41
+
42
+%prep
43
+%setup
44
+autoreconf -iv
45
+
46
+%build
47
+%configure --disable-silent-rules
48
+make %{?_smp_mflags}
49
+
50
+%install
51
+make DESTDIR=%{buildroot} install
52
+
53
+%post   -p /sbin/ldconfig
54
+%postun -p /sbin/ldconfig
55
+
56
+%files
57
+%defattr(-,root,root)
58
+%{_bindir}/protoc-c
59
+%{_libdir}/libprotobuf-c.so.*
60
+
61
+%files devel
62
+%defattr(-,root,root)
63
+%{_includedir}/*
64
+%{_libdir}/pkgconfig/*
65
+%{_libdir}/libprotobuf-c.la
66
+%{_libdir}/libprotobuf-c.so
67
+
68
+%files static
69
+%defattr(-,root,root)
70
+%{_libdir}/libprotobuf-c.a
71
+
72
+%changelog
73
+*   Sat Mar 18 2017 Vinay Kulkarni <kulkarniv@vmware.com> 1.2.1-1
74
+-   Initial packaging for Photon
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        Google's data interchange format
2 2
 Name:           protobuf
3 3
 Version:        2.6.1
4
-Release:        1%{?dist}
4
+Release:        2%{?dist}
5 5
 License:        BSD-3-Clause
6 6
 Group:          Development/Libraries
7 7
 Vendor:         VMware, Inc.
... ...
@@ -9,6 +9,13 @@ Distribution:   Photon
9 9
 URL:            https://github.com/google/protobuf/
10 10
 Source0:        protobuf-%{version}.tar.gz
11 11
 %define         sha1 protobuf=a8f11eced7352edfefa814996ebf086ab3cfbaa0
12
+BuildRequires:  autoconf
13
+BuildRequires:  automake
14
+BuildRequires:  libtool
15
+BuildRequires:  libstdc++
16
+BuildRequires:  curl
17
+BuildRequires:  make
18
+BuildRequires:  unzip
12 19
 
13 20
 %description
14 21
 Protocol Buffers (a.k.a., protobuf) are Google's language-neutral, platform-neutral, extensible mechanism for serializing structured data. You can find protobuf's documentation on the Google Developers site.
... ...
@@ -22,12 +29,20 @@ Requires:       protobuf = %{version}-%{release}
22 22
 The protobuf-devel package contains libraries and header files for
23 23
 developing applications that use protobuf.
24 24
 
25
+%package        static
26
+Summary:        protobuf static lib
27
+Group:          Development/Libraries
28
+Requires:       protobuf = %{version}-%{release}
29
+
30
+%description    static
31
+The protobuf-static package contains static protobuf libraries.
32
+
25 33
 %prep
26 34
 %setup
27 35
 autoreconf -iv
28 36
 
29 37
 %build
30
-%configure --disable-static
38
+%configure --disable-silent-rules
31 39
 make %{?_smp_mflags}
32 40
 
33 41
 %install
... ...
@@ -43,7 +58,6 @@ make DESTDIR=%{buildroot} install
43 43
 %{_libdir}/libprotobuf.so.*
44 44
 %{_libdir}/libprotoc.so.*
45 45
 
46
-
47 46
 %files devel
48 47
 %defattr(-,root,root)
49 48
 %{_includedir}/*
... ...
@@ -55,6 +69,14 @@ make DESTDIR=%{buildroot} install
55 55
 %{_libdir}/libprotoc.la
56 56
 %{_libdir}/libprotoc.so
57 57
 
58
+%files static
59
+%defattr(-,root,root)
60
+%{_libdir}/libprotobuf-lite.a
61
+%{_libdir}/libprotobuf.a
62
+%{_libdir}/libprotoc.a
63
+
58 64
 %changelog
65
+*   Mon Mar 20 2017 Vinay Kulkarni <kulkarniv@vmware.com> 2.6.1-2
66
+-   Build static lib.
59 67
 *   Fri Mar 03 2017 Xiaolin Li <xiaolinl@vmware.com> 2.6.1-1
60 68
 -   Initial packaging for Photon