File project.diff of Package gpgme_BR

--- gpgme.spec.orig
+++ gpgme.spec
@@ -16,31 +16,25 @@
 #
 
 
-%global flavor @BUILD_FLAVOR@%{nil}
-%if "%{flavor}" == ""
+# Enable Qt bindings on TW and 42.3 (needed for KDE PIM)
+%define with_qt 0%{?suse_version} >= 1330 || 0%{?sle_version} >= 120300
+%define gpg2_ver %(rpm -q --qf '%%{VERSION}' gpg2 | cut -d '.' -f 1-2 | sed 's/\\.//g')
 %bcond_without python2
 %bcond_without python3
-%bcond_with qt
-%define psuffix %{nil}
-%else
-%bcond_with python2
-%bcond_with python3
-%bcond_without qt
-%define psuffix qt
-%endif
-Name:           gpgme%{psuffix}
+%bcond_without tests
+Name:           gpgme
 Version:        1.13.1
 Release:        0
 Summary:        Programmatic library interface to GnuPG
 License:        LGPL-2.1-or-later AND GPL-3.0-or-later
 Group:          Productivity/Security
 URL:            http://www.gnupg.org/related_software/gpgme/
-Source:         ftp://ftp.gnupg.org/gcrypt/gpgme/gpgme-%{version}.tar.bz2
-Source1:        ftp://ftp.gnupg.org/gcrypt/gpgme/gpgme-%{version}.tar.bz2.sig
+Source0:        ftp://ftp.gnupg.org/gcrypt/gpgme/%{name}-%{version}.tar.bz2
+Source1:        ftp://ftp.gnupg.org/gcrypt/gpgme/%{name}-%{version}.tar.bz2.sig
 Source2:        baselibs.conf
 Source3:        gpgme.keyring
 # used to have a fixed timestamp
-Source99:       gpgme.changes
+Source99:       %{name}.changes
 BuildRequires:  gcc-c++
 BuildRequires:  gpg2 >= 2.0.10
 BuildRequires:  libassuan-devel >= 2.4.2
@@ -55,10 +49,10 @@ BuildRequires:  python2-devel >= 2.7
 %if %{with python3}
 BuildRequires:  python3-devel >= 3.4
 %endif
-%if %{with qt}
+%if 0%{with_qt}
 BuildRequires:  pkgconfig(Qt5Core)
 BuildRequires:  pkgconfig(Qt5Test)
-%endif
+%endif # with_qt
 
 %description
 GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG
@@ -181,13 +175,17 @@ management.
 
 This package contains the bindings to use the library in Qt C++ applications.
 
+
 %prep
-%setup -q -n gpgme-%{version}
+%setup -q
 
 %ifarch %{ix86}
 sed -i -e '/t-callbacks.py/d' lang/python/tests/Makefile.{am,in}
 %endif
 
+### FSF address
+%__sed -i 's|59 Temple Place|51 Franklin Street|g;s|Suite 330|Fifth Floor|g;s|02111-1307|02110-1301|g' COPYING* lang/cl/*.* lang/cpp/src/*.* lang/qt/src/*.*
+
 %build
 build_timestamp=$(date -u +%{Y}-%{m}-%{dT}%{H}:%{M}+0000 -r %{SOURCE99})
 languages="cl cpp"
@@ -196,9 +194,9 @@ languages="cl cpp"
 languages="${languages} python"
 %endif
 
-%if %{with qt}
-languages="cpp qt"
-%endif
+%if 0%{?with_qt}
+languages="${languages} qt"
+%endif # with_qt
 
 %configure \
 	--disable-silent-rules \
@@ -223,41 +221,33 @@ find %{buildroot}%{python3_sitearch}/gpg
 rm -vf %{buildroot}%{python3_sitelib}/gpg/install_files.txt
 find %{buildroot}%{python3_sitearch}/gpg -type f -name "*.pyc" -delete -print
 %endif
-%if %{with qt}
-rm -r %{buildroot}%{_bindir}
-rm -r %{buildroot}%{_datadir}/aclocal/gpgme*
-rm -r %{buildroot}%{_includedir}/gpgme*
-rm -r %{buildroot}%{_infodir}/gpgme*
-rm -r %{buildroot}%{_libdir}/cmake/Gpgmepp
-rm -r %{buildroot}%{_libdir}/libgpgme*
-rm -r %{buildroot}%{_libdir}/pkgconfig/gpgme*
-%endif
 
+%if %{with tests}
+%if 0%{?gpg2_ver} >= 21
 %check
 %if ! 0%{?qemu_user_space_build}
 make %{?_smp_mflags} check
 %endif
-
-%if %{with qt}
-%post -n libqgpgme7 -p /sbin/ldconfig
-%postun -n libqgpgme7 -p /sbin/ldconfig
+%endif
 %endif
 
-%if !%{with qt}
 %post -n libgpgme11 -p /sbin/ldconfig
 %postun -n libgpgme11 -p /sbin/ldconfig
 %post -n libgpgmepp6 -p /sbin/ldconfig
 %postun -n libgpgmepp6 -p /sbin/ldconfig
+%if 0%{with_qt}
+%post -n libqgpgme7 -p /sbin/ldconfig
+%postun -n libqgpgme7 -p /sbin/ldconfig
+%endif # with_qt
 
 %post
 %install_info --info-dir=%{_infodir} %{_infodir}/gpgme.info%{ext_info}
 
 %preun
 %install_info_delete --info-dir=%{_infodir} %{_infodir}/gpgme.info%{ext_info}
-%endif
 
-%if !%{with qt}
 %files
+%defattr(-,root,root)
 %license COPYING COPYING.LESSER
 %doc AUTHORS ChangeLog ChangeLog-2011 README NEWS THANKS TODO VERSION
 %{_bindir}/gpgme-tool
@@ -267,9 +257,11 @@ make %{?_smp_mflags} check
 %{_infodir}/gpgme*
 
 %files -n libgpgme11
+%defattr(-,root,root)
 %{_libdir}/libgpgme.so.*
 
 %files -n libgpgme-devel
+%defattr(-,root,root)
 %{_libdir}/libgpgme.so
 %{_bindir}/gpgme-config
 %{_datadir}/aclocal/gpgme.m4
@@ -278,37 +270,42 @@ make %{?_smp_mflags} check
 %{_libdir}/pkgconfig/gpgme-glib.pc
 
 %files -n libgpgmepp6
+%defattr(-,root,root)
 %{_libdir}/libgpgmepp.so.*
 
 %files -n libgpgmepp-devel
+%defattr(-,root,root)
 %{_libdir}/libgpgmepp.so
 %{_includedir}/gpgme++
 %dir %{_libdir}/cmake
 %dir %{_libdir}/cmake/Gpgmepp
 %{_libdir}/cmake/Gpgmepp/GpgmeppConfig*.cmake
-%endif
 
 %if %{with python2}
 %files -n python2-gpg
+%defattr(-,root,root)
 %{python_sitearch}/gpg
 %endif
 
 %if %{with python3}
 %files -n python3-gpg
+%defattr(-,root,root)
 %{python3_sitearch}/gpg
 %endif
 
-%if %{with qt}
+%if 0%{with_qt}
 %files -n libqgpgme7
+%defattr(-,root,root)
 %{_libdir}/libqgpgme.so.*
 
 %files -n libqgpgme-devel
+%defattr(-,root,root)
 %{_includedir}/qgpgme/
 %{_includedir}/QGpgME/
 %dir %{_libdir}/cmake
 %dir %{_libdir}/cmake/QGpgme
 %{_libdir}/cmake/QGpgme/*.cmake
 %{_libdir}/libqgpgme.so
-%endif
+%endif # with_qt
 
 %changelog
openSUSE Build Service is sponsored by