libksba/libksba.spec
2024-02-20 17:36:21 +08:00

100 lines
2.7 KiB
RPMSpec

#
# spec file for package libksba
#
# Copyright (c) 2022-2023 ZhuningOS
#
%define soname 8
Name: libksba
Version: 1.3.5
Release: 150000.4.6.1
Summary: A X.509 Library
License: (LGPL-3.0+ or GPL-2.0+) and GPL-3.0+ and MIT
Group: Development/Libraries/C and C++
Url: http://www.gnupg.org/aegypten/
Source: ftp://ftp.gnupg.org/gcrypt/libksba/%{name}-%{version}.tar.bz2
Source2: ftp://ftp.gnupg.org/gcrypt/libksba/%{name}-%{version}.tar.bz2.sig
Source3: libksba.keyring
Source4: libksba.changes
Patch0: libksba-CVE-2022-3515.patch
#PATCH-FIX-UPSTREAM bsc#1206579 CVE-2022-47629 integer overflow in the CRL signature parser
Patch1: libksba-CVE-2022-47629.patch
BuildRequires: libgpg-error-devel >= 1.8
# FIXME: use proper Requires(pre/post/preun/...)
PreReq: %{install_info_prereq}
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
KSBA is a library to simplify the task of working with X.509
certificates, CMS data, and related data.
%package -n %{name}%{soname}
Summary: A X.509 Library
Group: Development/Libraries/C and C++
Provides: %{name} = %{version}
Obsoletes: %{name} < %{version}
%description -n %{name}%{soname}
KSBA is a library to simplify the task of working with X.509
certificates, CMS data, and related data.
%package devel
Summary: A X.509 Library
Group: Development/Libraries/C and C++
Requires: libgpg-error-devel
Requires: libksba = %{version}
Provides: libksba:%{_includedir}/ksba.h
%description devel
KSBA is a library to simplify the task of working with X.509
certificates, CMS data, and related data.
This package contains the needed files to compile and link against the
libksba.
%prep
%setup -q -n libksba-%{version}
%patch0 -p1
%patch1 -p1
%build
build_timestamp=$(date -u +%{Y}-%{m}-%{dT}%{H}:%{M}+0000 -r %{SOURCE4})
%configure \
--disable-static \
--with-pic \
--enable-build-timestamp="${build_timestamp}"
make %{?_smp_mflags}
%check
make %{?_smp_mflags} check
%install
make %{?_smp_mflags} DESTDIR=%{buildroot} install
find %{buildroot} -type f -name "*.la" -delete -print
%post -n %{name}%{soname} -p /sbin/ldconfig
%postun -n %{name}%{soname} -p /sbin/ldconfig
%files -n %{name}%{soname}
%defattr(-,root,root)
%license COPYING
%doc README AUTHORS ChangeLog NEWS THANKS TODO
%{_libdir}/libksba*.so.*
%post devel
%install_info --info-dir=%{_infodir} %{_infodir}/ksba.info.gz
%postun devel
%install_info_delete --info-dir=%{_infodir} %{_infodir}/ksba.info.gz
%files devel
%defattr(-,root,root)
%{_bindir}/*
%{_libdir}/libksba*.so
%{_includedir}/*
%{_infodir}/ksba*
%{_datadir}/aclocal/*
%changelog