File mingw64-libgpg-error.spec of Package mingw64-libgpg-error

#
# spec file for package mingw64-libgpg-error
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#

%define with_lisp 0

%define _name   libgpg-error

Name:           mingw64-%{_name}
Version:        1.45
Release:        0
Summary:        Library That Defines Common Error Values for All GnuPG Components
License:        GPL-2.0-or-later AND LGPL-2.1-or-later
Group:          Development/Libraries/C and C++
URL:            https://www.gnupg.org/
Source:         ftp://ftp.gnupg.org/gcrypt/libgpg-error/%{_name}-%{version}.tar.bz2
Source1:        ftp://ftp.gnupg.org/gcrypt/libgpg-error/%{_name}-%{version}.tar.bz2.sig
# http://www.gnupg.org/signature_key.en.html
Source2:        %{name}.keyring
Patch0:         libgpg-error-1.10-deffile.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  libtool
BuildRequires:  mingw64-cross-binutils
BuildRequires:  mingw64-cross-gcc
BuildRequires:  mingw64-cross-pkg-config
BuildRequires:  mingw64-filesystem >= 27
BuildRequires:  mingw64-gettext-tools
BuildRequires:  mingw64-win_iconv-devel
Requires:       %{name}-lang = %{version}
%_mingw64_package_header_debug
BuildArch:      noarch

%description
This is a library that defines common error values for all GnuPG
components.  Among these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt,
pinentry, SmartCard Daemon, and possibly more in the future.

%package -n mingw64-libgpg-error0
Summary:        Library That Defines Common Error Values for All GnuPG Components
License:        GPL-2.0-or-later AND LGPL-2.1-or-later
Group:          Development/Libraries/C and C++
Obsoletes:      mingw64-libgpg-error < %{version}-%{release}
Provides:       mingw64-libgpg-error = %{version}-%{release}

%description -n mingw64-libgpg-error0
This is a library that defines common error values for all GnuPG
components.  Among these are GPG, GPGSM, GPGME, GPG-Agent, libgcrypt,
pinentry, SmartCard Daemon, and possibly more in the future.

%package devel
Summary:        Development package for libgpg-error
License:        GPL-2.0-or-later AND LGPL-2.1-or-later AND MIT
Group:          Development/Libraries/C and C++
Requires:       mingw64-libgpg-error0 = %{version}

%description devel
Files needed for software development using libgpg-error.

%_mingw64_debug_package

%lang_package

%prep
%setup -q -n libgpg-error-%{version}
%patch -P 0 -p1 -b .deffile

%build
%if 0%{?leap_version} == 420300
sed -i '/AM_GNU_GETTEXT_VERSION/ s,^.*$,AM_GNU_GETTEXT_VERSION([0.19.2]),g' configure.ac
%endif
autoreconf -fvi
echo "lt_cv_deplibs_check_method='pass_all'" >>%{_mingw64_cache}
%{_mingw64_configure} --enable-shared --disable-static
make %{?_smp_mflags}

%install
%_mingw64_make_install
rm %{buildroot}%{_mingw64_libdir}/libgpg-error.la
%if ! %{with_lisp}
# Drop the lisp stuff, it depends on ASDF and CFFI
# which needs to be packaged first
rm -r %{buildroot}%{_mingw64_datadir}/common-lisp
%endif
rm -r %{buildroot}%{_mingw64_datadir}/info
%_mingw64_find_lang libgpg-error

%check
#make check %{?_smp_mflags}
#%{buildroot}/%{_bindir}/gpg-error-config --libs | grep -q -v "\-pthread"
#%{buildroot}/%{_bindir}/gpg-error-config --mt --libs | grep -q "\-pthread"


%files -n mingw64-libgpg-error0
%defattr(-,root,root)
%{_mingw64_bindir}/libgpg-error-0.dll

%files lang -f libgpg-error.lang
%defattr(-,root,root)

%files devel
%defattr(-,root,root)
%{_mingw64_bindir}/gpg-error.exe
%{_mingw64_bindir}/gpg-error-config
%{_mingw64_bindir}/gpgrt-config
%{_mingw64_bindir}/yat2m.exe
%{_mingw64_libdir}/libgpg-error.dll.a
%{_mingw64_libdir}/pkgconfig/gpg-error.pc
%{_mingw64_includedir}/gpg-error.h
%{_mingw64_includedir}/gpgrt.h
%{_mingw64_datadir}/aclocal/gpg-error.m4
%{_mingw64_datadir}/aclocal/gpgrt.m4
%if %{with_lisp}
%{_mingw64_datadir}/common-lisp/source/gpg-error/*
%endif
%dir %{_mingw64_datadir}/libgpg-error
%{_mingw64_datadir}/libgpg-error/errorref.txt
%{_mingw64_mandir}/man1/gpgrt-config.1.gz

%changelog
openSUSE Build Service is sponsored by