File perl-Prima.spec of Package perl-Prima

#
# spec file for package perl-Prima
#
# Copyright (c) 2013 SUSE LINUX Products 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-Prima
BuildRequires:  giflib-devel
BuildRequires:  libpng-devel
BuildRequires:  libtiff-devel
BuildRequires:  perl
BuildRequires:  xkeyboard-config
BuildRequires:  xorg-x11
BuildRequires:  xorg-x11-Xvfb
BuildRequires:  xorg-x11-devel
%define         X_display         ":98"
Requires:       xorg-x11
Version:        1.37
Release:        0
Summary:        A Perl toolkit for multi-platform GUI development
License:        BSD-2-Clause
Group:          Development/Libraries/Perl
Url:            http://prima.eu.org
Source:         http://www.cpan.org/authors/id/K/KA/KARASIK/Prima-%{version}.tar.gz
Source1:        VB_classes-decent.gif
Source2:        Prima.pdf.bz2
Patch:          VB-decent.diff
Patch2:         Prima-GenericEvent.patch
Patch3:         gcc-warnings.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Requires:       perl-base = %perl_version

%description
Prima is an extensible Perl toolkit for multi-platform GUI development.
The toolkit contains a rich set of standard widgets and has emphasis on
2D image processing tasks. A Perl program using PRIMA looks and behaves
identically on X, Win32 and OS/2. The toolkit includes VB, a visual
builder and a graphic POD viewer.

%prep
%setup -q -n Prima-%{version}
cp %{S:1} Prima/VB/classes.gif
cp %{S:2} .
bunzip2 Prima.pdf.bz2
%patch -p1
%patch2
%patch3 -p1
# patch creates a .orig file. Our Installer is so greedy ...
rm -f Prima/VB/VB.pl.orig

%build
perl Makefile.PL
## site_perl is not allowed anymore in SuSE Linux.
perl -i -pe 's{/site_perl/}{/vendor_perl/}g' Makefile
make %{?_smp_mflags} OPTIMIZE="$RPM_OPT_FLAGS -Wall"
(ldd auto/Prima/Prima.so | grep -q libgif ) || echo "WARNING: gif codec required for VB"

%check
#############################################
### Launch a virtual framebuffer X server ###
#############################################
export DISPLAY=%{X_display}
Xvfb %{X_display} >& Xvfb.log &
trap "kill $! || true" EXIT
sleep 10
make test

%install
%perl_make_install
## oops, Prima/Config.pm must not contain BUILD_ROOT
find $RPM_BUILD_ROOT -name 'Config.pm' -print0 | xargs -0 perl -i -pe "s{\\Q$RPM_BUILD_ROOT}"'{}g'
###
### should these go to a perl-Prima-devel ?
find $RPM_BUILD_ROOT/%{perl_vendorarch} -name \*.h | xargs -t rm
%perl_process_packlist

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc Copying README HISTORY Prima.pdf
%doc %{_mandir}/man?/*
%{_bindir}/*
%dir %{perl_vendorarch}/Prima
%{perl_vendorarch}/gencls.pod
%{perl_vendorarch}/Prima.pm
%{perl_vendorarch}/Prima/*
%{perl_vendorarch}/auto/*

%changelog
openSUSE Build Service is sponsored by