#
# $Id$
#
%define perlvendorlib %(eval "`PBPERLCMD -V:installvendorlib`"; echo $installvendorlib)
%define srcname PBPKG

Name:		PBPKG
Version:	PBVER
Release:	PBTAGPBSUF
Summary:	PBSUMMARY
Summary(fr):	Project Builder ou pb produit des paquets pour diverses distributions
License:	PBLIC
Group:		PBGRP
Url:		PBURL
Source:		PBREPO/PBSRC
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(id -u -n)
Requires:	perl >= 5.6.2,perl-Date-Manip,perl-ProjectBuilder,perl-File-MimeInfo,PBDEP
# If we want to run make test, we need these modules, but upstream we do tests for this one in another way
# also pb itself doesn't support using packages at the same time they are built yet
# see http://trac.project-builder.org/ticket/175
#BuildRequires:	perl-Date-Manip,perl-ProjectBuilder,perl-File-MimeInfo
PBBUILDARCH:	noarch
PBBUILDDEP

%description
PBDESC

%description -l fr
Project Builder ou pb est un programme pour produire des paquets pour 
diverses distributions.
Il réalise cela en minimisant la duplication des informations requises 
et par un jeu de fichiers de configuration très simples.

%prep
%setup -q -n %{srcname}-%{version}PBEXTDIR

%build
PBPERLCMD Makefile.PL INSTALLDIRS=vendor PBKEYWORD=${RPM_BUILD_ROOT}/PBFINALDIR
make

%install
%{__rm} -rf $RPM_BUILD_ROOT
make DESTDIR=${RPM_BUILD_ROOT} install
find ${RPM_BUILD_ROOT} -type f -name perllocal.pod -o -name .packlist -o -name '*.bs' -a -size 0 | xargs rm -f
find ${RPM_BUILD_ROOT} -type d -depth | xargs rmdir --ignore-fail-on-non-empty

#check
#make test

%clean
%{__rm} -rf $RPM_BUILD_ROOT

%files
%defattr(-,root,root)
%doc NEWS AUTHORS COPYING README
%{perl_vendorlib}/ProjectBuilder/
%{_bindir}/pb*
%{_mandir}/man1/*
%{_mandir}/man3/*

%changelog
PBLOG
