File double-conversion.spec of Package double-conversion

#
# spec file for package double-conversion
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define lib_ver 1
Name:           double-conversion
Version:        2.0.1
Release:        0
Summary:        Library providing binary-decimal and decimal-binary routines for IEEE doubles
License:        BSD-3-Clause
Group:          System/Libraries
Url:            https://github.com/google/double-conversion
Source0:        https://github.com/google/double-conversion/archive/v%{version}.tar.gz
Source99:       baselibs.conf
BuildRequires:  gcc-c++
BuildRequires:  python
BuildRequires:  scons >= 2.3.0

%description
Double-conversion provides binary-decimal and decimal-binary routines
for IEEE doubles. The library consists of efficient conversion routines
that have been extracted from the V8 JavaScript engine. The code has been
re-factored and improved so that it can be used more easily in other projects.

%package     -n lib%{name}%{lib_ver}
Summary:        Library providing binary-decimal and decimal-binary routines for IEEE doubles
Group:          System/Libraries

%description -n lib%{name}%{lib_ver}
Double-conversion provides binary-decimal and decimal-binary routines
for IEEE doubles. The library consists of efficient conversion routines
that have been extracted from the V8 JavaScript engine. The code has been
re-factored and improved so that it can be used more easily in other projects.

%package        devel
Summary:        Library providing binary-decimal and decimal-binary routines for IEEE doubles
Group:          Development/Libraries/C and C++
Requires:       lib%{name}%{lib_ver} = %{version}

%description    devel
Double-conversion provides binary-decimal and decimal-binary routines
for IEEE doubles. The library consists of efficient conversion routines
that have been extracted from the V8 JavaScript engine. The code has been
re-factored and improved so that it can be used more easily in other projects.

This package provides libraries and header files for developing applications
that use double-conversion.

%prep
%setup -q

%build
scons \
  CXXFLAGS="%{optflags}" \
  VERSION="%{version}" \
  %{?_smp_mflags}

# With scons 2.3.0 setting the version fails without this
# http://comments.gmane.org/gmane.comp.programming.tools.scons.user/24448
rm -f libdouble-conversion.so*

%install
install -d  %{buildroot}%{_libdir}
install -d  %{buildroot}%{_includedir}/%{name}

scons \
  CXXFLAGS="%{optflags}" \
  libsuffix=%{_lib} \
  prefix=%{_prefix} \
  DESTDIR=%{buildroot} \
  install

cp -p src/*.h %{buildroot}%{_includedir}/%{name}

rm %{buildroot}%{_libdir}/lib%{name}*.a

%check
scons CXXFLAGS="%{optflags}" run_tests
./run_tests --list | tr -d '<' | xargs ./run_tests

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

%files -n lib%{name}%{lib_ver}
%defattr(-,root,root)
%{_libdir}/libdouble-conversion.so.%{lib_ver}*

%files devel
%defattr(-,root,root)
%doc AUTHORS Changelog LICENSE README
%{_libdir}/libdouble-conversion.so
%{_includedir}/%{name}/

%changelog
openSUSE Build Service is sponsored by