[packages/gtest] - new Source0 URL, updated to 1.8.0; now merged with gmock

qboosh qboosh at pld-linux.org
Sun Sep 25 17:06:01 CEST 2016


commit a77443703c1da9c1de57ed1f9cfd12941285dbf8
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Sep 25 17:07:46 2016 +0200

    - new Source0 URL, updated to 1.8.0; now merged with gmock

 gmock-install.patch | 106 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 gtest-install.patch |  16 +++++++-
 gtest.spec          |  98 +++++++++++++++++++++++++++++++++++++++++++-----
 3 files changed, 208 insertions(+), 12 deletions(-)
---
diff --git a/gtest.spec b/gtest.spec
index 96a4976..7138adb 100644
--- a/gtest.spec
+++ b/gtest.spec
@@ -5,16 +5,16 @@
 Summary:	Google C++ testing framework
 Summary(pl.UTF-8):	Szkielet testów w C++ stworzony przez Google
 Name:		gtest
-Version:	1.7.0
-Release:	5
+Version:	1.8.0
+Release:	1
 License:	BSD
 Group:		Development/Tools
 #Source0Download: https://github.com/google/googletest/releases
-#Source0:	https://github.com/google/googletest/archive/release-%{version}/%{name}-%{version}.tar.gz
-Source0:	http://googletest.googlecode.com/files/%{name}-%{version}.zip
-# Source0-md5:	2d6ec8ccdf5c46b05ba54a9fd1d130d7
+Source0:	https://github.com/google/googletest/archive/release-%{version}/%{name}-%{version}.tar.gz
+# Source0-md5:	16877098823401d1bf2ed7891d7dce36
 Patch0:		%{name}-install.patch
 Patch1:		%{name}-link.patch
+Patch2:		gmock-install.patch
 URL:		https://github.com/google/googletest
 BuildRequires:	autoconf >= 2.59
 BuildRequires:	automake >= 1:1.9
@@ -22,7 +22,6 @@ BuildRequires:	libstdc++-devel
 BuildRequires:	libtool >= 2:1.5
 BuildRequires:	python >= 2.3
 BuildRequires:	python-modules >= 2.3
-BuildRequires:	unzip
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
 %description
@@ -67,15 +66,60 @@ Static gtest libraries.
 %description static -l pl.UTF-8
 Statyczne biblioteki gtest.
 
+%package -n gmock-devel
+Summary:	Google C++ Mocking Framework
+Summary(pl.UTF-8):	Szkielet Google Mock dla C++
+Group:		Development/Libraries
+Requires:	gtest-devel = %{version}-%{release}
+Requires:	libstdc++-devel
+Provides:	gmock = %{version}-%{release}
+Obsoletes:	gmock < 1.6.0-3
+
+%description -n gmock-devel
+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.
+
+Google Mock:
+- lets you create mock classes trivially using simple macros,
+- supports a rich set of matchers and actions,
+- handles unordered, partially ordered, or completely ordered
+  expectations,
+- is extensible by users, and
+- works on Linux, Mac OS X, Windows, Windows Mobile, minGW, and
+  Symbian.
+
+%description -n gmock-devel -l pl.UTF-8
+Google C++ Mocking Framework (w skrócie Google Mock) to zainspirowana
+przez jMock, EasyMock i Hamcrest, zaprojektowana z myślą o specyfice
+C++ biblioteka do pisania i wykorzystywania klas "mock" w C++.
+
+Google Mock:
+- pozwala tworzyć klasy "mock" w sposób trywialny przy użyciu makr;
+- obsługuje bogaty zbiór dopasowań i akcji;
+- obsługuje oczekiwania nieuporządkowane, częściowo uporządkowane
+  lub w pełni uporządkowane;
+- jest rozszerzalna dla użytkownika;
+- działa na Linuksie, Mac OS X, Windows, Windows Mobile, minGW oraz
+  Symbianie.
+
+
 %prep
-%setup -q
+%setup -q -n googletest-release-%{version}
+
+cd googletest
 %patch0 -p1
 %patch1 -p1
-
 # Keep a clean copy of samples.
 cp -a samples examples
 
+cd ../googlemock
+%patch2 -p1
+grep -rl bin/env scripts | xargs %{__sed} -i -e '1s,^#!.*python,#!%{__python},'
+
+
 %build
+cd googletest
 %{__libtoolize}
 %{__aclocal}
 %{__autoconf}
@@ -87,10 +131,24 @@ cp -a samples examples
 
 %{?with_tests:%{__make} check}
 
+cd ../googlemock
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+	GTEST_CONFIG=../googletest/scripts/gtest-config \
+	GTEST_CPPFLAGS="-I$PWD/../googletest/include" \
+	GTEST_LDFLAGS="-L$PWD/../googletest/lib/.libs" \
+
+%{__make}
+
 %install
 rm -rf $RPM_BUILD_ROOT
 
-%{__make} install \
+cd googletest
+%{__make} -j1 install \
 	INSTALL="%{__install} -p" \
 	DESTDIR=$RPM_BUILD_ROOT
 
@@ -102,6 +160,13 @@ install -d $RPM_BUILD_ROOT%{_prefix}/src/gtest/src
 cp -p src/*.{cc,h} $RPM_BUILD_ROOT%{_prefix}/src/gtest/src
 cp -pr CMakeLists.txt cmake $RPM_BUILD_ROOT%{_prefix}/src/gtest
 
+cd ../googlemock
+%{__make} -j1 install \
+	INSTALL="%{__install} -p" \
+	DESTDIR=$RPM_BUILD_ROOT
+
+%{__rm} $RPM_BUILD_ROOT%{_datadir}/gmock/generator/{README.cppclean,LICENSE,README}
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -110,7 +175,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(644,root,root,755)
-%doc CHANGES CONTRIBUTORS LICENSE README
+%doc googletest/{CHANGES,CONTRIBUTORS,LICENSE,README.md}
 %attr(755,root,root) %{_libdir}/libgtest.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libgtest.so.0
 %attr(755,root,root) %{_libdir}/libgtest_main.so.*.*.*
@@ -132,3 +197,16 @@ rm -rf $RPM_BUILD_ROOT
 %defattr(644,root,root,755)
 %{_libdir}/libgtest.a
 %{_libdir}/libgtest_main.a
+
+%files -n gmock-devel
+%defattr(644,root,root,755)
+%doc googlemock/{CHANGES,CONTRIBUTORS,LICENSE,README.md}
+%attr(755,root,root) %{_bindir}/gmock-config
+%{_includedir}/gmock
+%{_npkgconfigdir}/gmock.pc
+%dir %{_datadir}/gmock
+%dir %{_datadir}/gmock/generator
+%attr(755,root,root) %{_datadir}/gmock/generator/gmock_gen.py
+%dir %{_datadir}/gmock/generator/cpp
+%attr(755,root,root) %{_datadir}/gmock/generator/cpp/*.py
+%{_prefix}/src/gmock
diff --git a/gmock-install.patch b/gmock-install.patch
new file mode 100644
index 0000000..401ab8e
--- /dev/null
+++ b/gmock-install.patch
@@ -0,0 +1,106 @@
+--- googlemock-1.8.0/Makefile.am.orig	2016-07-14 19:15:38.000000000 +0200
++++ googlemock-1.8.0/Makefile.am	2016-09-25 12:10:16.229204517 +0200
+@@ -7,6 +7,9 @@
+ # included in the 'subdirs' variable.
+ SUBDIRS = $(subdirs)
+ 
++
++bin_SCRIPTS = scripts/gmock-config
++
+ # This is generated by the configure script, so clean it for distribution.
+ DISTCLEANFILES = scripts/gmock-config
+ 
+@@ -21,10 +24,13 @@
+ endif
+ 
+ # Build rules for libraries.
+-lib_LTLIBRARIES = lib/libgmock.la lib/libgmock_main.la
++check_LTLIBRARIES = lib/libgmock.la lib/libgmock_main.la
+ 
+-lib_libgmock_la_SOURCES = src/gmock-all.cc
++nodist_lib_libgmock_la_SOURCES = src/gmock-all.cc
+ 
++pkgconfigdir = $(datadir)/pkgconfig
++pkgconfig_DATA = gmock.pc
++  
+ pkginclude_HEADERS = \
+   include/gmock/gmock-actions.h \
+   include/gmock/gmock-cardinalities.h \
+@@ -42,12 +48,14 @@
+ pkginclude_internal_HEADERS = \
+   include/gmock/internal/gmock-generated-internal-utils.h \
+   include/gmock/internal/gmock-internal-utils.h \
+-  include/gmock/internal/gmock-port.h \
++  include/gmock/internal/gmock-port.h
++pkginclude_internalcustomdir = $(pkgincludedir)/internal/custom
++pkginclude_internalcustom_HEADERS = \
+   include/gmock/internal/custom/gmock-generated-actions.h \
+   include/gmock/internal/custom/gmock-matchers.h \
+   include/gmock/internal/custom/gmock-port.h
+ 
+-lib_libgmock_main_la_SOURCES = src/gmock_main.cc
++nodist_lib_libgmock_main_la_SOURCES = src/gmock_main.cc
+ lib_libgmock_main_la_LIBADD = lib/libgmock.la
+ 
+ # Build rules for tests. Automake's naming for some of these variables isn't
+@@ -192,8 +200,8 @@
+ 
+ # TODO(vladl at google.com): Find a way to add Google Tests's sources here.
+ fused-gmock-internal: $(pkginclude_HEADERS) $(pkginclude_internal_HEADERS) \
+-                      $(lib_libgmock_la_SOURCES) $(GMOCK_SOURCE_INGLUDES) \
+-                      $(lib_libgmock_main_la_SOURCES) \
++                      $(nodist_lib_libgmock_la_SOURCES) $(GMOCK_SOURCE_INGLUDES) \
++                      $(nodist_lib_libgmock_main_la_SOURCES) \
+                       scripts/fuse_gmock_files.py
+ 	mkdir -p "$(srcdir)/fused-src"
+ 	chmod -R u+w "$(srcdir)/fused-src"
+@@ -215,10 +223,9 @@
+ # Mock 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 Mock into your build system."
+-	false
+-
+-install-data-local:
+-	echo "'make install' is dangerous and not supported. Instead, see README for how to integrate Google Mock into your build system."
+-	false
++install-exec-hook:
++	mkdir -p $(DESTDIR)$(datadir)/@PACKAGE@ $(DESTDIR)$(prefix)/src/@PACKAGE@/src
++	cp -rf scripts/generator $(DESTDIR)$(datadir)/@PACKAGE@
++	cp -f src/* $(DESTDIR)$(prefix)/src/@PACKAGE@/src
++	cp -f CMakeLists.txt $(DESTDIR)$(prefix)/src/@PACKAGE@
++	sed -i s/src[/]//g $(DESTDIR)$(prefix)/src/@PACKAGE@/src/gmock-all.cc
+diff --git a/configure.ac b/configure.ac
+index e8b65bd..9ec7743 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -10,7 +10,7 @@ AC_PREREQ([2.59])
+ AC_CONFIG_SRCDIR([./COPYING])
+ AC_CONFIG_AUX_DIR([build-aux])
+ AC_CONFIG_HEADERS([build-aux/config.h])
+-AC_CONFIG_FILES([Makefile])
++AC_CONFIG_FILES([Makefile gmock.pc])
+ AC_CONFIG_FILES([scripts/gmock-config], [chmod +x scripts/gmock-config])
+ 
+ # Initialize Automake with various options. We require at least v1.9, prevent
+diff --git a/gmock.pc.in b/gmock.pc.in
+new file mode 100644
+index 0000000..da4b6c4
+--- /dev/null
++++ b/gmock.pc.in
+@@ -0,0 +1,14 @@
++#############################
++# Pkg-Config file for gmock #
++#############################
++
++Name: gmock
++Description: Google C++ mocking framework
++URL: https://code.google.com/p/googlemock/
++Version: @VERSION@
++
++prefix=@prefix@
++includedir=@includedir@
++srcdir=@prefix@/src/gmock
++
++Cflags: -I${includedir}/gmock
diff --git a/gtest-install.patch b/gtest-install.patch
index 48bd48c..f50f800 100644
--- a/gtest-install.patch
+++ b/gtest-install.patch
@@ -1,5 +1,17 @@
---- gtest-1.6.0/Makefile.am.orig	2011-04-15 21:49:12.000000000 +0200
-+++ gtest-1.6.0/Makefile.am	2011-06-16 13:08:22.272743192 +0200
+--- googletest-1.8.0/Makefile.am.orig	2011-04-15 21:49:12.000000000 +0200
++++ googletest-1.8.0/Makefile.am	2011-06-16 13:08:22.272743192 +0200
+@@ -209,7 +209,10 @@
+   include/gtest/internal/gtest-port-arch.h \
+   include/gtest/internal/gtest-string.h \
+   include/gtest/internal/gtest-tuple.h \
+-  include/gtest/internal/gtest-type-util.h \
++  include/gtest/internal/gtest-type-util.h
++
++pkginclude_internalcustomdir = $(pkgincludedir)/internal/custom
++pkginclude_internalcustom_HEADERS = \
+   include/gtest/internal/custom/gtest.h \
+   include/gtest/internal/custom/gtest-port.h \
+   include/gtest/internal/custom/gtest-printers.h
 @@ -288,15 +288,3 @@
  # Death tests may produce core dumps in the build directory. In case
  # this happens, clean them to keep distcleancheck happy.
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gtest.git/commitdiff/a77443703c1da9c1de57ed1f9cfd12941285dbf8



More information about the pld-cvs-commit mailing list