File perl-ExtUtils-ParseXS.spec of Package perl-ExtUtils-ParseXS
#
# spec file for package perl-ExtUtils-ParseXS
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
Name: perl-ExtUtils-ParseXS
Version: 3.30
Release: 0
%define cpan_name ExtUtils-ParseXS
Summary: Converts Perl Xs Code Into C Code
License: GPL-1.0+ or Artistic-1.0
Group: Development/Libraries/Perl
Url: http://search.cpan.org/dist/ExtUtils-ParseXS/
Source0: http://www.cpan.org/authors/id/S/SM/SMUELLER/%{cpan_name}-%{version}.tar.gz
Source1: cpanspec.yml
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: perl
BuildRequires: perl-macros
BuildRequires: perl(ExtUtils::CBuilder)
BuildRequires: perl(ExtUtils::MakeMaker) >= 6.46
Requires: perl(ExtUtils::CBuilder)
Requires: perl(ExtUtils::MakeMaker) >= 6.46
%{perl_requires}
%description
'ExtUtils::ParseXS' will compile XS code into C code by embedding the
constructs necessary to let C functions manipulate Perl values and creates
the glue necessary to let Perl access those functions. The compiler uses
typemaps to determine how to map C function parameters and variables to
Perl values.
The compiler will search for typemap files called _typemap_. It will use
the following search path to find default typemaps, with the rightmost
typemap taking precedence.
../../../typemap:../../typemap:../typemap:typemap
%prep
%setup -q -n %{cpan_name}-%{version}
%build
%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="%{optflags}"
%{__make} %{?_smp_mflags}
%check
%{__make} test
%install
%perl_make_install
%perl_process_packlist
#perl_gen_filelist inlined because of bug in 42.1 and earlier
FILES=%{name}.files
# fgen_dir func
# IN: dir
fgen_dir(){
%{__cat} >> $FILES << EOF
%dir ${1}
EOF
}
# fgen_file func
# IN: file
fgen_file(){
%{__cat} >> $FILES << EOF
${1}
EOF
}
# check for files in %{perl_vendorlib}
RES=`find ${RPM_BUILD_ROOT}%{perl_vendorlib} -maxdepth 1 -type f`
if [ -n "$RES" ]; then
for file in $RES; do
fgen_file "%{perl_vendorlib}/$(basename ${file})"
done
fi
# get all dirs into array
base_dir="${RPM_BUILD_ROOT}%{perl_vendorlib}/"
for dir in `find ${base_dir} -type d | sort`; do
if [ "$dir" = "${base_dir}" ]; then
continue
else
el=`echo $dir | %{__awk} -F"${base_dir}" '{print $2}'`
all_dir=(${all_dir[@]} $el)
fi
done
# build filelist
for i in ${all_dir[@]}; do
# do not add "dir {perl_vendorlib/arch}/auto", included in perl package
if [ "${i}" = "auto" ]; then
continue
fi
if [ "%{perl_vendorlib}/${i}" = "%{perl_vendorarch}/auto" ]; then
continue
else
if [ -d ${base_dir}/${i} ]; then
RES=`find "${base_dir}/${i}" -maxdepth 1 -type f`
if [ -n "$RES" ]; then
fgen_dir "%{perl_vendorlib}/${i}"
for file in $RES; do
fgen_file "%{perl_vendorlib}/${i}/$(basename ${file})"
done
else
fgen_dir "%{perl_vendorlib}/${i}"
fi
fi
fi
done
# add man pages
# if exist :)
if [ -d "${RPM_BUILD_ROOT}%{_mandir}" ]; then
for file in `cd "${RPM_BUILD_ROOT}%{_mandir}" && find . -type f -name "*3pm*"`; do
if test -e "%{_mandir}/$file" -o -e "%{_mandir}/$file.gz"; then
mv ${RPM_BUILD_ROOT}%{_mandir}/$file ${RPM_BUILD_ROOT}%{_mandir}/${file/3pm/3pmc}
fi
done
fgen_file "%{_mandir}/man?/*"
fi
# add packlist file
# generated fom perllocal.pod
if [ -f "${RPM_BUILD_ROOT}/var/adm/perl-modules/%{name}" ]; then
fgen_file "/var/adm/perl-modules/%{name}"
fi
# check for files in %{_bindir}
if [ -d ${RPM_BUILD_ROOT}%{_bindir} ]; then
RES=`find "${RPM_BUILD_ROOT}%{_bindir}" -maxdepth 1 -type f`
if [ -n "$RES" ]; then
for file in $RES; do
fgen_file "%{_bindir}/$(basename ${file})"
done
fi
fi
%files -f %{name}.files
%defattr(-,root,root,755)
%doc Changes README
%changelog