Accepting request 239723 from M17N

some fixes

OBS-URL: https://build.opensuse.org/request/show/239723
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/googletest?expand=0&rev=5
This commit is contained in:
Stephan Kulow 2014-07-11 04:45:48 +00:00 committed by Git OBS Bridge
commit 0c2389c8eb
3 changed files with 49 additions and 35 deletions

View File

@ -0,0 +1,20 @@
Index: gtest-1.7.0/Makefile.am
===================================================================
--- gtest-1.7.0.orig/Makefile.am
+++ gtest-1.7.0/Makefile.am
@@ -292,15 +292,3 @@ endif
# Death tests may produce core dumps in the build directory. In case
# this happens, clean them to keep distcleancheck happy.
CLEANFILES = core
-
-# Disables 'make install' as installing a compiled version of Google
-# Test can lead to undefined behavior due to violation of the
-# One-Definition Rule.
-
-install-exec-local:
- echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system."
- false
-
-install-data-local:
- echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Test into your build system."
- false

View File

@ -1,3 +1,12 @@
-------------------------------------------------------------------
Sun Jul 6 06:27:04 UTC 2014 - i@marguerite.su
- add patch: googletest-enable-make-install.patch
* use standard procedure to install googletest.
- add scripts/gtest-config to installation
* used by many programs to find gtest CFLAGS and etc.
- install shared libraries for sles too
-------------------------------------------------------------------
Mon Nov 11 00:46:53 UTC 2013 - i@marguerite.su

View File

@ -1,7 +1,7 @@
#
# spec file for package googletest
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2014 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
@ -16,12 +16,6 @@
#
%if 0%{?sles_version}
%define build_shlib 0
%else
%define build_shlib 1
%endif
Name: googletest
Version: 1.7.0
Release: 0
@ -30,8 +24,12 @@ License: BSD-3-Clause
Group: Development/Libraries/C and C++
Url: http://code.google.com/p/googletest/
Source0: gtest-%{version}.zip
#PATCH-FIX-UPSTREAM marguerite@opensuse.org Google thinks `make install`
#is dangerous, but I don't think so.
Patch: googletest-enable-make-install.patch
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: python
BuildRequires: unzip
BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -55,49 +53,36 @@ developing applications that use googletest.
%prep
%setup -q -n gtest-%{version}
%patch -p1
autoreconf -fi
%build
mkdir build
cd build
cmake -DLIB_INSTALL_DIR=%{_libdir} ../
%if %build_shlib
cmake -DLIB_INSTALL_DIR=%{_libdir} -Dgtest_build_tests=ON -DBUILD_SHARED_LIBS=ON -Dgtest_force_shared_crt=ON ../
%endif
%configure --disable-static
make %{?_smp_mflags}
cd ..
%install
install -m 755 -d %{buildroot}%{_libdir}/
%if %build_shlib
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/
%makeinstall
mkdir -p %{buildroot}%{_bindir}
install -m 755 scripts/gtest-config %{buildroot}%{_bindir}
find %{buildroot}%{_libdir} -name "*.la" -type f -delete -print
%if %build_shlib
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%endif
%files
%defattr(-, root, root)
%doc README LICENSE CONTRIBUTORS CHANGES
%if %build_shlib
%{_libdir}/libgtest.so
%{_libdir}/libgtest_main.so
%endif
%{_libdir}/libgtest.so.0
%{_libdir}/libgtest.so.0.0.0
%{_libdir}/libgtest_main.so.0
%{_libdir}/libgtest_main.so.0.0.0
%files devel
%defattr(-, root, root)
%{_bindir}/gtest-config
%{_includedir}/gtest
%if %build_shlib
%else
%{_libdir}/libgtest*.a
%endif
%{_libdir}/libgtest.so
%{_libdir}/libgtest_main.so
%{_datadir}/aclocal/gtest.m4
%changelog