File perl-Prima.spec of Package perl-Prima

#
# spec file for package perl-Prima (Version 1.24)
#
# Copyright (c) 2008 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/
#

# norootforbuild


Name:           perl-Prima
BuildRequires:  giflib-devel libpng-devel libtiff-devel xorg-x11 xorg-x11-devel
License:        BSD 3-Clause
Group:          Development/Libraries/Perl
AutoReqProv:    on
Requires:       perl xorg-x11 giflib libjpeg libpng  xorg-x11-libs
Version:        1.24
Release:        16
Summary:        A Perl toolkit for multi-platform GUI development
Url:            http://prima.eu.org
Source:         http://prima.eu.org/download/Prima-%{version}.tar.bz2
Source1:        VB_classes-decent.gif
Source2:        http://prima.eu.org/download/Prima.pdf.bz2
Source3:        happy-gcc-during_make.diff
Patch:          VB-decent.diff
Patch1:         dmitry.patch
Patch2:         Prima-GenericEvent.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%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.



Authors:
--------
    Dmitry Karasik <dmitry@karasik.eu.org>

%prep
%setup -q -n Prima-%{version}
cp %{S:1} Prima/VB/classes.gif
cp %{S:2} .
bunzip2 Prima.pdf.bz2
cp %{S:3} .
%patch -p1
%patch1 -p2
%patch2
# patch creates a .orig file. Our Installer is so greedy ...
rm -f Prima/VB/VB.pl.orig
echo _bindir= %{_bindir}
echo _libdir= %{_libdir}
echo perl_vendorlib= %{perl_vendorlib}
echo perl_vendorarch= %{perl_vendorarch}

%build
## man1+man3 try to hide in perl_vendorarch if PREFIX is set. force them back.
M=$RPM_BUILD_ROOT/%{_mandir}
MAKEFILE_ARGS="PREFIX=$RPM_BUILD_ROOT/usr INSTALL_MAN1=$M/man1 INSTALL_MAN3=$M/man3"
if [ "%_lib" = "lib64" ]; then
  MAKEFILE_ARGS="$MAKEFILE_ARGS LIBPATH+=/usr/X11/lib64"
fi
perl Makefile.PL $MAKEFILE_ARGS
## site_perl is not allowed anymore in SuSE Linux.
perl -i -pe 's{/site_perl/}{/vendor_perl/}g' Makefile
make OPTIMIZE="$RPM_OPT_FLAGS -Wall"
(ldd auto/Prima/Prima.so | grep -q libgif ) || echo "WARNING: gif codec required for VB"
# giflib-4.1.3:EGifCompressLine is not 64bit save. 
make test
### only three basic tests work without a DISPLAY.
### ... or more powerful tests: 
## neededforbuild xorg-x11-Xnest xorg-x11-Xvfb xorg-x11-fonts-100dpi xorg-x11-fonts-75dpi xorg-x11-fonts-scalable xorg-x11-server
##
## Xvfb :95 -fp /usr/X11R6/lib/X11/fonts/misc &
## trap "kill $!" EXIT
## sleep 5
## DISPLAY=:95 make test
##

%install
make install
## oops, Prima/Config.PL must not contain BUILD_ROOT
perl -ne 'print qq{$1\n} if m{--updateconfig\s+(\S+)}' Makefile | xargs perl -i -pe "s{$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}/Prima.pm
%{perl_vendorarch}/Prima/*
%{perl_vendorarch}/auto/*
%{perl_vendorarch}/gencls.pod

%changelog
* Fri Nov 28 2008 ro@suse.de
- rename GenericEvent (X.h global namespace pollution)
* Tue Apr 08 2008 jw@suse.de
- update to Prima-1.24. The upstream HISTORY file only says this:
  1.24  Better support for mingw and cygwin. New features in VB.
  1.23  Images can load and save to streams. Image loading process can be watched.
  1.22  Use GTK file dialogs if compiled with GTK2. Better use of mouse wheel for
  Calendar, ColorDialog, ComboBox, Notebooks, Scrollbar, and Sliders widgets.
- Added a patch from Dmitry to survive all self-tests on x86_64
* Mon Aug 06 2007 jw@suse.de
- update tp Prima-1.22
  Use GTK file dialogs if compiled with GTK2. Better use of mouse wheel for
  Calendar, ColorDialog, ComboBox, Notebooks, Scrollbar, and Sliders widgets.
* Fri Jun 01 2007 jw@suse.de
- make rpmlint happy.
  No devel package with C-headers for a perl package today.
* Fri Nov 17 2006 jw@suse.de
- update to Prima-1.21
  - no new features. Plain bugfix release.
* Wed Jul 26 2006 jw@suse.de
- happy-gcc.diff added, to fix uninitialized variables in code
  generated by gencls.pl
* Wed Jan 25 2006 mls@suse.de
- converted neededforbuild to BuildRequires
* Mon Jan 16 2006 jw@suse.de
- Update to Prima-1.20
* Wed Oct 19 2005 jw@suse.de
- Update to Prima-1.19
  Add Lists::vertical. Implement scrollable groups and notebooks.
  Make file and font dialogs resizeable.
* Tue Apr 26 2005 jw@suse.de
- okay sweety-6 did not like it.
  more Archs have lib64, thanks Marcus.
* Tue Apr 26 2005 jw@suse.de
- fixed warning: File listed twice
- added /usr/X11R6/lib64 for x86_64
- moved man pages out of perl_vendorarch
* Mon Apr 25 2005 jw@suse.de
- initial version: Prima-1.18
openSUSE Build Service is sponsored by