fix a broken dependecy of Header files
[platform/upstream/libphonenumber.git] / packaging / libphonenumber.spec
1 Name:           libphonenumber
2 Version:        7.0.6
3 Release:        1
4 License:        Apache-2.0
5 Summary:        A library for manipulating international phone numbers
6 Url:            http://code.google.com/p/libphonenumber/
7 Group:          Social & Content/Libraries
8 Source:         libphonenumber-%{version}.tgz
9 BuildRequires:  gcc-c++
10 BuildRequires:  cmake
11 BuildRequires:  gtest-devel
12 BuildRequires:  re2-devel
13 BuildRequires:  protobuf-devel
14 BuildRequires:  boost-devel
15 BuildRequires:  pkgconfig(icu-i18n)
16
17 %description
18 Google's common Java, C++ and Javascript library for parsing,
19 formatting, storing and validating international phone numbers. The
20 Java version is optimized for running on smartphones, and is used by
21 the Android framework since 4.0 (Ice Cream Sandwich).
22
23 %package devel
24 Summary:        Devel package for library
25 Group:          Social & Content/Libraries
26 Requires:       libphonenumber = %{version}
27 Requires:       protobuf-devel
28
29 %description devel
30 Google's common Java, C++ and Javascript library for parsing,
31 formatting, storing and validating international phone numbers. The
32 Java version is optimized for running on smartphones, and is used by
33 the Android framework since 4.0 (Ice Cream Sandwich).
34
35 %prep
36 %setup -q -n libphonenumber
37
38 %build
39 cmake -DCMAKE_SKIP_RPATH=ON -DCMAKE_INSTALL_PREFIX=%{_prefix} -DCMAKE_INSTALL_LIBDIR=%{_libdir} cpp
40
41 # Parallel builds are broken and/or not supported by upstream, don't
42 # use them. The generated Makefile lacks the geocoding_data.cc ->
43 # generate_geocoding_data dependency and thus code generator may still
44 # be producing the file when the C++ compiler is already parsing it.
45 %{__make}
46
47 %install
48 %{__make} DESTDIR=%{buildroot} install
49 rm %{buildroot}/%{_libdir}/*.a
50 # Exported header has dependency on lock_posix.h but lock_posix.h is not installed.
51 cp cpp/src/phonenumbers/base/synchronization/lock_posix.h %{buildroot}/%{_includedir}/phonenumbers/base/synchronization/
52
53 %post   -n libphonenumber -p /sbin/ldconfig
54
55 %postun -n libphonenumber -p /sbin/ldconfig
56
57
58 %files -n libphonenumber
59 %defattr(-, root, root, -)
60 %doc AUTHORS
61 %license LICENSE
62 %{_libdir}/libphonenumber.so.*
63 %{_libdir}/libgeocoding.so.*
64
65 %files devel
66 %defattr(-, root, root, -)
67 %{_includedir}/phonenumbers
68 %{_libdir}/libphonenumber.so
69 %{_libdir}/libgeocoding.so