[packages/gflags] - updated to 2.1.1 (project switched to cmake, introducing some regressions which require patching)
qboosh
qboosh at pld-linux.org
Sat Oct 18 22:38:39 CEST 2014
commit 6998cb4c0f9e4ee990e3b386cd127fa79e5fcfe9
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date: Sat Oct 18 22:39:21 2014 +0200
- updated to 2.1.1 (project switched to cmake, introducing some regressions which require patching)
- added libversion patch to restore versioning of shared library
- added nothreads patch to fix libgflags_nothreads library build
- restore pkgconfig files
gflags-libversion.patch | 11 +++++++++++
gflags-nothreads.patch | 11 +++++++++++
gflags.spec | 34 +++++++++++++++++++++++-----------
libgflags.pc | 13 +++++++++++++
libgflags_nothreads.pc | 12 ++++++++++++
5 files changed, 70 insertions(+), 11 deletions(-)
---
diff --git a/gflags.spec b/gflags.spec
index a39f9fa..babd661 100644
--- a/gflags.spec
+++ b/gflags.spec
@@ -1,14 +1,18 @@
Summary: A commandline flags library that allows for distributed flags
Summary(pl.UTF-8): Biblioteka flag linii poleceń pozwalająca na rozproszone flagi
Name: gflags
-Version: 2.0
+Version: 2.1.1
Release: 1
License: BSD
Group: Libraries
-#Source0Download: http://code.google.com/p/gflags/downloads/list
-Source0: http://gflags.googlecode.com/files/%{name}-%{version}.tar.gz
-# Source0-md5: e02268c1e90876c809ec0ffa095da864
+Source0: https://github.com/schuhschuh/gflags/archive/v%{version}/%{name}-%{version}.tar.gz
+# Source0-md5: 18acc0ae270672a70a86b33ebbe9761b
+Source1: libgflags.pc
+Source2: libgflags_nothreads.pc
+Patch0: %{name}-libversion.patch
+Patch1: %{name}-nothreads.patch
URL: http://code.google.com/p/gflags/
+BuildRequires: cmake >= 2.8.4
BuildRequires: libstdc++-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
@@ -51,21 +55,28 @@ Statyczna biblioteka gflags.
%prep
%setup -q
+%patch0 -p1
+%patch1 -p1
%build
-%configure
+install -d build
+cd build
+%cmake .. \
+ -DBUILD_STATIC_LIBS=ON
%{__make}
%install
rm -rf $RPM_BUILD_ROOT
-%{__make} install \
+%{__make} -C build install \
DESTDIR=$RPM_BUILD_ROOT
-# obsoleted by pkg-config
-%{__rm} $RPM_BUILD_ROOT%{_libdir}/*.la
-# <google/gflags*.h> inclusion is obsolete, directory belongs to other package
-%{__rm} -r $RPM_BUILD_ROOT%{_includedir}/google
+# .pc files used to be provided before gflags 2.1; reintroduce them
+install -d $RPM_BUILD_ROOT%{_pkgconfigdir}
+for f in %{SOURCE1} %{SOURCE2} ; do
+ sed -e "s|@prefix@|%{_prefix}|;s|@libdir@|%{_libdir}|" "$f" \
+ >$RPM_BUILD_ROOT%{_pkgconfigdir}/$(basename $f)
+done
%clean
rm -rf $RPM_BUILD_ROOT
@@ -75,7 +86,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
-%doc AUTHORS COPYING ChangeLog NEWS README
+%doc AUTHORS.txt COPYING.txt ChangeLog.txt NEWS.txt README.txt
%attr(755,root,root) %{_bindir}/gflags_completions.sh
%attr(755,root,root) %{_libdir}/libgflags.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libgflags.so.2
@@ -90,6 +101,7 @@ rm -rf $RPM_BUILD_ROOT
%{_includedir}/gflags
%{_pkgconfigdir}/libgflags.pc
%{_pkgconfigdir}/libgflags_nothreads.pc
+%{_libdir}/cmake/gflags
%files static
%defattr(644,root,root,755)
diff --git a/gflags-libversion.patch b/gflags-libversion.patch
new file mode 100644
index 0000000..d33e08a
--- /dev/null
+++ b/gflags-libversion.patch
@@ -0,0 +1,11 @@
+--- gflags-2.1.1/CMakeLists.txt.orig 2014-03-30 16:41:29.000000000 +0200
++++ gflags-2.1.1/CMakeLists.txt 2014-10-18 20:36:53.007925298 +0200
+@@ -257,6 +257,8 @@
+ set_target_properties (
+ gflags${opts}-${type} PROPERTIES COMPILE_DEFINITIONS "${defines}"
+ OUTPUT_NAME "gflags${opts}"
++ VERSION ${PACKAGE_VERSION}
++ SOVERSION 2
+ )
+ if (HAVE_SHLWAPI_H)
+ target_link_libraries (gflags${opts}-${type} shlwapi.lib)
diff --git a/gflags-nothreads.patch b/gflags-nothreads.patch
new file mode 100644
index 0000000..f1ccdf1
--- /dev/null
+++ b/gflags-nothreads.patch
@@ -0,0 +1,11 @@
+--- gflags-2.1.1/CMakeLists.txt.orig 2014-10-18 20:58:12.937871587 +0200
++++ gflags-2.1.1/CMakeLists.txt 2014-10-18 21:09:27.351176620 +0200
+@@ -247,7 +247,7 @@
+ if (BUILD_gflags${opts}_LIB)
+ add_library (gflags${opts}-${type} ${TYPE} ${GFLAGS_SRCS} ${PRIVATE_HDRS} ${PUBLIC_HDRS})
+ if (opts MATCHES "nothreads")
+- set (defines "GFLAGS_IS_A_DLL=${GFLAGS_IS_A_DLL};NOTHREADS")
++ set (defines "GFLAGS_IS_A_DLL=${GFLAGS_IS_A_DLL};NO_THREADS")
+ else ()
+ set (defines "GFLAGS_IS_A_DLL=${GFLAGS_IS_A_DLL}")
+ if (CMAKE_USE_PTHREADS_INIT)
diff --git a/libgflags.pc b/libgflags.pc
new file mode 100644
index 0000000..75a696a
--- /dev/null
+++ b/libgflags.pc
@@ -0,0 +1,13 @@
+prefix=@prefix@
+exec_prefix=${prefix}
+libdir=@libdir@
+includedir=${prefix}/include
+
+Name: gflags
+Version: 2.0
+Description: A commandline flags library that allows for distributed flags
+URL: http://code.google.com/p/gflags
+Requires:
+Libs: -L${libdir} -lgflags
+Libs.private: -pthread -lpthread
+Cflags: -I${includedir}
diff --git a/libgflags_nothreads.pc b/libgflags_nothreads.pc
new file mode 100644
index 0000000..b1dffb8
--- /dev/null
+++ b/libgflags_nothreads.pc
@@ -0,0 +1,12 @@
+prefix=@prefix@
+exec_prefix=${prefix}
+libdir=@libdir@
+includedir=${prefix}/include
+
+Name: gflags
+Version: 2.0
+Description: A commandline flags library that allows for distributed flags
+URL: http://code.google.com/p/gflags
+Requires:
+Libs: -L${libdir} -lgflags_nothreads
+Cflags: -I${includedir}
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/gflags.git/commitdiff/6998cb4c0f9e4ee990e3b386cd127fa79e5fcfe9
More information about the pld-cvs-commit
mailing list