Sophie

Sophie

distrib > Fedora > 16 > x86_64 > media > updates-src > by-pkgid > d2f5949a15d0fcfd1fdb8fae1a862f56 > files > 4

perl-OpenOffice-UNO-0.07-3.fc16.src.rpm

%if 0%{?rhel} < 7 && 0%{?fedora} < 16
%global soffice openoffice.org
%else
%global soffice libreoffice
%endif

Name:           perl-OpenOffice-UNO
Version:        0.07
Release:        3%{?dist}
Summary:        Interface to OpenOffice's UNO run-time
License:        LGPLv2+ and SISSL
Group:          Development/Libraries
URL:            http://search.cpan.org/dist/OpenOffice-UNO/
Source0:        http://www.cpan.org/authors/id/M/MB/MBARBON/OpenOffice-UNO-%{version}.tar.gz
Patch0:         0001-Preserve-cflags.patch
Patch1:         0001-Hardcode-rpath-to-uno-library.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires:  perl(ExtUtils::MakeMaker)
BuildRequires:  perl(Test::More)
BuildRequires:  perl(Cwd)
BuildRequires:  perl(Exporter)
BuildRequires:  perl(File::Path)
BuildRequires:  /usr/bin/ooffice
BuildRequires:  %{soffice}-sdk >= 1:3
BuildRequires:  %{soffice}-sdk < 1:4
BuildRequires:  %{soffice}-writer
BuildRequires:  %{soffice}-calc
BuildRequires:  %{soffice}-headless
Requires:       perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))

%description
A bridge to the OpenOffice.org API.


%prep
%setup -q -n OpenOffice-UNO-%{version}
%patch0 -p1
%patch1 -p1


%build
. $(find %{_libdir}/%{soffice} -name setsdkenv_unix.sh -print -quit)

# Auto-set bootstrap. Weird, but similar to what is done for python bindings.
awk '/bootstrap OpenOffice::UNO/ \
        {print "$ENV{URE_BOOTSTRAP} ||= \"vnd.sun.star.pathname:'$(echo %{_libdir}/%{soffice}*/program/fundamentalrc)'\";"}
        {print}' UNO.pm >UNO-bootstrap.pm
mv UNO-bootstrap.pm UNO.pm

%{__perl} Makefile.PL INSTALLDIRS=vendor OPTIMIZE="$RPM_OPT_FLAGS"
make %{?_smp_mflags}


%install
rm -rf $RPM_BUILD_ROOT

make pure_install PERL_INSTALL_ROOT=$RPM_BUILD_ROOT

find $RPM_BUILD_ROOT -type f -name .packlist -exec rm -f {} \;
find $RPM_BUILD_ROOT -type f -name '*.bs' -size 0 -exec rm -f {} \;
find $RPM_BUILD_ROOT -depth -type d -exec rmdir {} 2>/dev/null \;

%{_fixperms} $RPM_BUILD_ROOT/*


%check
setsid ooffice -headless -accept='socket,host=localhost,port=8100;urp;StarOffice.ServiceManager' &
trap "kill -- -$! ||:" EXIT
sleep 10 # In fact, OpenOffice is known to start almost instanteously
make test


%clean
rm -rf $RPM_BUILD_ROOT


%files
%defattr(-,root,root,-)
%doc Changes README
%{perl_vendorarch}/auto/*
%{perl_vendorarch}/OpenOffice*
%{_mandir}/man3/*


%changelog
* Sat Feb 11 2012 Lubomir Rintel (GoodData) <lubo.rintel@gooddata.com> 0.07-3
- Add missing BRs, fix up the rpath patch (Petr Å abata, #788990)

* Sat Feb 11 2012 Lubomir Rintel (GoodData) <lubo.rintel@gooddata.com> 0.07-2
- Correctly load SDK environment in fc18 (Petr Å abata, #788990)

* Wed Feb 08 2012 Lubomir Rintel (GoodData) <lubo.rintel@gooddata.com> 0.07-1
- Specfile autogenerated by cpanspec 1.78.
- Transmogrified