File perl-Config-IniFiles.spec of Package perl-Config-IniFiles
#
# spec file for perl module Config::IniFiles
#
#SuSe specific Part
%if %{?sles_version:1}0
%define module_dir /usr/lib/perl5/
%define man3_dir /usr/share/man/man3/
%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
%if %{?centos_version:1}0
%define init 1
%if 0%{?centos_version} == 700
BuildRequires: perl-ExtUtils-MakeMaker perl-Module-Build perl-IO-Compress
Requires: perl-Module-Build perl-IO-Compress
%else
BuildRequires: perl-ExtUtils-MakeMaker perl-Module-Build perl-version-new perl-IO-Compress
Requires: perl-Module-Build perl-version-new perl-IO-Compress
%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
#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 perl-Module-Build
%endif
#Fedora specific Part
%if %{?fedora_version:1}0
%endif
#all Distros
%define module_name Config-IniFiles
%define module_version 2.83
Name: perl-%{module_name}
Version: %{module_version}
Release: 0
License: This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Summary: A module for reading .ini-style configuration files.
Url: https://metacpan.org/pod/Config::IniFiles
Group: perl/modules
Source: %{module_name}-%{module_version}.tar.gz
BuildRequires: perl perl-Module-Runtime
Requires: perl perl-Module-Runtime perl-List-MoreUtils
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
Config::IniFiles provides a way to have readable configuration files outside your Perl script. Configurations can be imported (inherited, stacked,...), sections can be grouped, and settings can be accessed from a tied hash.
%prep
cd %{_builddir}
tar -xf %{_sourcedir}/%{module_name}-%{module_version}.tar.gz
%build
cd %{_builddir}/%{module_name}-%{module_version}
perl Makefile.PL installdirs=vendor destdir=%{buildroot}
./Build
%install
cd %{_builddir}/%{module_name}-%{module_version}
./Build install
#In case the .packlist file contains the buildroot directory
perl -i -pe "s{%{buildroot}}{}g" %{buildroot}%{auto_dir}/Config/IniFiles/.packlist
find %{buildroot} -type f -name "perllocal.pod" -exec rm -f {} \;
%files
%defattr(-,root,root)
%dir %{auto_dir}/Config/
%dir %{auto_dir}/Config/IniFiles/
%dir %{module_dir}/vendor_perl/%{sub_dir}/Config/
%{auto_dir}/Config/IniFiles/.packlist
%{man3_dir}/Config::IniFiles.3pm.gz
%{module_dir}/vendor_perl/%{sub_dir}/Config/IniFiles.pm