%define origname YAML

Summary: YAML Ain't Markup Language (tm) for Perl
Name: perl-YAML
Version: 1.30
Release: 1%{?_dist_release}
Group: programming
Vendor: Project Vine
Distribution: Vine Linux
Packager: iwaim

License: GPL+ or Artistic
URL: https://metacpan.org/pod/YAML
# Tarball created from https://cpan.metacpan.org/modules/by-module/YAML/YAML-%%{version}.tar.gz
# using script YAML-free (see https://bugzilla.redhat.com/show_bug.cgi?id=1813197)
Source0: YAML-free-%{version}.tar.gz
# Script to remove non-free content from upstream tarball
# Usage: YAML-free YAML-%%{version}.tar.gz
Source1: YAML-free

BuildRoot: %{_tmppath}/%{name}-%{version}-root
BuildArch: noarch
BuildRequires: perl
BuildRequires: perl(ExtUtils::MakeMaker)
BuildRequires: perl(Test::YAML)
Requires: perl

# Filter private provides:
# perl(yaml_mapping) perl(yaml_scalar) perl(yaml_sequence)
%global __provides_exclude ^perl\\(yaml_

%description
This module has been released to CPAN as YAML::Old, and soon YAML.pm
will be changed to just be a frontend interface module for all the
various Perl YAML implementation modules, including YAML::Old.

If you want robust and fast YAML processing using the normal Dump/Load
API, please consider switching to YAML::XS. It is by far the best Perl
module for YAML at this time. It requires that you have a C compiler,
since it is written in C.


%prep
%setup -q -n %{origname}-%{version} 


%build
CFLAGS="$RPM_OPT_FLAGS" perl Makefile.PL INSTALLDIRS=vendor NO_PACKLIST=1 NO_PERLLOCAL=1
%{make_build}


%install
rm -rf $RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_prefix}
make DESTDIR=$RPM_BUILD_ROOT install

find $RPM_BUILD_ROOT%{_prefix} -type f -print | 
	sed "s@^$RPM_BUILD_ROOT@@g" | 
	grep -v ^%{_mandir} | 
	grep -v perllocal.pod | 
	grep -v "\.packlist" > %{name}.files
if [ "$(cat %{name}.files)X" = "X" ] ; then
    echo "ERROR: EMPTY FILE LIST"
    exit -1
fi


%check
make test


%clean 
rm -rf $RPM_BUILD_ROOT


%files -f %{name}.files
%license LICENSE
%doc Changes CONTRIBUTING README
%dir %{perl_vendorlib}/YAML
%{_mandir}/man3/*


%changelog
* Thu Nov 18 2021 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 1.30-1
- new upstream release.
- built with perl-5.34.0.

* Tue Jul  1 2014 IWAI, Masaharu <iwaim.sub@gmail.com> 0.95-1
- build with Perl 5.16
- update to 0.95
- add BuildRequires: perl(ExtUtils::MakeMaker) >= 6.30
- update filter (Source1)
- using __perllibl_requires macro for VineSeed (vl7)

* Sat Mar 26 2011 IWAI, Masaharu <iwai@alib.jp> 0.72-1
- new upstream release
- using __perl_requires macro for VineSeed (vl6)

* Mon Feb 22 2010 IWAI, Masaharu <iwai@alib.jp> 0.71-1
- first release for Vine Linux
