Accepting request 130667 from home:MargueriteSu:branches:M17N

OBS-URL: https://build.opensuse.org/request/show/130667
OBS-URL: https://build.opensuse.org/package/show/M17N/googletest?expand=0&rev=5
This commit is contained in:
Fuminobu Takeyama 2012-08-12 05:22:11 +00:00 committed by Git OBS Bridge
parent bd8c9f92b9
commit ab603fdb11
2 changed files with 41 additions and 33 deletions

View File

@ -1,3 +1,9 @@
-------------------------------------------------------------------
Sun Aug 12 11:08:50 UTC 2012 - i@marguerite.su
- further clean spec.
- enable build shared libraries.
-------------------------------------------------------------------
Tue Aug 9 15:36:41 CEST 2011 - tiwai@suse.de

View File

@ -1,7 +1,7 @@
#
# spec file for package [spectemplate]
# spec file for package gtest
#
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -15,63 +15,65 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
%define build_shlib 0
%define build_shlib 1
Name: gtest
Version: 1.6.0
Release: 1
Release: 0
License: BSD-3-Clause
Summary: Google C++ Testing Framework
Url: http://code.google.com/p/googletest/
Group: Development/Libraries/C and C++
License: New BSD
URL: http://code.google.com/p/googletest/
Source0: gtest-%{version}.zip
BuildRequires: unzip, gcc-c++, python, cmake
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: python
BuildRequires: unzip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
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.
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.
%package devel
Summary: Development files for googletest
Group: Development/Libraries/C and C++
Requires: %{name} = %{version}-%{release}
Requires: %{name} = %{version}
%description devel
The %{name}-devel package contains libraries and header files for
developing applications that use googletest.
%prep
%setup -q -n gtest-%{version}
%build
mkdir mybuild
pushd .
cd mybuild
cmake -DGTEST_HAS_PTHREAD=1 ../
mkdir build
cd build
cmake -DLIB_INSTALL_DIR=%{_libdir} ../
%if %build_shlib
cmake -Dgtest_build_tests=ON -DGTEST_CREATE_SHARED_LIBRARY=1 -DGTEST_HAS_PTHREAD=1 ../
cmake -DLIB_INSTALL_DIR=%{_libdir} -Dgtest_build_tests=ON -DBUILD_SHARED_LIBS=ON -Dgtest_force_shared_crt=ON ../
%endif
make %{?_smp_mflags}
popd
cd ..
%install
%{__install} -m 755 -d %{buildroot}%{_libdir}/
%{__install} -m 644 mybuild/libgtest.a %{buildroot}%{_libdir}/
%{__install} -m 644 mybuild/libgtest_main.a %{buildroot}%{_libdir}/
install -m 755 -d %{buildroot}%{_libdir}/
%if %build_shlib
%{__install} -m 644 mybuild/libgtest.so* %{buildroot}%{_libdir}/
%{__install} -m 644 mybuild/libgtest_main.so* %{buildroot}%{_libdir}/
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}/
%endif
%{__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/
%clean
rm -rf %{buildroot}
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/
%if %build_shlib
%post -p /sbin/ldconfig
@ -82,16 +84,16 @@ rm -rf %{buildroot}
%defattr(-, root, root)
%doc README COPYING CONTRIBUTORS CHANGES
%if %build_shlib
{_libdir}/libgtest.so.*
{_libdir}/libgtest_main.so.*
%{_libdir}/libgtest.so
%{_libdir}/libgtest_main.so
%endif
%files devel
%defattr(-, root, root)
%{_includedir}/gtest
%{_libdir}/libgtest*.a
%if %build_shlib
{_libdir}/libgtest*.so
%else
%{_libdir}/libgtest*.a
%endif
%changelog