[gtest] New upstream release.

Akira TAGOH tagoh at fedoraproject.org
Fri Sep 28 08:25:46 UTC 2012


commit bebbcaddf43bed54bd42fdde8e962f795f1b8017
Author: Akira TAGOH <tagoh at redhat.com>
Date:   Fri Sep 28 17:25:33 2012 +0900

    New upstream release.
    
    - Using autotools isn't supported in upstream anymore. switching to cmake.
    - undefined reference issues seems gone now. (#813825)

 gtest-1.5.0-make-check.patch |   38 -------------------------------
 gtest-soname.patch           |   12 ++++++++++
 gtest.spec                   |   51 ++++++++++++++++++++++++++---------------
 3 files changed, 44 insertions(+), 57 deletions(-)
---
diff --git a/gtest-soname.patch b/gtest-soname.patch
new file mode 100644
index 0000000..f6a722b
--- /dev/null
+++ b/gtest-soname.patch
@@ -0,0 +1,12 @@
+--- gtest-1.6.0.orig/CMakeLists.txt	2011-04-16 04:49:11.000000000 +0900
++++ gtest-1.6.0/CMakeLists.txt	2012-09-28 14:20:19.000000000 +0900
+@@ -68,7 +68,9 @@ link_directories(${gtest_BINARY_DIR}/src
+ # are used for other targets, to ensure that gtest can be compiled by a user
+ # aggressive about warnings.
+ cxx_library(gtest "${cxx_strict}" src/gtest-all.cc)
++set_target_properties(gtest PROPERTIES VERSION 0.0.0 SOVERSION 0)
+ cxx_library(gtest_main "${cxx_strict}" src/gtest_main.cc)
++set_target_properties(gtest_main PROPERTIES VERSION 0.0.0 SOVERSION 0)
+ target_link_libraries(gtest_main gtest)
+ 
+ ########################################################################
diff --git a/gtest.spec b/gtest.spec
index c0a410c..5120263 100644
--- a/gtest.spec
+++ b/gtest.spec
@@ -1,13 +1,13 @@
 Summary:        Google C++ testing framework
 Name:           gtest
-Version:        1.5.0
-Release:        7%{?dist}
+Version:        1.6.0
+Release:        1%{?dist}
 License:        BSD
 Group:          Development/Tools
 URL:            http://code.google.com/p/googletest/
-Source0:        http://googletest.googlecode.com/files/gtest-%{version}.tar.bz2
-Patch0:         gtest-1.5.0-make-check.patch
-BuildRequires:  python libtool autoconf
+Source0:        http://googletest.googlecode.com/files/gtest-%{version}.zip
+Patch0:         gtest-soname.patch
+BuildRequires:  python cmake libtool
 BuildRoot:      %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
 
 %description
@@ -29,26 +29,22 @@ This package contains development files for %{name}.
 
 %prep
 %setup -q
-%patch0 -p1
+%patch0 -p1 -b .0-soname
 
 # keep a clean copy of samples.
 cp -pr ./samples ./samples.orig
 
-# Keep the latest libtool as the working copy
-libtoolize -f -c
-autoreconf
-
 %build
-%configure --disable-static
-# omit unused direct shared library dependencies.
-sed -i -e's| -shared | -Wl,--as-needed\0|g' libtool
-## remove rpath
-#sed -i -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
-#sed -i -e 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
+# this is odd but needed only to generate gtest-config.
+%configure
+mkdir build
+cd build
+cmake -DBUILD_SHARED_LIBS=ON -DCMAKE_SKIP_BUILD_RPATH=TRUE -DPYTHON_EXECUTABLE=%{__python} -Dgtest_build_tests=ON ..
+
 make %{?_smp_mflags}
 
 %check
-make check
+LD_LIBRARY_PATH=$RPM_BUILD_DIR/%{name}-%{version}/build make test
 
 # Restore the clean copy of samples.
 # To be later listed against doc.
@@ -57,8 +53,20 @@ mv ./samples.orig ./samples
 
 %install
 rm -rf %{buildroot}
-make install INSTALL="%{__install} -p" DESTDIR=%{buildroot}
-find %{buildroot} -type f -name "*.la" -delete
+# make install doesn't work anymore.
+# need to install them manually.
+install -d $RPM_BUILD_ROOT{%{_bindir},%{_datadir}/aclocal,%{_includedir}/gtest{,/internal},%{_libdir}}
+# just for backward compatibility
+install -p -m 0755 build/libgtest.so.*.* build/libgtest_main.so.*.* $RPM_BUILD_ROOT%{_libdir}/
+(cd $RPM_BUILD_ROOT%{_libdir};
+ln -sf libgtest.so.*.* $RPM_BUILD_ROOT%{_libdir}/libgtest.so
+ln -sf libgtest_main.so.*.* $RPM_BUILD_ROOT%{_libdir}/libgtest_main.so
+)
+/sbin/ldconfig -n $RPM_BUILD_ROOT%{_libdir}
+install -p -m 0755 scripts/gtest-config $RPM_BUILD_ROOT%{_bindir}
+install -p -m 0644 include/gtest/*.h $RPM_BUILD_ROOT%{_includedir}/gtest/
+install -p -m 0644 include/gtest/internal/*.h $RPM_BUILD_ROOT%{_includedir}/gtest/internal/
+install -p -m 0644 m4/gtest.m4 $RPM_BUILD_ROOT%{_datadir}/aclocal/
 
 %clean
 rm -rf %{buildroot}
@@ -83,6 +91,11 @@ rm -rf %{buildroot}
 %{_includedir}/gtest
 
 %changelog
+* Fri Sep 28 2012 Akira TAGOH <tagoh at redhat.com> - 1.6.0-1
+- New upstream release.
+- Using autotools isn't supported in upstream anymore. switching to cmake.
+- undefined reference issues seems gone now. (#813825)
+
 * Thu Jul 19 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.5.0-7
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
 


More information about the scm-commits mailing list