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

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

Name:           php-ezc-Graph
Version:        1.5
Release:        7%{?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}

# This are really doc, not data, not used in the code
sed -e '/design/s/role="data"/role="doc"/' \
    -i %{name}.xml


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


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

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

# 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_docdir}/%{pear_name}
%{pear_xmldir}/%{name}.xml
%{pear_phpdir}/ezc/autoload/graph_autoload.php
%{pear_phpdir}/ezc/%{pear_name}


%changelog
* Tue Feb 19 2013 Remi Collet <remi@fedoraproject.org> - 1.5-7
- fix metadata location

* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sun Aug 19 2012 Remi Collet <remi@fedoraproject.org> - 1.5-5
- move data to doc (not used in the code, really doc)
- doc in /usr/share/doc/pear

* Fri Jul 20 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.5-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

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