2021-02-20 16:59:45 +08:00
|
|
|
%bcond_without perl_Convert_ASN1_enables_optional_test
|
|
|
|
|
Summary: ASN.1 encode/decode library
|
|
|
|
|
Name: perl-Convert-ASN1
|
2023-09-08 15:42:34 +08:00
|
|
|
Version: 0.34
|
2021-02-20 16:59:45 +08:00
|
|
|
Release: 1
|
|
|
|
|
License: GPL+ or Artistic
|
|
|
|
|
URL: https://metacpan.org/release/Convert-ASN1
|
2023-09-08 15:42:34 +08:00
|
|
|
Source0: https://cpan.metacpan.org/authors/id/T/TI/TIMLEGGE/Convert-ASN1-%{version}.tar.gz
|
2022-05-18 16:29:02 +08:00
|
|
|
Patch0: Convert-ASN1-0.27-Use-temporary-output-files-for-tests.patch
|
2021-02-20 16:59:45 +08:00
|
|
|
BuildArch: noarch
|
|
|
|
|
BuildRequires: coreutils make perl-generators perl-interpreter
|
|
|
|
|
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.76 perl(strict) perl(warnings)
|
|
|
|
|
BuildRequires: perl(:VERSION) >= 5.4 perl(Carp) perl(constant) perl(Encode) perl(Exporter)
|
|
|
|
|
BuildRequires: perl(POSIX) perl(Socket) perl(Time::Local) perl(utf8) perl(vars) perl(bytes)
|
2022-05-18 16:29:02 +08:00
|
|
|
BuildRequires: perl(File::Temp) perl(IO::Socket) perl(Math::BigInt) >= 1.997 perl(Test::More) >= 0.90
|
2021-02-20 16:59:45 +08:00
|
|
|
%if %{with perl_Convert_ASN1_enables_optional_test}
|
|
|
|
|
BuildRequires: perl(Data::Dumper)
|
|
|
|
|
%endif
|
|
|
|
|
Requires: perl(:MODULE_COMPAT_%(eval "`perl -V:version`"; echo $version))
|
|
|
|
|
Suggests: perl(bytes)
|
|
|
|
|
Requires: perl(Carp) perl(Encode) perl(POSIX) perl(Time::Local) perl(utf8)
|
|
|
|
|
%global __requires_exclude %{?__requires_exclude:%{__requires_exclude}|}^perl\\(Math::BigInt\\)$
|
|
|
|
|
%description
|
|
|
|
|
Convert::ASN1 encodes and decodes ASN.1 data structures using BER/DER rules.
|
|
|
|
|
|
|
|
|
|
%package tests
|
|
|
|
|
Summary: Tests for %{name}
|
|
|
|
|
Requires: %{name} = %{?epoch:%{epoch}:}%{version}-%{release} perl-Test-Harness
|
|
|
|
|
Requires: perl(Math::BigInt) >= 1.997
|
|
|
|
|
%if %{with perl_Convert_ASN1_enables_optional_test}
|
|
|
|
|
Requires: perl(Data::Dumper)
|
|
|
|
|
%endif
|
|
|
|
|
%description tests
|
|
|
|
|
Tests from %{name}-%{version}. Execute them
|
|
|
|
|
with "%{_libexecdir}/%{name}/test".
|
|
|
|
|
|
|
|
|
|
%prep
|
|
|
|
|
%setup -q -n Convert-ASN1-%{version}
|
|
|
|
|
%patch0 -p1
|
2022-05-18 16:29:02 +08:00
|
|
|
|
|
|
|
|
for F in t/*.t; do
|
|
|
|
|
perl -i -MConfig -ple 'print $Config{startperl} if $. == 1 && !s{\A#!.*perl\b}{$Config{startperl}}' "$F"
|
|
|
|
|
chmod +x "$F"
|
|
|
|
|
done
|
2021-02-20 16:59:45 +08:00
|
|
|
|
|
|
|
|
%build
|
|
|
|
|
perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
|
|
|
|
|
%{make_build}
|
|
|
|
|
|
|
|
|
|
%install
|
|
|
|
|
%{make_install}
|
|
|
|
|
mkdir -p %{buildroot}/%{_libexecdir}/%{name}
|
|
|
|
|
cp -a t %{buildroot}/%{_libexecdir}/%{name}
|
|
|
|
|
cat > %{buildroot}/%{_libexecdir}/%{name}/test << 'EOF'
|
|
|
|
|
cd %{_libexecdir}/%{name} && exec prove -I . -j "$(getconf _NPROCESSORS_ONLN)"
|
|
|
|
|
EOF
|
|
|
|
|
chmod +x %{buildroot}/%{_libexecdir}/%{name}/test
|
|
|
|
|
%{_fixperms} %{buildroot}/*
|
|
|
|
|
|
|
|
|
|
%check
|
|
|
|
|
unset YYDEBUG
|
2022-05-18 16:29:02 +08:00
|
|
|
export HARNESS_OPTIONS=j$(perl -e 'if ($ARGV[0] =~ /.*-j([0-9][0-9]*).*/) {print $1} else {print 1}' -- '%{?_smp_mflags}')
|
2021-02-20 16:59:45 +08:00
|
|
|
make test
|
|
|
|
|
|
|
|
|
|
%files
|
|
|
|
|
%license LICENSE
|
|
|
|
|
%doc ChangeLog OldChanges README.md examples/
|
|
|
|
|
%{perl_vendorlib}/Convert/
|
|
|
|
|
%{_mandir}/man3/*.3pm*
|
|
|
|
|
|
|
|
|
|
%files tests
|
|
|
|
|
%{_libexecdir}/%{name}
|
|
|
|
|
|
|
|
|
|
%changelog
|
2023-09-08 15:42:34 +08:00
|
|
|
* Fri Sep 8 2023 liyanan <thistleslyn@163.com> - 0.34-1
|
|
|
|
|
- update to 0.34
|
|
|
|
|
|
2022-05-18 16:29:02 +08:00
|
|
|
* Wed May 18 2022 liyanan <liyanan@h-partners.com>- 0.33-1
|
|
|
|
|
- update to 0.33
|
|
|
|
|
|
2021-02-20 16:59:45 +08:00
|
|
|
* Sat Feb 20 2021 sunguoshuai <sunguoshuai@huawei.com> - 0.27-1
|
|
|
|
|
- package init
|