diff --git a/0001-fix-stupid-ax_python_devel.patch b/0001-fix-stupid-ax_python_devel.patch new file mode 100644 index 0000000000000000000000000000000000000000..49e6a8ce35ec06d6e067f25cf4df686f6f00c61a --- /dev/null +++ b/0001-fix-stupid-ax_python_devel.patch @@ -0,0 +1,102 @@ +From 0fa82bc99c13d4d84a40db622dc654ebddf5e35c Mon Sep 17 00:00:00 2001 +From: liuzhilin +Date: Fri, 11 Mar 2022 08:49:28 -0500 +Subject: [PATCH] fix-stupid-ax_python_devel + +--- + configure | 16 ++++++++-------- + m4/ax_python_devel.m4 | 2 +- + 2 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/configure b/configure +index 803b354..bf015b9 100755 +--- a/configure ++++ b/configure +@@ -19871,7 +19871,7 @@ variable to configure. See \`\`configure --help'' for reference. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5 + $as_echo_n "checking for the distutils Python package... " >&6; } + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` +- if test -z "$ac_distutils_result"; then ++ if test $? -eq 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + else +@@ -20501,7 +20501,7 @@ variable to configure. See \`\`configure --help'' for reference. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5 + $as_echo_n "checking for the distutils Python package... " >&6; } + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` +- if test -z "$ac_distutils_result"; then ++ if test $? -eq 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + else +@@ -21131,7 +21131,7 @@ variable to configure. See \`\`configure --help'' for reference. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5 + $as_echo_n "checking for the distutils Python package... " >&6; } + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` +- if test -z "$ac_distutils_result"; then ++ if test $? -eq 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + else +@@ -21761,7 +21761,7 @@ variable to configure. See \`\`configure --help'' for reference. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5 + $as_echo_n "checking for the distutils Python package... " >&6; } + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` +- if test -z "$ac_distutils_result"; then ++ if test $? -eq 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + else +@@ -22391,7 +22391,7 @@ variable to configure. See \`\`configure --help'' for reference. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5 + $as_echo_n "checking for the distutils Python package... " >&6; } + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` +- if test -z "$ac_distutils_result"; then ++ if test $? -eq 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + else +@@ -23021,7 +23021,7 @@ variable to configure. See \`\`configure --help'' for reference. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5 + $as_echo_n "checking for the distutils Python package... " >&6; } + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` +- if test -z "$ac_distutils_result"; then ++ if test $? -eq 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + else +@@ -23651,7 +23651,7 @@ variable to configure. See \`\`configure --help'' for reference. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5 + $as_echo_n "checking for the distutils Python package... " >&6; } + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` +- if test -z "$ac_distutils_result"; then ++ if test $? -eq 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + else +@@ -24281,7 +24281,7 @@ variable to configure. See \`\`configure --help'' for reference. + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for the distutils Python package" >&5 + $as_echo_n "checking for the distutils Python package... " >&6; } + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` +- if test -z "$ac_distutils_result"; then ++ if test $? -eq 0; then + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 + $as_echo "yes" >&6; } + else +diff --git a/m4/ax_python_devel.m4 b/m4/ax_python_devel.m4 +index 55f0cff..65fb4b6 100644 +--- a/m4/ax_python_devel.m4 ++++ b/m4/ax_python_devel.m4 +@@ -137,7 +137,7 @@ variable to configure. See ``configure --help'' for reference. + # + AC_MSG_CHECKING([for the distutils Python package]) + ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` +- if test -z "$ac_distutils_result"; then ++ if test $? -eq 0; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) +-- +2.27.0 + diff --git a/gpgme-1.17.0.tar.bz2 b/gpgme-1.17.0.tar.bz2 new file mode 100644 index 0000000000000000000000000000000000000000..5e296e4d48cd4d61d83787864e16c2c8b6ec7c14 Binary files /dev/null and b/gpgme-1.17.0.tar.bz2 differ diff --git a/gpgme.spec b/gpgme.spec new file mode 100644 index 0000000000000000000000000000000000000000..ac287562b5303c170a9920a514f0cc882b3ce535 --- /dev/null +++ b/gpgme.spec @@ -0,0 +1,192 @@ +%define anolis_release 1 + +%bcond_without check + +%global gnupg2_min_ver 2.2.24 +%global libgpg_error_min_ver 1.36 + +Name: gpgme +Summary: GnuPG Made Easy - high level crypto API +Version: 1.17.0 +Release: %{anolis_release}%{?dist} + +# MIT: src/cJSON.{c,h} (used by gpgme-json) +License: LGPLv2+ and MIT +URL: https://gnupg.org/related_software/gpgme/ +Source0: https://gnupg.org/ftp/gcrypt/gpgme/gpgme-%{version}.tar.bz2 + +Patch1000: 0001-fix-stupid-ax_python_devel.patch + +BuildRequires: make +BuildRequires: gcc +BuildRequires: python3-distutils-extra +BuildRequires: gcc-c++ +BuildRequires: gawk +BuildRequires: gnupg2 >= %{gnupg2_min_ver} +BuildRequires: gnupg2-smime +BuildRequires: libgpg-error-devel >= %{libgpg_error_min_ver} +BuildRequires: libassuan-devel >= 2.4.2 + +BuildRequires: swig + +BuildRequires: chrpath + +BuildRequires: cmake + +Requires: gnupg2 >= %{gnupg2_min_ver} + +%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 +encryption, decryption, signing, signature verification and key +management. + +%package devel +Summary: Development headers and libraries for %{name} +Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: libgpg-error-devel%{?_isa} >= %{libgpg_error_min_ver} + +%description devel +%{summary}. + +%package -n %{name}pp +Summary: C++ bindings/wrapper for GPGME +Obsoletes: gpgme-pp < 1.8.0-7 +Provides: gpgme-pp = %{?epoch:%{epoch}:}%{version}-%{release} +Provides: gpgme-pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description -n %{name}pp +%{summary}. + +%package -n %{name}pp-devel +Summary: Development libraries and header files for %{name}-pp +Obsoletes: gpgme-pp-devel < 1.8.0-7 +Provides: gpgme-pp-devel = %{?epoch:%{epoch}:}%{version}-%{release} +Provides: gpgme-pp-devel%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: %{name}pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: %{name}-devel%{?_isa} +# For automatic provides +BuildRequires: cmake + +%description -n %{name}pp-devel +%{summary} + +%package -n q%{name} +Summary: Qt API bindings/wrapper for GPGME +Requires: %{name}pp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +BuildRequires: pkgconfig(Qt5Core) +BuildRequires: pkgconfig(Qt5Test) + +%description -n q%{name} +%{summary}. + +%package -n q%{name}-devel +Summary: Development libraries and header files for %{name} +Conflicts: kdepimlibs-devel < 4.14.10-17 +Requires: q%{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: %{name}pp-devel%{?_isa} +BuildRequires: cmake + +%description -n q%{name}-devel +%{summary}. + +%package -n python3-gpg +Summary: %{name} bindings for Python 3 +%{?python_provide:%python_provide python3-gpg} +BuildRequires: python3-devel +Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Obsoletes: platform-python-gpg < %{version}-%{release} + +%description -n python3-gpg +%{summary}. + +%prep +%autosetup -p1 + +## HACK ALERT +# The config script already suppresses the -L if it's /usr/lib, so cheat and +# set it to a value which we know will be suppressed. +sed -i -e 's|^libdir=@libdir@$|libdir=@exec_prefix@/lib|g' src/gpgme-config.in + +sed -i 's/3.8/%{python3_version}/g' configure + +%build +sed -i 's/\"x86-64-v2\"/\%[\"\"]/g' usr/lib/rpm/anolis/macros +export CFLAGS='%{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' +export CXXFLAGS='%{optflags} -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64' +export CFLAGS="$(echo ${CFLAGS} | tr '\n\\' ' ')" +export CXXFLAGS="$(echo ${CXXFLAGS} | tr '\n\\' ' ')" + + +%configure --disable-static --disable-silent-rules --enable-languages=cpp,qt,python +%make_build + +%install +%make_install + +# unpackaged files +rm -fv %{buildroot}%{_infodir}/dir +rm -fv %{buildroot}%{_libdir}/lib*.la + +chrpath -d %{buildroot}%{_bindir}/%{name}-tool +chrpath -d %{buildroot}%{_bindir}/%{name}-json +chrpath -d %{buildroot}%{_libdir}/lib%{name}pp.so* +chrpath -d %{buildroot}%{_libdir}/libq%{name}.so* + +rm -vf %{buildroot}%{python2_sitelib}/gpg/install_files.txt +rm -vf %{buildroot}%{python3_sitelib}/gpg/install_files.txt + +%if %{with check} +%check +make check +%endif + +%files +%license COPYING* LICENSES +%doc AUTHORS NEWS README* +%{_bindir}/%{name}-json +%{_libdir}/lib%{name}.so.11* + +%files devel +%{_bindir}/%{name}-config +%{_bindir}/%{name}-tool +%ifarch %{multilib_arches} +%{_bindir}/%{name}-config.%{_target_cpu} +%{_includedir}/%{name}-%{__isa_bits}.h +%endif +%{_includedir}/%{name}.h +%{_libdir}/lib%{name}.so +%{_datadir}/aclocal/%{name}.m4 +%{_infodir}/%{name}.info* +%{_libdir}/pkgconfig/%{name}*.pc + +%files -n %{name}pp +%doc lang/cpp/README +%{_libdir}/lib%{name}pp.so.6* + +%files -n %{name}pp-devel +%{_includedir}/%{name}++/ +%{_libdir}/lib%{name}pp.so +%{_libdir}/cmake/Gpgmepp/ + +%files -n q%{name} +%doc lang/qt/README +%{_libdir}/libq%{name}.so.7* + +%files -n q%{name}-devel +%{_includedir}/q%{name}/ +%{_includedir}/QGpgME/ +%{_libdir}/libq%{name}.so +%{_libdir}/cmake/QGpgme/ + +%files -n python3-gpg +%doc lang/python/README +%{python3_sitearch}/gpg-*.egg-info +%{python3_sitearch}/gpg/ + +%changelog +* Fri Mar 11 2022 liuzhilin - 1.17.0-1 +- Init for Anolis OS 23 +- fix stupid-ax_python_devel +