Blob Blame History Raw
%{!?__pear: %{expand: %%global __pear %{_bindir}/pear}}
%define pear_name Mail
%define channel components.ez.no

Name:           php-ezc-Mail
Version:        1.6.3
Release:        1%{?dist}
Summary:        Construct and/or parse Mail messages conforming to the mail standard

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-common >= 5.2.1
Requires:       php-mcrypt
Requires:       php-pecl-Fileinfo
Requires:       php-pear(%{channel}/Base) >= 1.6.1
Requires(post): %{__pear}
Requires(postun): %{__pear}

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


%description
The component allows you construct and/or parse Mail messages conforming to
the mail standard. It has support for attachments, multipart messages and HTML
mail. It also interfaces with SMTP to send mail or IMAP, POP3 or mbox to
retrieve e-mail.


%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 %{buildroot} docdir
%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml

# Move documentation
mv %{buildroot}%{pear_docdir}/%{pear_name}/docs ./docdir
rm -rf %{buildroot}%{pear_docdir}

# rpmlint (W): wrong-file-end-of-line-encoding
sed -i -e 's|\r||g' ./docdir/tutorial/test-mail.mail

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

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


%clean
rm -rf %{buildroot}


%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_xmldir}/%{name}.xml
%{pear_phpdir}/data/%{pear_name}
%{pear_phpdir}/ezc/%{pear_name}
%{pear_phpdir}/ezc/autoload/mail_autoload.php


%changelog
* Tue Jun 30 2009 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.6.3-1
- Update to 1.6.3

* Tue May 12 2009 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.6.2-1
- Update to 1.6.2

* Thu Apr 27 2009 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.6.1-3
- Requires php-pecl-Fileinfo

* Thu Apr 23 2009 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.6.1-2
- rpmlint is now silent

* Thu Mar 19 2009 Guillaume Kulakowski <guillaume DOT kulakowski AT fedoraproject DOT org> - 1.6.1-1
- Initial packaging