From 3f5eed2b7d0c4f868c64e4307f61ed989d4adf8525703b4dae345f221a817d71 Mon Sep 17 00:00:00 2001 From: Marguerite Su Date: Sun, 6 Jul 2014 06:45:06 +0000 Subject: [PATCH] Accepting request 239719 from home:MargueriteSu:unity OBS-URL: https://build.opensuse.org/request/show/239719 OBS-URL: https://build.opensuse.org/package/show/M17N/googletest?expand=0&rev=12 --- googletest-enable-make-install.patch | 20 ++++++++++ googletest.changes | 9 +++++ googletest.spec | 55 ++++++++++------------------ 3 files changed, 49 insertions(+), 35 deletions(-) create mode 100644 googletest-enable-make-install.patch diff --git a/googletest-enable-make-install.patch b/googletest-enable-make-install.patch new file mode 100644 index 0000000..425c6c1 --- /dev/null +++ b/googletest-enable-make-install.patch @@ -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 diff --git a/googletest.changes b/googletest.changes index ff1edee..11d411e 100644 --- a/googletest.changes +++ b/googletest.changes @@ -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 diff --git a/googletest.spec b/googletest.spec index 241d09b..c38b62e 100644 --- a/googletest.spec +++ b/googletest.spec @@ -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