File libphonenumber-nemo.spec of Package libphonenumber-nemo

#
# spec file for package libphonenumber
#

Name:           libphonenumber
Version:        8.13.8
Release:        0
%define lib_ver 8
%define lib_ver2 8.13
Summary:        Library for parsing, formatting, and validating international phone numbers
License:        Apache-2.0
Group:          Development/Libraries/C and C++
URL:            https://github.com/google/libphonenumber
Source:         https://github.com/google/libphonenumber/archive/refs/tags/v%{version}.tar.gz
Patch0:         0001-Fix-geocoding-build-when-static-libraries-are-off.patch
BuildRequires:  cmake
BuildRequires:  gcc-c++
BuildRequires:  java
BuildRequires:  abseil-cpp-devel
BuildRequires:  libboost_date_time-devel
BuildRequires:  libboost_system-devel
BuildRequires:  libboost_thread-devel
BuildRequires:  pkgconfig(gtest)
BuildRequires:  pkgconfig(icu-i18n) >= 4.4
BuildRequires:  pkgconfig(icu-uc) >= 4.4
BuildRequires:  pkgconfig(protobuf) >= 2.4

%description
Google's common Java, C++ and JavaScript library for parsing, formatting,
and validating international phone numbers.

%package     -n %{name}%{lib_ver}
Summary:        Library for parsing, formatting, and validating international phone numbers
Group:          System/Libraries

%description -n %{name}%{lib_ver}
Google's common Java, C++ and JavaScript library for parsing, formatting,
and validating international phone numbers. The Java version is optimized
for running on smartphones, and is used by the Android framework since 4.0
(Ice Cream Sandwich).

%package        devel
Summary:        Library for parsing, formatting, and validating international phone numbers
Group:          Development/Libraries/C and C++
Requires:       %{name}%{lib_ver} = %{version}
Requires:       pkgconfig(protobuf) >= 2.4

%description    devel
Google's common Java, C++ and JavaScript library for parsing, formatting,
and validating international phone numbers. The Java version is optimized
for running on smartphones, and is used by the Android framework since 4.0
(Ice Cream Sandwich).


This package provides libraries and header files for developing applications
that use libphonenumber.

%prep
%autosetup -p1

%build
cd cpp
# Enabling the geocoder breaks quite a lot due to broken cmakelists
# (https://github.com/google/libphonenumber/pull/2556)
%cmake -DBUILD_STATIC_LIB=OFF -DBUILD_SHARED_LIB=ON -DBUILD_TESTING=ON -DBUILD_GEOCODER=OFF
%cmake_build

%install
cd cpp
%cmake_install

%check
cd cpp/build
%cmake_build tests

%post -n %{name}%{lib_ver} -p /sbin/ldconfig
%postun -n %{name}%{lib_ver} -p /sbin/ldconfig

%files -n %{name}%{lib_ver}
%license LICENSE*
%{_libdir}/libphonenumber.so.%{lib_ver}
%{_libdir}/libphonenumber.so.%{lib_ver2}

%files devel
%{_libdir}/libphonenumber.so
%{_includedir}/phonenumbers/
%{_libdir}/cmake/libphonenumber

%changelog
openSUSE Build Service is sponsored by