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 Mon Nov 11 00:46:53 UTC 2013 - i@marguerite.su

View File

@ -1,7 +1,7 @@
# #
# spec file for package googletest # 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 # All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed # 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 Name: googletest
Version: 1.7.0 Version: 1.7.0
Release: 0 Release: 0
@ -30,8 +24,12 @@ License: BSD-3-Clause
Group: Development/Libraries/C and C++ Group: Development/Libraries/C and C++
Url: http://code.google.com/p/googletest/ Url: http://code.google.com/p/googletest/
Source0: gtest-%{version}.zip 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: cmake
BuildRequires: gcc-c++ BuildRequires: gcc-c++
BuildRequires: libtool
BuildRequires: python BuildRequires: python
BuildRequires: unzip BuildRequires: unzip
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
@ -55,49 +53,36 @@ developing applications that use googletest.
%prep %prep
%setup -q -n gtest-%{version} %setup -q -n gtest-%{version}
%patch -p1
autoreconf -fi
%build %build
mkdir build %configure --disable-static
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
make %{?_smp_mflags} make %{?_smp_mflags}
cd ..
%install %install
install -m 755 -d %{buildroot}%{_libdir}/ %makeinstall
%if %build_shlib mkdir -p %{buildroot}%{_bindir}
install -m 644 build/libgtest.so* %{buildroot}%{_libdir}/ install -m 755 scripts/gtest-config %{buildroot}%{_bindir}
install -m 644 build/libgtest_main.so* %{buildroot}%{_libdir}/ find %{buildroot}%{_libdir} -name "*.la" -type f -delete -print
%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/
%if %build_shlib
%post -p /sbin/ldconfig %post -p /sbin/ldconfig
%postun -p /sbin/ldconfig %postun -p /sbin/ldconfig
%endif
%files %files
%defattr(-, root, root) %defattr(-, root, root)
%doc README LICENSE CONTRIBUTORS CHANGES %doc README LICENSE CONTRIBUTORS CHANGES
%if %build_shlib %{_libdir}/libgtest.so.0
%{_libdir}/libgtest.so %{_libdir}/libgtest.so.0.0.0
%{_libdir}/libgtest_main.so %{_libdir}/libgtest_main.so.0
%endif %{_libdir}/libgtest_main.so.0.0.0
%files devel %files devel
%defattr(-, root, root) %defattr(-, root, root)
%{_bindir}/gtest-config
%{_includedir}/gtest %{_includedir}/gtest
%if %build_shlib %{_libdir}/libgtest.so
%else %{_libdir}/libgtest_main.so
%{_libdir}/libgtest*.a %{_datadir}/aclocal/gtest.m4
%endif
%changelog %changelog