LogoopenSUSE Build Service > Projects
Sign Up | Log In

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

#
# spec file for perl module Math::Calc::Units
#

#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/x86_64-linux-thread-multi/auto
%define sub_dir         /5.18.2/
%else
%define auto_dir	/usr/lib/perl5/vendor_perl/%{sub_dir}/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
%else
BuildRequires:  perl-ExtUtils-MakeMaker perl-version-new
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

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

#all Distros
%define	module_name	Math-Calc-Units
%define module_version	1.07
Name:           perl-%{module_name}
Version:        %{module_version}
Release:	0
License:	The Artistic License 2.0 (GPL Compatible)
Summary:	Human-readable unit-aware calculator
Url:		https://metacpan.org/pod/Math::Calc::Units
Group:		perl/modules
Source:         %{module_name}-%{module_version}.tar.gz
BuildRequires:	perl
Requires:	perl
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Math::Calc::Units is a simple calculator that keeps track of units. It currently handles combinations of byte sizes and duration only, although adding any other multiplicative types is easy. Any unknown type is treated as a unique user type (with some effort to map English plurals to their singular forms).

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

%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}/Math/Calc/Units/.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/%{sub_dir}/x86_64-linux-thread-multi/perllocal.pod ]; then
#        rm -rf %{buildroot}/usr/lib/perl5/%{sub_dir}/x86_64-linux-thread-multi/perllocal.pod
#fi

%files
%defattr(-,root,root)
%dir %{module_dir}/vendor_perl/%{sub_dir}/Math/
%dir %{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/
%dir %{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/
%dir %{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Convert/
%dir %{auto_dir}/Math/
%dir %{auto_dir}/Math/Calc/
%dir %{auto_dir}/Math/Calc/Units/

/usr/bin/ucalc
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units.pm
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Compute.pm
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Convert.pm
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Convert/Base.pm
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Convert/Base2Metric.pm
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Convert/Byte.pm
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Convert/Combo.pm
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Convert/Date.pm
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Convert/Distance.pm
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Convert/Metric.pm
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Convert/Multi.pm
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Convert/Time.pm
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Grammar.pm
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Grammar.y
%{module_dir}/vendor_perl/%{sub_dir}/Math/Calc/Units/Rank.pm
%{auto_dir}/Math/Calc/Units/.packlist
%{man3_dir}/Math::Calc::Units.3pm.gz