Blob Blame History Raw
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}

%global pear_name    Graph
%global channel      components.ez.no

Name:           php-ezc-Graph
Version:        1.5
Release:        1%{?dist}
Summary:        A component for creating pie charts, line graphs and other kinds of diagrams

Group:          Development/Libraries
License:        BSD
URL:            http://ezcomponents.org/
Source0:        http://components.ez.no/get/%{pear_name}-%{version}.tgz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch
BuildRequires:  php-pear >= 1:1.4.9-1.2
BuildRequires:  php-channel(%{channel})
Requires:       php-xml php-gd >= 5.2.1
Requires:       php-pear(%{channel}/Base) >= 1.8
Requires(post): %{__pear}
Requires(postun): %{__pear}

Provides:       php-pear(%{channel}/%{pear_name}) = %{version}

%description
The Graph component enables you to create line, pie and bar charts. 
The output driver mechanism allows you to create different image types
from each chart, and the available renderers make the chart output 
customizable from simple two-dimensional charts to beautiful 
three-dimensional data projections.


%prep
%setup -q -c
# Package.xml is V2.
mv package.xml %{pear_name}-%{version}/%{name}.xml
cd %{pear_name}-%{version}


%build
cd %{pear_name}-%{version}
# Empty build section, most likely nothing required.


%install
cd %{pear_name}-%{version}
rm -rf $RPM_BUILD_ROOT docdir
%{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml

# Move documentation
mkdir -p docdir
mv $RPM_BUILD_ROOT%{pear_docdir}/* docdir


# Clean up unnecessary files
rm -rf $RPM_BUILD_ROOT%{pear_phpdir}/.??*

# Install XML package description
mkdir -p $RPM_BUILD_ROOT%{pear_xmldir}
install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pear_xmldir}


%clean
rm -rf $RPM_BUILD_ROOT


%post
%{__pear} install --nodeps --soft --force --register-only \
    %{pear_xmldir}/%{name}.xml >/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    %{__pear} uninstall --nodeps --ignore-errors --register-only \
        %{channel}/%{pear_name} >/dev/null || :
fi


%files
%defattr(-,root,root,-)
%doc %{pear_name}-%{version}/docdir/%{pear_name}/*
%{pear_xmldir}/%{name}.xml
%{pear_phpdir}/ezc/autoload/graph_autoload.php
%{pear_phpdir}/ezc/%{pear_name}
%{pear_datadir}/%{pear_name}



%changelog
* Wed Feb 16 2010 Remi Collet <Fedora@FamilleCollet.com> - 1.5-1
- intital spec (from pear make-rpm-spec + cleanup)