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

Name:           php-pear-HTML-Template-IT
Version:        1.3.0
Release:        2%{?dist}
Summary:        Integrated Templates

Group:          Development/Libraries
License:        BSD
URL:            http://pear.php.net/package/HTML_Template_IT
Source0:        http://download.pear.php.net/package/%{pear_name}-%{version}.tgz
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:      noarch
BuildRequires:  php-pear >= 1:1.4.9-1.2
Requires(post): %{__pear}
Requires(postun): %{__pear}
Provides:       php-pear(%{pear_name}) = %{version}


%description
HTML_Template_IT:
The Isotemplate API is somewhat tricky for a beginner although it is the
best one you can build.

Source and target can be block names or even handler names. This API gives
you a maximum of flexibility but you always have to know what you do which 
is quite unusual for php developer like me.
If all blocks are within one file, the script knows how they are nested and
in which way you have to parse them. IT knows that inner1 is a child of
block2, there's no need to tell him about this.

Features :
  * Nested blocks
  * Include external file
  * Custom tags format 

HTML_Template_ITX :
With this class you get the full power of the php lib template class.
You may have one file with blocks in it but you have as well one main file
and multiple files one for each block. This is quite useful when you have
user configurable websites. Using blocks not in the main template allows
you to modify some parts of your layout easily.
 
%prep
%setup -q -c
[ -f package2.xml ] || mv package.xml package2.xml
mv package2.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
sed -i -e 's/\r//' docdir/%{pear_name}/LICENSE
sed -i 's/\r//' docdir/%{pear_name}/examples/sample_it.php 
sed -i 's/\r//' docdir/%{pear_name}/examples/sample_itx_addblockfile.php

# 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 \
        pear.php.net/%{pear_name} >/dev/null || :
fi

%files
%defattr(-,root,root,-)
%doc %{pear_name}-%{version}/docdir/%{pear_name}/*
%{pear_xmldir}/%{name}.xml
%dir %{pear_phpdir}/HTML
%dir %{pear_phpdir}/HTML/Template
%{pear_phpdir}/HTML/Template/IT.php
%{pear_phpdir}/HTML/Template/ITX.php
%{pear_phpdir}/HTML/Template/IT_Error.php
%{pear_testdir}/HTML_Template_IT



%changelog
* Fri Mar 13 2010 David Hannequin <david.hannequin@gmail.com> - 1.3.0-2
- Fix wrong end of file 

* Fri Mar 12 2010 David Hannequin <david.hannequin@gmail.com> - 1.3.0-1
- Update 

* Tue Mar 11 2010 David Hannequin <david.hannequin@gmail.com> - 1.2.1-6
- Fix list of files,
- Fix spelling error.

* Wed Feb 22 2010 David Hannequin <david.hannequin@gmail.com> - 1.2.1-5
- Fix permission,
- Review description.

* Wed Feb 17 2010 David Hannequin <david.hannequin@gmail.com> - 1.2.1-4
- Fix summary,
- New build method. 

* Mon Feb 15 2010 David Hannequin <david.hannequin@gmail.com> - 1.2.1-2
- Add requires,
- Add macros.

* Fri Dec 4 2009 David Hannequin <david.hannequin@gmail.com> - 1.2.1-1
- Initial release.