2011-08-09 15:07:44 +02:00
|
|
|
#
|
2012-08-12 07:22:11 +02:00
|
|
|
# spec file for package gtest
|
2011-08-09 15:07:44 +02:00
|
|
|
#
|
2012-08-12 07:22:11 +02:00
|
|
|
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
2011-08-09 15:07:44 +02:00
|
|
|
#
|
|
|
|
# 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/
|
|
|
|
#
|
|
|
|
|
|
|
|
|
2012-08-12 07:22:11 +02:00
|
|
|
%define build_shlib 1
|
2011-08-09 16:25:57 +02:00
|
|
|
|
2011-08-09 15:07:44 +02:00
|
|
|
Name: gtest
|
|
|
|
Version: 1.6.0
|
2012-08-12 07:22:11 +02:00
|
|
|
Release: 0
|
|
|
|
License: BSD-3-Clause
|
2011-08-09 15:07:44 +02:00
|
|
|
Summary: Google C++ Testing Framework
|
2012-08-12 07:22:11 +02:00
|
|
|
Url: http://code.google.com/p/googletest/
|
2011-08-09 15:07:44 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
2012-08-12 07:30:16 +02:00
|
|
|
Source0: %{name}-%{version}.zip
|
|
|
|
Patch0: sles-gtest-unittest-hex-escape-sequence-out-of-range.patch
|
2012-08-12 07:22:11 +02:00
|
|
|
BuildRequires: cmake
|
|
|
|
BuildRequires: gcc-c++
|
|
|
|
BuildRequires: python
|
|
|
|
BuildRequires: unzip
|
2011-08-09 15:48:38 +02:00
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2011-08-09 15:07:44 +02:00
|
|
|
|
|
|
|
%description
|
2012-08-12 07:22:11 +02:00
|
|
|
Google\'s framework for writing C++ tests on a variety of platforms
|
|
|
|
(Linux, Mac OS X, Windows, Cygwin, Windows CE, and Symbian).
|
|
|
|
Based on the xUnit architecture. Supports automatic test discovery,
|
|
|
|
a rich set of assertions, user-defined assertions, death tests,
|
|
|
|
fatal and non-fatal failures, value- and type-parameterized tests,
|
|
|
|
various options for running the tests, and XML test report generation.
|
2011-08-09 15:07:44 +02:00
|
|
|
|
|
|
|
%package devel
|
|
|
|
Summary: Development files for googletest
|
2011-08-09 15:37:44 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
2012-08-12 07:22:11 +02:00
|
|
|
Requires: %{name} = %{version}
|
2011-08-09 15:07:44 +02:00
|
|
|
|
|
|
|
%description devel
|
|
|
|
The %{name}-devel package contains libraries and header files for
|
|
|
|
developing applications that use googletest.
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q -n gtest-%{version}
|
2012-08-12 07:30:16 +02:00
|
|
|
%if 0%{?sles_version}
|
|
|
|
%if %build_shlib
|
|
|
|
%patch0 -p1
|
|
|
|
%endif
|
|
|
|
%endif
|
2011-08-09 15:07:44 +02:00
|
|
|
|
|
|
|
%build
|
2012-08-12 07:22:11 +02:00
|
|
|
mkdir build
|
|
|
|
cd build
|
|
|
|
cmake -DLIB_INSTALL_DIR=%{_libdir} ../
|
2011-08-09 16:25:57 +02:00
|
|
|
%if %build_shlib
|
2012-08-12 07:22:11 +02:00
|
|
|
cmake -DLIB_INSTALL_DIR=%{_libdir} -Dgtest_build_tests=ON -DBUILD_SHARED_LIBS=ON -Dgtest_force_shared_crt=ON ../
|
2011-08-09 16:25:57 +02:00
|
|
|
%endif
|
2011-08-09 15:07:44 +02:00
|
|
|
make %{?_smp_mflags}
|
2012-08-12 07:22:11 +02:00
|
|
|
cd ..
|
2011-08-09 15:07:44 +02:00
|
|
|
|
|
|
|
%install
|
2012-08-12 07:22:11 +02:00
|
|
|
install -m 755 -d %{buildroot}%{_libdir}/
|
2011-08-09 16:25:57 +02:00
|
|
|
%if %build_shlib
|
2012-08-12 07:22:11 +02:00
|
|
|
install -m 644 build/libgtest.so* %{buildroot}%{_libdir}/
|
|
|
|
install -m 644 build/libgtest_main.so* %{buildroot}%{_libdir}/
|
|
|
|
%else
|
|
|
|
install -m 644 build/libgtest.a %{buildroot}%{_libdir}/
|
|
|
|
install -m 644 build/libgtest_main.a %{buildroot}%{_libdir}/
|
2011-08-09 16:25:57 +02:00
|
|
|
%endif
|
2012-08-12 07:22:11 +02:00
|
|
|
install -m 755 -d %{buildroot}%{_includedir}/gtest/internal
|
|
|
|
install -m 644 include/gtest/*.h %{buildroot}%{_includedir}/gtest/
|
|
|
|
install -m 644 include/gtest/internal/*.h %{buildroot}%{_includedir}/gtest/internal/
|
2011-08-09 15:07:44 +02:00
|
|
|
|
2011-08-09 16:25:57 +02:00
|
|
|
%if %build_shlib
|
|
|
|
%post -p /sbin/ldconfig
|
|
|
|
%postun -p /sbin/ldconfig
|
|
|
|
%endif
|
2011-08-09 15:07:44 +02:00
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-, root, root)
|
|
|
|
%doc README COPYING CONTRIBUTORS CHANGES
|
2011-08-09 16:25:57 +02:00
|
|
|
%if %build_shlib
|
2012-08-12 07:22:11 +02:00
|
|
|
%{_libdir}/libgtest.so
|
|
|
|
%{_libdir}/libgtest_main.so
|
2011-08-09 16:25:57 +02:00
|
|
|
%endif
|
2011-08-09 15:07:44 +02:00
|
|
|
|
|
|
|
%files devel
|
|
|
|
%defattr(-, root, root)
|
2011-08-09 16:25:57 +02:00
|
|
|
%{_includedir}/gtest
|
|
|
|
%if %build_shlib
|
2012-08-12 07:22:11 +02:00
|
|
|
%else
|
|
|
|
%{_libdir}/libgtest*.a
|
2011-08-09 16:25:57 +02:00
|
|
|
%endif
|
2011-08-09 15:07:44 +02:00
|
|
|
|
|
|
|
%changelog
|