]> git.pld-linux.org Git - packages/gflags.git/commitdiff
- updated to 2.1.1 (project switched to cmake, introducing some regressions which...
authorJakub Bogusz <qboosh@pld-linux.org>
Sat, 18 Oct 2014 20:39:21 +0000 (22:39 +0200)
committerJakub Bogusz <qboosh@pld-linux.org>
Sat, 18 Oct 2014 20:39:21 +0000 (22:39 +0200)
- added libversion patch to restore versioning of shared library
- added nothreads patch to fix libgflags_nothreads library build
- restore pkgconfig files

gflags-libversion.patch [new file with mode: 0644]
gflags-nothreads.patch [new file with mode: 0644]
gflags.spec
libgflags.pc [new file with mode: 0644]
libgflags_nothreads.pc [new file with mode: 0644]

diff --git a/gflags-libversion.patch b/gflags-libversion.patch
new file mode 100644 (file)
index 0000000..d33e08a
--- /dev/null
@@ -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 (file)
index 0000000..f1ccdf1
--- /dev/null
@@ -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)
index a39f9fa566b2aebdd09bf0129aab2bb5e0e09f5d..babd66158a78a253c49fee01ae867f8df4c5b3aa 100644 (file)
@@ -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/libgflags.pc b/libgflags.pc
new file mode 100644 (file)
index 0000000..75a696a
--- /dev/null
@@ -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 (file)
index 0000000..b1dffb8
--- /dev/null
@@ -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}
This page took 0.073157 seconds and 4 git commands to generate.