[packages/gpgme] - updated to 1.7.0 - updated largefile patch (all gpgme users must define the same _FILE_OFFSET_BITS

qboosh qboosh at pld-linux.org
Sun Oct 9 10:35:55 CEST 2016


commit 04bb14bcab64b4995d7b22bd28ec4f0e53daf194
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sun Oct 9 10:37:57 2016 +0200

    - updated to 1.7.0
    - updated largefile patch (all gpgme users must define the same _FILE_OFFSET_BITS as library itself)
    - added python patch (install .pyo files, avoid installed-files.txt)
    - package bindings: GpgMEpp (as -c++*), QGpgME (as -qt5*), python2-, python3-

 gpgme-1.2.0-largefile.patch |  23 -----
 gpgme-largefile.patch       | 101 +++++++++++++++++++
 gpgme-python.patch          |  20 ++++
 gpgme.spec                  | 241 ++++++++++++++++++++++++++++++++++++++++++--
 4 files changed, 354 insertions(+), 31 deletions(-)
---
diff --git a/gpgme.spec b/gpgme.spec
index f1a5f4c..1deaf68 100644
--- a/gpgme.spec
+++ b/gpgme.spec
@@ -1,32 +1,56 @@
-# TODO: package lisp files:
-#    /usr/share/common-lisp/source/gpgme/gpgme-package.lisp
-#    /usr/share/common-lisp/source/gpgme/gpgme.asd
-#    /usr/share/common-lisp/source/gpgme/gpgme.lisp
+# TODO: finish common-lisp package (is it a proper location? what package name?)
 #
 # Conditional build:
 %bcond_without	static_libs	# do not build static libraries
+%bcond_with	commonlisp	# Common Lisp interface
+%bcond_without	cxx		# C++ interface (GpgMEpp library)
+%bcond_without	qt5		# Qt 5 interface (QGpgME library), requires cxx
+%bcond_without	python		# Python interfaces (PyME, both python2+python3)
+%bcond_without	python2		# Python 2 interface (PyME)
+%bcond_without	python3		# Python 3 interface (PyME)
 %bcond_with	tests		# perform tests
 #
+%if %{without python}
+%undefine	with_python2
+%undefine	with_python3
+%endif
+%if %{without cxx}
+%undefine	with_qt5
+%endif
 Summary:	Library for accessing GnuPG
 Summary(pl.UTF-8):	Biblioteka dająca dostęp do funkcji GnuPG
 Name:		gpgme
-Version:	1.6.0
+Version:	1.7.0
 Release:	1
 Epoch:		1
 License:	LGPL v2.1+
 Group:		Libraries
 Source0:	ftp://ftp.gnupg.org/gcrypt/gpgme/%{name}-%{version}.tar.bz2
-# Source0-md5:	60d730d22e8065fd5de309e8b98e304b
+# Source0-md5:	c3f24c50bc5bdb7b898da0e278425ad2
 Patch0:		%{name}-info.patch
 Patch1:		%{name}-kill-tests.patch
-Patch2:		%{name}-1.2.0-largefile.patch
+Patch2:		%{name}-largefile.patch
+Patch3:		%{name}-python.patch
 URL:		http://www.gnupg.org/gpgme.html
 BuildRequires:	autoconf >= 2.59
 BuildRequires:	automake >= 1:1.14
 BuildRequires:	libassuan-devel >= 1:2.0.2
 BuildRequires:	libgpg-error-devel >= 1.11
+%{?with_cxx:BuildRequires:	libstdc++-devel >= 6:4.7}
 BuildRequires:	libtool >= 2:2.2.6
+%{?with_python2:BuildRequires:	python-devel >= 1:2.7}
+%{?with_python3:BuildRequires:	python3-devel >= 1:3.4}
+%{?with_python:BuildRequires:	rpm-pythonprov}
+BuildRequires:	rpmbuild(macros) >= 1.219
+%{?with_python:BuildRequires:	swig-python}
 BuildRequires:	texinfo
+%if %{with qt5}
+BuildRequires:	Qt5Core-devel >= 5.0.0
+%{?with_tests:BuildRequires:	Qt5Test-devel >= 5.0.0}
+BuildRequires:	doxygen
+BuildRequires:	graphviz
+BuildRequires:	qt5-build >= 5.0.0
+%endif
 BuildConflicts:	gnupg < 1.3.0
 Suggests:	gnupg >= 1.4.0
 Suggests:	gnupg-smime >= 1.9.8
@@ -70,11 +94,122 @@ Static version of GPGME library.
 %description static -l pl.UTF-8
 Statyczna wersja biblioteki GPGME.
 
+%package c++
+Summary:	GpgMEpp - C++ interface for GPGME library
+Summary(pl.UTF-8):	GpgMEpp - interfejs C++ do biblioteki GPGME
+Group:		Libraries
+Requires:	%{name} = %{version}-%{release}
+
+%description c++
+GpgMEpp is a C++ wrapper (or C++ bindings) for the GnuPG project's
+gpgme (GnuPG Made Easy). It's based on KF5gpgmepp library.
+
+%description c++ -l pl.UTF-8
+GpgMEpp to interfejs C++ (wiązania C++) do biblioteki gpgme (GnuPG
+Made Easy) z projektu GnuPG. Jest oparty na bibliotece KF5gpgme.pp.
+
+%package c++-devel
+Summary:	Header files for GpgMEpp library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki GpgMEpp
+Group:		Development/Libraries
+Requires:	%{name}-c++ = %{version}-%{release}
+Requires:	libstdc++-devel >= 6:4.7
+
+%description c++-devel
+Header files for GpgMEpp library.
+
+%description c++-devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki GpgMEpp.
+
+%package c++-static
+Summary:	Static GpgMEpp library
+Summary(pl.UTF-8):	Statyczna biblioteka GpgMEpp
+Group:		Development/Libraries
+Requires:	%{name}-c++-devel = %{version}-%{release}
+
+%description c++-static
+Static GpgMEpp library.
+
+%description c++-static -l pl.UTF-8
+Statyczna biblioteka GpgMEpp.
+
+%package qt5
+Summary:	QGpgME - Qt 5 interface for GPGME library
+Summary(pl.UTF-8):	QGpgME - interfejs Qt 5 do biblioteki GPGME
+License:	GPL v2+ with Qt linking exception
+Group:		Libraries
+Requires:	%{name}-c++ = %{version}-%{release}
+Requires:	Qt5Core >= 5.0.0
+
+%description qt5
+QGpgME is Qt 5 interface for GPGME library, based on library from
+KF5gpgmepp. QGpgME provides a very high level Qt API around GpgMEpp.
+
+%description qt5 -l pl.UTF-8
+QGpgME to interfejs Qt 5 do biblioteki GPGME, oparty na bibliotece z
+KF5gpgmepp. QGpgME udostępnia API Qt do GpgMEpp bardzo wysokiego
+poziomu.
+
+%package qt5-devel
+Summary:	Header files for QGpgME library
+Summary(pl.UTF-8):	Pliki nagłówkowe biblioteki QGpgME
+License:	GPL v2+ with Qt linking exception
+Group:		Development/Libraries
+Requires:	%{name}-c++-devel = %{version}-%{release}
+Requires:	%{name}-qt5 = %{version}-%{release}
+Requires:	Qt5Core-devel >= 5.0.0
+
+%description qt5-devel
+Header files for QGpgME library.
+
+%description qt5-devel -l pl.UTF-8
+Pliki nagłówkowe biblioteki QGpgME.
+
+%package qt5-static
+Summary:	Static QGpgME library
+Summary(pl.UTF-8):	Statyczna biblioteka QGpgME
+License:	GPL v2+ with Qt linking exception
+Group:		Development/Libraries
+Requires:	%{name}-qt5-devel = %{version}-%{release}
+
+%description qt5-static
+Static QGpgME library.
+
+%description qt5-static -l pl.UTF-8
+Statyczna biblioteka QGpgME.
+
+%package -n python-pyme
+Summary:	PyME - Python 2 interface for GPGME library
+Summary(pl.UTF-8):	PyME - interfejs Pythona 2 do biblioteki GPGME
+Group:		Libraries/Python
+Requires:	%{name} = %{version}-%{release}
+Requires:	python-libs >= 1:2.7
+
+%description -n python-pyme
+PyME is a Python interface for GPGME library.
+
+%description -n python-pyme -l pl.UTF-8
+PyME to interfejs Pythona do biblioteki GPGME.
+
+%package -n python3-pyme
+Summary:	PyME - Python 3 interface for GPGME library
+Summary(pl.UTF-8):	PyME - interfejs Pythona 3 do biblioteki GPGME
+Group:		Libraries/Python
+Requires:	%{name} = %{version}-%{release}
+Requires:	python3-libs >= 1:3.4
+
+%description -n python3-pyme
+PyME is a Python interface for GPGME library.
+
+%description -n python3-pyme -l pl.UTF-8
+PyME to interfejs Pythona do biblioteki GPGME.
+
 %prep
 %setup -q
 %patch0 -p1
 %{!?with_tests:%patch1 -p1}
 %patch2 -p1
+%patch3 -p1
 
 %build
 %{__libtoolize}
@@ -82,7 +217,11 @@ Statyczna wersja biblioteki GPGME.
 %{__autoconf}
 %{__autoheader}
 %{__automake}
+# in enable-languages:
+# "python" means both pythons (if available), "python2" just python2, "python3" just python3
+# (cannot specify "python2 python3" due to script limitations)
 %configure \
+	--enable-languages="%{?with_commonlisp:cl} %{?with_cxx:cpp} %{?with_python2:python%{!?with_python3:2}} %{?with_python3:%{!?with_python2:python3}} %{?with_qt5:qt}" \
 	%{?with_static_libs:--enable-static}
 
 %{__make}
@@ -93,6 +232,10 @@ rm -rf $RPM_BUILD_ROOT
 %{__make} install \
 	DESTDIR=$RPM_BUILD_ROOT
 
+%if %{with python2}
+%py_postclean
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
@@ -105,9 +248,15 @@ rm -rf $RPM_BUILD_ROOT
 %postun	devel -p /sbin/postshell
 -/usr/sbin/fix-info-dir -c %{_infodir}
 
+%post	c++ -p /sbin/ldconfig
+%postun	c++ -p /sbin/ldconfig
+
+%post	qt5 -p /sbin/ldconfig
+%postun	qt5 -p /sbin/ldconfig
+
 %files
 %defattr(644,root,root,755)
-%doc README ChangeLog THANKS TODO NEWS AUTHORS
+%doc AUTHORS ChangeLog README NEWS THANKS TODO
 %attr(755,root,root) %{_bindir}/gpgme-tool
 %attr(755,root,root) %{_libdir}/libgpgme.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libgpgme.so.11
@@ -131,3 +280,79 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/libgpgme.a
 %{_libdir}/libgpgme-pthread.a
 %endif
+
+%if %{with cxx}
+%files c++
+%defattr(644,root,root,755)
+%doc lang/cpp/README
+%attr(755,root,root) %{_libdir}/libgpgmepp.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libgpgmepp.so.6
+
+%files c++-devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libgpgmepp.so
+%{_libdir}/libgpgmepp.la
+%{_includedir}/gpgme++
+%{_includedir}/gpgmepp_version.h
+%dir %{_libdir}/cmake/Gpgmepp
+%{_libdir}/cmake/Gpgmepp/GpgmeppConfig*.cmake
+
+%if %{with static_libs}
+%files c++-static
+%defattr(644,root,root,755)
+%{_libdir}/libgpgmepp.a
+%endif
+
+%if %{with qt5}
+%files qt5
+%defattr(644,root,root,755)
+%doc lang/qt/README
+%attr(755,root,root) %{_libdir}/libqgpgme.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libqgpgme.so.6
+
+%files qt5-devel
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libqgpgme.so
+%{_libdir}/libqgpgme.la
+%{_includedir}/QGpgME
+%{_includedir}/qgpgme
+%{_includedir}/qgpgme_version.h
+%{_libdir}/cmake/Gpgmepp/QGpgmeConfig*.cmake
+
+%if %{with static_libs}
+%files qt5-static
+%defattr(644,root,root,755)
+%{_libdir}/libqgpgme.a
+%endif
+%endif
+%endif
+
+%if %{with python2}
+%files -n python-pyme
+%defattr(644,root,root,755)
+%doc lang/python/README
+%dir %{py_sitedir}/pyme
+%attr(755,root,root) %{py_sitedir}/pyme/_gpgme.so
+%{py_sitedir}/pyme/*.py[co]
+%{py_sitedir}/pyme/constants
+%{py_sitedir}/pyme3-%{version}-py*.egg-info
+%endif
+
+%if %{with python3}
+%files -n python3-pyme
+%defattr(644,root,root,755)
+%doc lang/python/README
+%dir %{py3_sitedir}/pyme
+%attr(755,root,root) %{py3_sitedir}/pyme/_gpgme.cpython-*.so
+%{py3_sitedir}/pyme/*.py
+%{py3_sitedir}/pyme/__pycache__
+%{py3_sitedir}/pyme/constants
+%{py3_sitedir}/pyme3-%{version}-py*.egg-info
+%endif
+
+%if %{with commonlisp}
+%files -n common-lisp???-gpgme
+%defattr(644,root,root,755)
+%doc lang/cl/README
+%{_datadir}/common-lisp/source/gpgme
+%endif
diff --git a/gpgme-1.2.0-largefile.patch b/gpgme-1.2.0-largefile.patch
deleted file mode 100644
index 43f916d..0000000
--- a/gpgme-1.2.0-largefile.patch
+++ /dev/null
@@ -1,23 +0,0 @@
---- gpgme-1.3.1/src/gpgme-config.in.orig	2011-04-07 14:24:03.000000000 +0200
-+++ gpgme-1.3.1/src/gpgme-config.in	2011-06-18 08:59:14.834695342 +0200
-@@ -45,6 +45,10 @@
- cflags_glib="@GLIB_CFLAGS@"
- with_glib=
- 
-+if test "0 at NEED__FILE_OFFSET_BITS@" -gt "0" ; then
-+    cflags_lfs="-D_FILE_OFFSET_BITS=@NEED__FILE_OFFSET_BITS@"
-+fi
-+
- output=""
- 
- usage()
-@@ -136,6 +140,9 @@
-                   result="$result $i"
-               fi
-             done
-+	    if test "x$cflags_lfs" != "x"; then
-+		output="$output $cflags_lfs"
-+	    fi
-             output="$output $result"
-             ;;
- 	--libs)
diff --git a/gpgme-largefile.patch b/gpgme-largefile.patch
new file mode 100644
index 0000000..bab91d0
--- /dev/null
+++ b/gpgme-largefile.patch
@@ -0,0 +1,101 @@
+--- gpgme-1.3.1/src/gpgme-config.in.orig	2011-04-07 14:24:03.000000000 +0200
++++ gpgme-1.3.1/src/gpgme-config.in	2011-06-18 08:59:14.834695342 +0200
+@@ -45,6 +45,10 @@
+ cflags_glib="@GLIB_CFLAGS@"
+ with_glib=
+ 
++if test "0 at NEED__FILE_OFFSET_BITS@" -gt "0" ; then
++    cflags_lfs="-D_FILE_OFFSET_BITS=@NEED__FILE_OFFSET_BITS@"
++fi
++
+ output=""
+ 
+ usage()
+@@ -136,6 +140,9 @@
+                   result="$result $i"
+               fi
+             done
++	    if test "x$cflags_lfs" != "x"; then
++		output="$output $cflags_lfs"
++	    fi
+             output="$output $result"
+             ;;
+ 	--libs)
+--- gpgme-1.7.0/configure.ac.orig	2016-09-21 09:18:01.000000000 +0200
++++ gpgme-1.7.0/configure.ac	2016-10-08 08:46:21.898705647 +0200
+@@ -529,15 +529,18 @@
+ # A simple compile time check in gpgme.h for GNU/Linux systems that
+ # prevents a file offset bits mismatch between gpgme and the application.
+ NEED__FILE_OFFSET_BITS=0
++FILE_OFFSET_BITS_CPPFLAGS=
+ if test "$have_w32_system" != yes; then
+   case "$ac_cv_sys_file_offset_bits" in
+     "" | no | unknown) ;;
+     *)
+     NEED__FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits
++    FILE_OFFSET_BITS_CPPFLAGS="-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
+     ;;
+   esac
+ fi
+ AC_SUBST(NEED__FILE_OFFSET_BITS)
++AC_SUBST(FILE_OFFSET_BITS_CPPFLAGS)
+ 
+ # Figure out platform dependent typedefs for gpgme.h
+ if test "$have_w32_system" = yes; then
+--- gpgme-1.7.0/lang/cpp/src/Makefile.am.orig	2016-08-24 15:59:45.000000000 +0200
++++ gpgme-1.7.0/lang/cpp/src/Makefile.am	2016-10-08 08:47:06.225371811 +0200
+@@ -62,7 +62,7 @@
+ libgpgmepp_la_SOURCES = $(main_sources) $(gpgmepp_headers) context_vanilla.cpp \
+                         $(interface_headers) $(private_gpgmepp_headers)
+ 
+-AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
++AM_CPPFLAGS = -I$(top_builddir)/src @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ @FILE_OFFSET_BITS_CPPFLAGS@ \
+               -DBUILDING_GPGMEPP
+ 
+ libgpgmepp_la_LIBADD = ../../../src/libgpgme.la @LIBASSUAN_LIBS@
+--- gpgme-1.7.0/lang/python/setup.py.in.orig	2016-09-20 10:48:12.000000000 +0200
++++ gpgme-1.7.0/lang/python/setup.py.in	2016-10-08 09:24:35.815346124 +0200
+@@ -98,9 +98,8 @@
+ define_macros = []
+ libs = getconfig('libs')
+ 
+-# Define extra_macros for both the SWIG and C code
++# append extra_macros to define_macros
+ for k, v in extra_macros.items():
+-    extra_swig_opts.append("-D{0}={1}".format(k, v))
+     define_macros.append((k, str(v)))
+ 
+ for item in getconfig('cflags'):
+@@ -113,6 +112,10 @@
+         else:
+             define_macros.append((defitem[0], None))
+ 
++# use define_macros for both the SWIG and C code
++for k,v in define_macros:
++    extra_swig_opts.append("-D{0}={1}".format(k, v))
++
+ # Adjust include and library locations in case of win32
+ uname_s = os.popen("uname -s").read()
+ if uname_s.startswith("MINGW32"):
+--- gpgme-1.7.0/lang/qt/src/Makefile.am.orig	2016-09-19 08:35:20.000000000 +0200
++++ gpgme-1.7.0/lang/qt/src/Makefile.am	2016-10-08 09:28:39.158676678 +0200
+@@ -206,7 +206,7 @@
+ libqgpgme_la_SOURCES = $(qgpgme_sources) $(qgpgme_headers) $(private_qgpgme_headers)
+ 
+ AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \
+-              @GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ \
++              @GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ @LIBASSUAN_CFLAGS@ @FILE_OFFSET_BITS_CPPFLAGS@ \
+               -DBUILDING_QGPGME
+ 
+ libqgpgme_la_LIBADD = ../../cpp/src/libgpgmepp.la ../../../src/libgpgme.la \
+--- gpgme-1.7.0/lang/qt/tests/Makefile.am.orig	2016-09-20 19:09:38.000000000 +0200
++++ gpgme-1.7.0/lang/qt/tests/Makefile.am	2016-10-08 09:37:15.642004112 +0200
+@@ -38,7 +38,7 @@
+ 
+ AM_CPPFLAGS = -I$(top_srcdir)/lang/cpp/src -I$(top_builddir)/src \
+               @GPG_ERROR_CFLAGS@ @GPGME_QT_CFLAGS@ @GPG_ERROR_CFLAGS@ \
+-              @LIBASSUAN_CFLAGS@ @GPGME_QTTEST_CFLAGS@ -DBUILDING_QGPGME \
++              @LIBASSUAN_CFLAGS@ @GPGME_QTTEST_CFLAGS@ @FILE_OFFSET_BITS_CPPFLAGS@ -DBUILDING_QGPGME \
+               -I$(top_srcdir)/lang/qt/src \
+               -DTOP_SRCDIR="$(top_srcdir)"
+ 
diff --git a/gpgme-python.patch b/gpgme-python.patch
new file mode 100644
index 0000000..b8276f6
--- /dev/null
+++ b/gpgme-python.patch
@@ -0,0 +1,20 @@
+--- gpgme-1.7.0/lang/python/Makefile.am.orig	2016-09-21 09:18:00.000000000 +0200
++++ gpgme-1.7.0/lang/python/Makefile.am	2016-10-08 22:07:19.258156918 +0200
+@@ -92,14 +92,15 @@
+ 	rm -f install_files.txt
+ 	for PYTHON in $(PYTHONS); do \
+ 	  $$PYTHON setup.py install \
+-	  --prefix $(DESTDIR)$(prefix) \
++	  --prefix $(prefix) \
++	  --root $(DESTDIR) \
++	  --optimize=2 \
+ 	  --record files.txt \
+ 	  --verbose ; \
+ 	  cat files.txt >> install_files.txt ; \
+ 	  rm files.txt ; \
+ 	done
+ 	$(MKDIR_P) $(DESTDIR)$(pythondir)/pyme
+-	mv install_files.txt $(DESTDIR)$(pythondir)/pyme
+ 
+ uninstall-local:
+ 	xargs <$(DESTDIR)$(pythondir)/pyme/install_files.txt -- rm -rf --
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gpgme.git/commitdiff/04bb14bcab64b4995d7b22bd28ec4f0e53daf194



More information about the pld-cvs-commit mailing list