LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File perl-Math-Round.spec of Package perl-Math-Round (Project home:snagview:perl)

#
# spec file for module Math:Round
#

#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
BuildRequires:  rrdtool
Requires:  rrdtool
%define auto_dir        /usr/lib/perl5/vendor_perl/5.18.2/auto
%define sub_dir         /5.18.2/
%else
%define auto_dir        /usr/lib/perl5/%{sub_dir}/auto/
%define sub_dir         /vendor_perl/5.10.0/
%endif
%endif

#RedHat specific Part
%if %{?rhel_version:1}0
%define module_dir      /usr/lib64/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
%else
BuildRequires:  perl-ExtUtils-MakeMaker perl-version-new
requires: perl-version-new
%endif
%define module_dir      /usr/share/perl5
%define sub_dir         /vendor_perl/
%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	Math-Round	
%define	module_version	0.07	
Name:           perl-%{module_name}
Version:        %{module_version}
Release:	0
License:	unknown	
Summary:	Supplies functions that will round numbers in different ways
Url:		https://metacpan.org/pod/Math::Round	
Group:		perl/modules
Source:       	%{module_name}-%{version}.tar.gz  
BuildRequires:	perl perl(Cwd)
Requires:	perl 
BuildRoot:      %{_tmppath}/%{module_name}-%{version}-build

%description
Math::Round supplies functions that will round numbers in different ways.

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

%build
cd %{_builddir}/%{module_name}-%{version}
perl Makefile.PL INSTALLMAN3DIR=%{man3_dir}
#osc prevents using site_perl
perl -i -pe 's{/site_perl/}{/vendor_perl/}g' Makefile
make

%install
cd %{_builddir}/%{module_name}-%{version}

%if %{?sles_version:1}0
%if 0%{?suse_version} >= 1315
make DESTDIR=%{buildroot} INSTALLVENDORARCH=/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi pure_vendor_install
find %{buildroot} -type f -name ".packlist" -exec rm -f {} \;
#perl -i -pe "s{%{buildroot}}{}g" %{buildroot}/usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/auto/Math/Round/.packlist
%else
make DESTDIR=%{buildroot} INSTALLVENDORARCH=/usr/lib/perl5/5.10.0/x86_64-linux-thread-multi pure_vendor_install
perl -i -pe "s{%{buildroot}}{}g" %{buildroot}/usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/auto/Math/Round/.packlist
%endif
%endif

%if %{?centos_version:1}0
make DESTDIR=%{buildroot} pure_vendor_install
perl -i -pe "s{%{buildroot}}{}g" %{buildroot}/usr/lib64/perl5/vendor_perl/auto/Math/Round/.packlist
%endif
			
find %{buildroot} -type f -name "perllocal.pod" -exec rm -f {} \;

#if [ -f %{buildroot}/usr/lib/perl5/%{sub_dir}/perllocal.pod ]; then
#	rm -rf %{buildroot}/usr/lib/perl5/%{sub_dir}/perllocal.pod
#fi
#
#if [ -f %{buildroot}/usr/lib64/perl5/perllocal.pod ]; then
#	rm -rf %{buildroot}/usr/lib64/perl5/perllocal.pod
#fi

%files
%defattr(-,root,root,-)
%dir %{auto_dir}/Math
%dir %{auto_dir}/Math/Round

%if %{?sles_version:1}0
%if 0%{?suse_version} >= 1315
%dir /usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/auto/Math/
%dir /usr/lib/perl5/5.18.2/x86_64-linux-thread-multi/auto/Math/Round/
%dir /usr/lib/perl5/vendor_perl/5.18.2/Math

#%{module_dir}/%{sub_dir}/Math/Round.pm
%{auto_dir}/Math/Round/autosplit.ix
/usr/lib/perl5/vendor_perl/5.18.2/Math/Round.pm
#/usr/lib/perl5/vendor_perl/5.18.2/auto/Math/Round/autosplit.ix
#/usr/lib/perl5/5.18.2/auto/Math/Round/.packlist
%{man3_dir}/Math::Round.3pm.gz
%else
%dir /usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/auto/Math/
%dir /usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/auto/Math/Round/
/usr/lib/perl5/5.10.0/x86_64-linux-thread-multi/auto/Math/Round/.packlist
%{auto_dir}/Math/Round/autosplit.ix
%dir %{module_dir}/%{sub_dir}/Math/
%{module_dir}/%{sub_dir}/Math/Round.pm
%{man3_dir}/Math::Round.3pm.gz
%endif
%endif

%exclude /usr/share/man/

%if %{?centos_version:1}0
/usr/share/perl5/vendor_perl/auto/Math/Round/autosplit.ix
/usr/share/perl5/vendor_perl/Math/Round.pm
/usr/lib64/perl5/vendor_perl/auto/Math/Round/.packlist
#/usr/share/man/man3/Math::Round.3pm
%endif