File perl-UUID.spec of Package perl-UUID

#
# spec file for perl module UUID
#

#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/%{_arch}-linux-thread-multi/
%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/%{_arch}-linux-thread-multi/
%endif
%endif

%if %{?centos_version:1}0
%define init                    1
%if 0%{?centos_version} == 700
BuildRequires:  perl-ExtUtils-MakeMaker perl-devel libuuid libuuid-devel
requires:       libuuid libuuid-devel
%else
BuildRequires:  perl-ExtUtils-MakeMaker perl-devel libuuid libuuid-devel perl-version-new
requires:	libuuid libuuid-devel perl-version-new
%endif

%define module_dir      /usr/lib64/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/share/perl5/vendor_perl/auto/
#no subdir for redhat
%define sub_dir		/
BuildRequires:  perl-ExtUtils-MakeMaker perl-devel
%endif


#all Distros
%define	module_name	UUID
%define module_version  0.24	
Name:           perl-%{module_name}
Version:        %{module_version}
Release:	0
License:	artistic_2	
Summary:	DCE compatible Universally Unique Identifier library for Perl	
Url:		https://metacpan.org/pod/UUID	
Group:		perl/modules
Source:         %{module_name}-%{module_version}.tar.gz
BuildRequires:	perl perl-Module-Runtime libuuid-devel perl-Devel-CheckLib
Requires:	perl perl-Module-Runtime perl-Devel-CheckLib
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
The UUID library is used to generate unique identifiers for objects that may be accessible beyond the local system. For instance, they could be used to generate unique HTTP cookies across multiple web servers without communication between the servers, and without fear of a name clash.

The generated UUIDs can be reasonably expected to be unique within a system, and unique across all systems, and are compatible with those created by the Open Software Foundation (OSF) Distributed Computing Environment (DCE) utility uuidgen.

%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} INSTALLVENDORARCH=%{module_dir}vendor_perl/%{sub_dir} pure_vendor_install
#In case the .packlist file contains the buildroot directory
#perl -i -pe "s{%{buildroot}}{}g" %{buildroot}%{auto_dir}/UUID/.packlist
find %{buildroot} -type f -name "perllocal.pod" -exec rm -f {} \;
find %{buildroot} -type f -name ".packlist" -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}%{module_dir}%{auto_dir}/%{_arch}-linux-thread-multi/perllocal.pod ]; then
#        rm -rf %{buildroot}%{module_dir}%{auto_dir}/%{_arch}-linux-thread-multi/perllocal.pod
#fi

%files
%defattr(755,root,root)
%{module_dir}/vendor_perl%{sub_dir}/UUID.pm
%dir %{auto_dir}/UUID
#%{auto_dir}/UUID/.packlist
%{auto_dir}/UUID/UUID.bs
%{auto_dir}/UUID/UUID.so

/usr/share/man/man3/UUID.3pm.gz

openSUSE Build Service is sponsored by