File perl-YAML-Tiny.spec of Package perl-YAML-Tiny

#
# spec file for perl module RRD-Simple
#

#SuSe specific Part
%if %{?sles_version:1}0
%define module_dir      /usr/lib/perl5/
%define man3_dir        /usr/share/man/man3/
%if 0%{?suse_version} >= 1315
%define auto_dir 	/usr/lib/perl5/vendor_perl/5.18.2/x86_64-linux-thread-multi/auto
%define sub_dir         /5.18.2/
%else
%define auto_dir	/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi/auto
#suse prefers to install additional modules in a subdir (below module_dir)
%define sub_dir		/5.10.0/
%endif
%endif

#RedHat specific Part
%if %{?rhel_version:1}0
%define module_dir	/usr/share/perl5
%define man3_dir        /usr/share/man/man3
%define auto_dir	/usr/lib64/perl5/vendor_perl/auto/
#no subdir for redhat
%define sub_dir		/
BuildRequires:		perl-ExtUtils-MakeMaker
%endif

%if %{?centos_version:1}0
%define init           1
%if 0%{?centos_version} == 700
BuildRequires:  perl-ExtUtils-MakeMaker perl-Module-Install
%else
BuildRequires:  perl-ExtUtils-MakeMaker perl-version-new perl-Module-Install
requires: perl-version-new
%endif
%define module_dir      /usr/share/perl5
%define sub_dir         /
%define man3_dir        /usr/share/man/man3
%define auto_dir        /usr/lib64/perl5/vendor_perl/auto/
%endif

#all Distros
%define	module_name	YAML-Tiny
%define module_version	1.69	
Name:           perl-%{module_name}
Version:        %{module_version}
Release:	0
License:	The Apache Software License 2.0	
Summary:	YAML::Tiny - Read/Write YAML files with as little code as possible	
Url:		https://metacpan.org/pod/YAML::Tiny
Group:		perl/modules
Source:         %{module_name}-%{module_version}.tar.gz
BuildRequires:	perl
Requires:	perl
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Source1:	%name-rpmlintrc

%description
The YAML specification is huge. Really, really huge. It contains all the functionality of XML, except with flexibility and choice, which makes it easier to read, but with a formal specification that is more complex than XML.

%prep
cd %{_builddir}
tar -xf %{_sourcedir}/%{module_name}-%{module_version}.tar.gz

%build
cd %{_builddir}/%{module_name}-%{module_version}
perl Makefile.PL  destdir=%{buildroot} installdirs=vendor 
make %{?_smp_mflags}

%post

%install
cd %{_builddir}/%{module_name}-%{module_version}
make DESTDIR=%{buildroot} install
#In case the .packlist/perllocal.pod file contains the buildroot directory
find %{buildroot} -type f -name "perllocal.pod" -exec rm -f {} \;
find %{buildroot} -type f -name ".packlist" -exec rm -f {} \;
rm  -Rf %{buildroot}/usr/share/man
find %{buildroot} -type f | sed "s#%{buildroot}##g" > %{buildroot}/../%{name}-filelist
cat %{buildroot}/../%{name}-filelist
%files -f %{buildroot}/../%{name}-filelist
%defattr(-,root,root)
%if %{?sles_version:1}0
%if 0%{?suse_version} >= 1315
%dir /usr/lib/perl5/vendor_perl/5.18.2/YAML/
%else
%dir /usr/lib/perl5/vendor_perl/5.10.0/YAML/
%endif
%endif