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

#
# spec file for perl module Config::Tiny
#

#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
Requires:	perl-Test-Simple perl-version-new
BuildRequires:  perl-ExtUtils-MakeMaker perl-Test-Simple perl-version-new

%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

#Fedora specific Part
%if %{?fedora_version:1}0
%endif

#all Distros
%define	module_name	Config-Tiny
%define module_version	2.20
Name:           perl-%{module_name}
Version:        %{module_version}
Release:	0
License:	The Artistic License 2.0 (GPL Compatible)
Summary:	Read/Write .ini style files with as little code as possible
Url:		https://metacpan.org/pod/Config::Tiny
Group:		perl/modules
Source:         %{module_name}-%{module_version}.tgz
BuildRequires:	perl
Requires:	perl
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
This module abstracts out the process of choosing one of several underlying implementations for a module.
This can be used to provide XS and pure Perl implementations of a module, or it could be used to load an implementation for a given OS or any other case of needing to provide multiple implementations.

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

%build
cd %{_builddir}/%{module_name}-%{module_version}
perl Makefile.PL 
make %{?_smp_mflags}

%install
cd %{_builddir}/%{module_name}-%{module_version}
make DESTDIR=%{buildroot} pure_vendor_install
#In case the .packlist file contains the buildroot directory
perl -i -pe "s{%{buildroot}}{}g" %{buildroot}%{auto_dir}/Config/Tiny/.packlist
find %{buildroot} -type f -name "perllocal.pod" -exec rm -f {} \;

#In case perllocal is created. The package should not own perllocal.pod. Its meant to be appendet to when installing a module locally
if [ -f %{buildroot}/usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/perllocal.pod ]; then
        rm -rf %{buildroot}/usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/perllocal.pod
fi

%files
%defattr(-,root,root)
%dir %{module_dir}/vendor_perl/%{sub_dir}/Config/
%dir %{auto_dir}/Config/
%dir %{auto_dir}/Config/Tiny/

%{module_dir}/vendor_perl/%{sub_dir}/Config/Tiny.pm
%{auto_dir}/Config/Tiny/.packlist
%{man3_dir}/Config::Tiny.3pm.gz



openSUSE Build Service is sponsored by