diff --git a/googletest-enable-make-install.patch b/googletest-enable-make-install.patch deleted file mode 100644 index 425c6c1..0000000 --- a/googletest-enable-make-install.patch +++ /dev/null @@ -1,20 +0,0 @@ -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-fix-cmake-libdir-install.patch b/googletest-fix-cmake-libdir-install.patch new file mode 100644 index 0000000..2a92158 --- /dev/null +++ b/googletest-fix-cmake-libdir-install.patch @@ -0,0 +1,26 @@ +Index: b/googlemock/CMakeLists.txt +=================================================================== +--- a/googlemock/CMakeLists.txt ++++ b/googlemock/CMakeLists.txt +@@ -104,7 +104,7 @@ endif() + # + # Install rules + install(TARGETS gmock gmock_main +- DESTINATION lib) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(DIRECTORY ${gmock_SOURCE_DIR}/include/gmock + DESTINATION include) + +Index: b/googletest/CMakeLists.txt +=================================================================== +--- a/googletest/CMakeLists.txt ++++ b/googletest/CMakeLists.txt +@@ -103,7 +103,7 @@ endif() + # + # Install rules + install(TARGETS gtest gtest_main +- DESTINATION lib) ++ DESTINATION ${CMAKE_INSTALL_LIBDIR}) + install(DIRECTORY ${gtest_SOURCE_DIR}/include/gtest + DESTINATION include) + diff --git a/googletest-release-1.8.0.tar.gz b/googletest-release-1.8.0.tar.gz new file mode 100644 index 0000000..0801462 --- /dev/null +++ b/googletest-release-1.8.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:58a6f4277ca2bc8565222b3bbd58a177609e9c488e8a72649359ba51450db7d8 +size 1281617 diff --git a/googletest-rpmlintrc b/googletest-rpmlintrc new file mode 100644 index 0000000..8d93323 --- /dev/null +++ b/googletest-rpmlintrc @@ -0,0 +1,6 @@ +# Since the main package is a devel package: +addFilter("devel-file-in-non-devel-package") +# Symlinks are intentionally not generated for the SO: +addFilter("shlib-policy-missing-suffix") +# The package doesn't provide any libraries anymore: +addFilter("obsolete-not-provided libgoogletest0") \ No newline at end of file diff --git a/googletest.changes b/googletest.changes index 02bca57..28c50d2 100644 --- a/googletest.changes +++ b/googletest.changes @@ -1,3 +1,47 @@ +------------------------------------------------------------------- +Sat Dec 16 18:55:22 UTC 2017 - luc14n0@linuxmail.org + +- Update to version 1.8.0: + * Update the value of GTEST_DIR to reflect the googletest dir. + * Change the GTestDir marco value to reflect the new dir of + googletest. + * Read Bazel's $XML_OUTPUT_FILE environment variable + * Restructure: + - Test so each scenario is independent. + - $XML_OUTPUT_FILE logic + * Fixes: + - Error C2440 'return' in gmock_test + (gh#google/googletest#775). + - Tests that return object which implement operator bool. + - Operator precedence in GTEST_TEST_BOOLEAN_ with expressions + that implement operator bool. + - env_var_test to ignore XML_OUTPUT_FILE if already set. + - Link that's returned when running tests + (gh#google/googletest#714). +- Rework package turning it into a source package essencially, once + its original intention is to provide source files for a testing + framework, a pure development package itself. Aligning with + upstream ease our job and avoid unexpected bugs. +- Drop libgtest0 and googletest-devel subpackages bringing gtest + subpackage instead and obsoleting the previous ones, following + the above change. +- Provide googlemock together with googletest now that upstream + officially brought this project under gloogle's wings. +- Replace autoconf and automake BuildRequires by cmake and switch + configure, make and make_install macros by cmake, cmake_jobs and + cmake_install. Autotools are deprecated and cmake is recommended + by upstream. +- Drop libtool BuildRequires and autoreconf call. With the adoption + of cmake it's no longer need anymore. +- Drop googletest-enable-make-install.patch. No longer needed once + make install is not used anymore. +- Add googletest-fix-cmake-libdir-install.patch for enabling the + use of /usr/lib(64) instead of /usr/local/lib(64), once + upstream's CMakeLists doesn't provide flexibility in this regard. +- Add googletest-rpmlintrc file to filter warnings about + devel-file-in-non-devel-package, shlib-policy-missing-suffix and + obsolete-not-provided as the package is a devel one itself now. + ------------------------------------------------------------------- Thu Aug 20 07:31:46 UTC 2015 - mpluskal@suse.com diff --git a/googletest.spec b/googletest.spec index 6f1ca39..2245905 100644 --- a/googletest.spec +++ b/googletest.spec @@ -1,7 +1,7 @@ # # spec file for package googletest # -# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2017 SUSE LINUX 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,23 +16,23 @@ # -%define libname libgtest0 +%define _name googlemock + Name: googletest -Version: 1.7.0 +Version: 1.8.0 Release: 0 Summary: Google C++ Testing Framework License: BSD-3-Clause Group: Development/Libraries/C and C++ Url: https://github.com/google/googletest -Source0: https://github.com/google/googletest/archive/release-%{version}.tar.gz -#PATCH-FIX-UPSTREAM marguerite@opensuse.org Google thinks `make install` -#is dangerous, but I don't think so. -Patch0: googletest-enable-make-install.patch -BuildRequires: autoconf -BuildRequires: automake +Source0: https://github.com/google/googletest/archive/%{name}-release-%{version}.tar.gz +Source1: googletest-rpmlintrc +# PATCH-FIX-UPSTREAM googletest-fix-cmake-libdir-install.patch luc14n0@linuxmail.org -- enable the use of /usr/lib(64) instead of /usr/local/lib(64). +Patch0: googletest-fix-cmake-libdir-install.patch +BuildRequires: cmake BuildRequires: gcc-c++ -BuildRequires: libtool BuildRequires: python +BuildRequires: pkgconfig(pthread-stubs) BuildRoot: %{_tmppath}/%{name}-%{version}-build %description @@ -43,13 +43,15 @@ 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 -n %{libname} -Summary: Google C++ Testing Framework +%package -n gtest +Summary: Google C++ Testing Framework - Development files Group: Development/Libraries/C and C++ -Provides: %{name} = %{version} -Obsoletes: %{name} < %{version} +Recommends: %{_name} = %{version} +Obsoletes: lib%{name}0 < %{version} +Obsoletes: %{name}-devel < %{version} +Provides: %{name}-devel = %{version} -%description -n %{libname} +%description -n gtest 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, @@ -57,54 +59,50 @@ 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: %{libname} = %{version} +This package provides shared libraries and header files for development +with googletest. + +%package -n gmock +Summary: Google C++ Mocking Framework - Development files +Group: Development/Libraries/C and C++ +Recommends: %{name} = %{version} +Provides: %{_name}-devel + +%description -n gmock +Inspired by jMock, EasyMock, and Hamcrest, and designed with C++'s specifics in +mind, Google C++ Mocking Framework (or Google Mock for short) is a library for +writing and using C++ mock classes. + +This package provides shared libraries and header files for development +with googlemock. -%description devel -The %{name}-devel package contains libraries and header files for -developing applications that use googletest. %prep %setup -q -n %{name}-release-%{version} %patch0 -p1 %build -autoreconf -fiv -%configure \ - --enable-static=no -make %{?_smp_mflags} - -%if 0%{?suse_version} > 1310 -%check -make check %{?_smp_mflags} -%endif +%cmake +%make_jobs %install -make DESTDIR=%{buildroot} install %{?_smp_mflags} -mkdir -p %{buildroot}%{_bindir} -install -m 755 scripts/gtest-config %{buildroot}%{_bindir} -find %{buildroot} -type f -name "*.la" -delete -print +%cmake_install +# Install the source code needed by some applications +mkdir -p %{buildroot}%{_includedir}/gmock/src && install -m 0644 googlemock/src/* %{buildroot}%{_includedir}/gmock/src +mkdir -p %{buildroot}%{_includedir}/gtest/src && install -m 0644 googletest/src/* %{buildroot}%{_includedir}/gtest/src -%post -n %{libname} -p /sbin/ldconfig - -%postun -n %{libname} -p /sbin/ldconfig - -%files -n %{libname} +%files -n gtest %defattr(-, root, root) -%doc README LICENSE CONTRIBUTORS CHANGES -%{_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 +%doc %{name}/CHANGES %{name}/CONTRIBUTORS %{name}/LICENSE %{name}/README.md %{_libdir}/libgtest.so %{_libdir}/libgtest_main.so -%{_datadir}/aclocal/gtest.m4 +%{_includedir}/gtest -%changelog +%files -n gmock +%defattr(-, root, root) +%doc %{_name}/CHANGES %{_name}/CONTRIBUTORS %{_name}/LICENSE %{_name}/README.md +%{_libdir}/libgmock.so +%{_libdir}/libgmock_main.so +%{_includedir}/gmock + +%changelog \ No newline at end of file diff --git a/release-1.7.0.tar.gz b/release-1.7.0.tar.gz deleted file mode 100644 index a6202d7..0000000 --- a/release-1.7.0.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:f73a6546fdf9fce9ff93a5015e0333a8af3062a152a9ad6bcb772c96687016cc -size 468653