diff --git a/gpgme.spec b/gpgme.spec index 6ef5b898ef5645111437d9ef19d3128319f02783..410f26dcc01d20c63bb36f5f469518e96e4cc8bc 100644 --- a/gpgme.spec +++ b/gpgme.spec @@ -1,16 +1,14 @@ -%define anolis_release 1 +%define anolis_release 2 -%bcond_without check - -%global gnupg2_min_ver 2.2.24 -%global libgpg_error_min_ver 1.36 +# add the build_check macro to control whether to run the test cases +%bcond_without build_check Name: gpgme -Summary: GnuPG Made Easy - high level crypto API +Summary: GnuPG Made Easy - Make access to GnuPG easier Version: 1.19.0 Release: %{anolis_release}%{?dist} -# MIT: src/cJSON.{c,h} (used by gpgme-json) +# src/cJSON.c and src/cJSON.h which used by gpgme-json are licensed under the MIT License: LGPLv2+ and MIT URL: https://gnupg.org/related_software/gpgme/ Source0: https://gnupg.org/ftp/gcrypt/gpgme/gpgme-%{version}.tar.bz2 @@ -21,53 +19,41 @@ Patch2: 0002-don-t-add-extra-libraries-for-linking.patch # considering the environment problem, so skip it Patch1001: 1001-Skip-4-qt-remarks-test-cases.patch -BuildRequires: make -BuildRequires: gcc -BuildRequires: python3-distutils-extra -BuildRequires: gcc-c++ +BuildRequires: cmake gcc gcc-c++ make +BuildRequires: chrpath BuildRequires: gawk -BuildRequires: gnupg2 >= %{gnupg2_min_ver} +BuildRequires: gnupg2 >= 2.2.24 BuildRequires: gnupg2-smime -BuildRequires: libgpg-error-devel >= %{libgpg_error_min_ver} +BuildRequires: libgpg-error-devel >= 1.36 BuildRequires: libassuan-devel >= 2.4.2 - BuildRequires: swig +BuildRequires: python3-distutils-extra -BuildRequires: chrpath - -BuildRequires: cmake - -Requires: gnupg2 >= %{gnupg2_min_ver} +Requires: gnupg2 >= 2.2.24 %description GnuPG Made Easy (GPGME) is a library designed to make access to GnuPG -easier for applications. It provides a high-level crypto API for +easier for applications. It provides a high-level crypto API for encryption, decryption, signing, signature verification and key -management. - -%package doc -Summary: Doc files for %{name} -Requires: %{name} = %{version}-%{release} -BuildArch: noarch - -%description doc -Doc files for %{name} +management. Currently it uses GnuPG's OpenPGP backend as the default, +but the API isn't restricted to this engine. We have, in fact, already +developed a backend for CMS (S/MIME). %package devel Summary: Development headers and libraries for %{name} Requires: %{name} = %{version}-%{release} %description devel -%{summary}. +This package contains the development headers and libraries for %{name}. %package -n %{name}pp -Summary: C++ bindings/wrapper for GPGME +Summary: C++ bindings/wrapper for %{name} Obsoletes: gpgme-pp < 1.8.0-7 Provides: gpgme-pp = %{version}-%{release} Requires: %{name} = %{version}-%{release} %description -n %{name}pp -%{summary}. +This package contains the C++ bindings/wrapper for %{name}. %package -n %{name}pp-devel Summary: Development libraries and header files for %{name}-pp @@ -77,16 +63,16 @@ Requires: %{name}pp = %{version}-%{release} Requires: %{name}-devel = %{version}-%{release} %description -n %{name}pp-devel -%{summary} +This package contains the development libraries and header files for %{name}-pp. %package -n q%{name} -Summary: Qt API bindings/wrapper for GPGME -Requires: %{name}pp%{?_isa} = %{version}-%{release} +Summary: Qt API bindings/wrapper for %{name} +Requires: %{name}pp = %{version}-%{release} BuildRequires: pkgconfig(Qt5Core) BuildRequires: pkgconfig(Qt5Test) %description -n q%{name} -%{summary}. +This package contains the Qt API bindings/wrapper for %{name}. %package -n q%{name}-devel Summary: Development libraries and header files for %{name} @@ -96,7 +82,7 @@ Requires: %{name}pp-devel BuildRequires: cmake %description -n q%{name}-devel -%{summary}. +This package contains the development libraries and header files for %{name}. %package -n python3-gpg Summary: %{name} bindings for Python 3 @@ -106,31 +92,45 @@ Requires: %{name} = %{version}-%{release} Obsoletes: platform-python-gpg < %{version}-%{release} %description -n python3-gpg -%{summary}. +This package contains the %{name} bindings for Python 3. + +%package doc +Summary: Doc files for %{name} +Requires: %{name} = %{version}-%{release} +BuildArch: noarch + +%description doc +This package contains the documentation for %{name}. %prep %autosetup -p1 +# change the static python version in configure to dynamic. sed -i 's/3.8/%{python3_version}/g' configure %build export CFLAGS='%{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' export CXXFLAGS='%{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' + +# remove unexpected '\n' in CFLAGS and CXXFLAGS export CFLAGS="$(echo ${CFLAGS} | tr '\n\\' ' ')" export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')" -%configure --disable-static --disable-silent-rules --enable-languages=cpp,qt,python +%configure --disable-static \ + --disable-silent-rules \ + --enable-languages=cpp,qt,python %make_build %install %make_install +# remove the install_files.txt file which is not needed rm -vf %{buildroot}%{python2_sitelib}/gpg/install_files.txt rm -vf %{buildroot}%{python3_sitelib}/gpg/install_files.txt %generate_compatibility_deps -%if %{with check} +%if %{with build_check} %check make check %endif @@ -143,9 +143,6 @@ make check %{_libdir}/lib%{name}.so.11* %{abidir}/lib%{name}.dump -%files doc -%doc AUTHORS NEWS README* - %files devel %{_bindir}/%{name}-config %{_bindir}/%{name}-tool @@ -183,7 +180,18 @@ make check %{python3_sitearch}/gpg/ %{abidir}/*%{name}*python*.dump +%files doc +%doc AUTHORS ChangeLog* NEWS README* THANKS TODO +%doc doc/HACKING + %changelog +* Mon Apr 10 2023 Kun(llfl) - 1.19.0-2 +- optimize spec file +- fix the wrong Summary of the package +- added comments for the spec +- optimize the build require list +- remove the unnecessary min version of the package gnupg2 and libgpg-error-devel + * Mon Mar 20 2023 Funda Wang - 1.19.0-1 - New version 1.19.0