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