%define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}
Summary:	common error codes for GnuPG related projects
Summary(ja):	GnuPG 関連プロジェクトで共通のエラーコード
Name:		libgpg-error
Version:	1.46
Release:	1%{?_dist_release}
Group:		system
Vendor:		Project Vine
Distribution:	Vine Linux
Packager:	iwaim

License:	LGPL
URL:		https://www.gnupg.org/related_software/libgpg-error/index.html
Source0:	https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-%{version}.tar.bz2
Source1:	https://gnupg.org/ftp/gcrypt/libgpg-error/libgpg-error-%{version}.tar.bz2.sig
BuildRoot:	%{_tmppath}/%{name}-%{version}-root

%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 devel
Summary:	Development files for the %{name} package
Summary(ja):	%{name} パッケージの開発用ファイル
Group:		programming
Requires:	%{name} = %{version}-%{release}

%description devel
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. This package
contains files necessary to develop applications using libgpg-error.


%package -n compat32-%{name}
Summary:	common error codes for GnuPG related projects
Summary(ja):	GnuPG 関連プロジェクトで共通のエラーコード
Group:		system,legacy
Requires:	%{name} = %{version}-%{release}

%description -n compat32-%{name}
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 compat32-%{name}-devel
Summary:	Development files for the %{name} package
Summary(ja):	%{name} パッケージの開発用ファイル
Group:		programming,legacy
Requires:	compat32-%{name} = %{version}-%{release}
Requires:	%{name}-devel = %{version}-%{release}

%description -n compat32-%{name}-devel
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. This package
contains files necessary to develop applications using libgpg-error.


%debug_package


%prep
%setup -q

# Modify configure to drop rpath for /usr/lib64
sed -i -e 's|sys_lib_dlsearch_path_spec="/lib /usr/lib|sys_lib_dlsearch_path_spec="/lib /usr/lib %{_libdir}|g' configure


%build
%configure \
	--disable-static \
	--disable-rpath \
	--enable-install-gpg-error-config
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT
%makeinstall

# remove unneeded files
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
rm -rf $RPM_BUILD_ROOT%{_datadir}/common-lisp
rm -f $RPM_BUILD_ROOT%{_infodir}/dir

%find_lang %{name}


%check
make check


%clean
rm -rf $RPM_BUILD_ROOT


%files -f %{name}.lang
%defattr(-,root,root)
%license COPYING COPYING.LIB
%doc AUTHORS README INSTALL NEWS ChangeLog
%{_bindir}/gpg-error
%{_libdir}/libgpg-error.so.*
%dir %{_datadir}/libgpg-error
%{_datadir}/libgpg-error/errorref.txt

%files devel
%defattr(-,root,root)
%{_bindir}/gpg-error-config
%{_bindir}/gpgrt-config
%{_bindir}/yat2m
%{_libdir}/libgpg-error.so
%{_libdir}/pkgconfig/gpg-error.pc
%{_includedir}/gpg-error.h
%{_includedir}/gpgrt.h
%{_datadir}/aclocal/gpg-error.m4
%{_datadir}/aclocal/gpgrt.m4
%{_infodir}/gpgrt.info*
%{_mandir}/man1/gpg-error-config.*

# compat32
%if %{build_compat32}
%files -n compat32-%{name}
%defattr(-,root,root)
%{_libdir}/libgpg-error.so.*

%files -n compat32-%{name}-devel
%defattr(-,root,root)
%{_libdir}/libgpg-error.so
%endif


%changelog
* Thu Jan 05 2023 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.46-1
- updated to 1.46.

* Thu Jul 14 2022 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.45-1
- updated to 1.45.
- dropped install-info scriptlets.

* Mon Mar 22 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.42-1
- updated to 1.42.
- dropped ldconfig scriptlets.

* Tue Feb 02 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.41-1
- updated to 1.41.

* Sat Sep 12 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.39-1
- updated to 1.39.

* Sun Mar 15 2020 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.37-1
- updated to 1.37.

* Sun May 05 2019 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.36-1
- updated to 1.36.

* Thu Mar 01 2018 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.27-1
- updated to 1.27.

* Mon Mar 20 2017 IWAI, Masaharu <iwaim.sub@gmail.com> 1.26-1
- update to 1.26
- add errorref.txt
- update URL tag
- add Packager tag

* Sat May 21 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.22-1
- new upstream release

* Mon Dec 30 2013 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.12-1
- new upstream release

* Mon Apr  4 2011 IWAI, Masaharu <iwai@alib.jp> 1.10-1
- new upstream release

* Sat Oct 02 2010 Yoji TOYODA <bsyamato@sea.plala.or.jp> 1.9-1
- new upstream release

* Thu Apr 29 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.7-1
- new upstream release
- added --disable-static to %%configure
- built with new toolchain

* Sat Jun 27 2009 NAKAMURA Kenta <kenta@vinelinux.org> 1.6-3
- added compat32 package for x86_64 arch support

* Tue Mar 31 2009 Daisuke SUZUKI <daisuke@linux.or.jp> 1.6-2
- spec in utf-8
- remove static lib

* Tue Mar 18 2008 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.6-1vl5
- new upstream release
- used _dist_release macro

* Fri Mar 09 2007 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.4-0vl1
- new upstream release
- add Vendor/Distribution tag

* Sun Apr 09 2006 KAZUKI SHIMURA <kazuki@ma.ccnw.ne.jp> 1.3-0vl1
- new upstream release

* Tue Nov 30 2004 Daisuke SUZUKI <daisuke@linux.or.jp> 1.0-0vl1
- initial build for Vine Linux

* Tue Aug 31 2004 Bill Nottingham <notting@redhat.com> - 1.0-1
- update to 1.0

* Tue Jun 15 2004 Elliot Lee <sopwith@redhat.com>
- rebuilt

* Fri Apr 16 2004 Bill Nottingham <notting@redhat.com> - 0.7-1
- adapt upstream specfile