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

Name:		php-pear-Mail-Mime
Version:	1.5.2
Release:	4%{?dist}
Summary:	Classes to create and decode mime messages

Group:		Development/Libraries
License:	PHP
URL:		http://pear.php.net/package/Mail_Mime
Source0:	http://pear.php.net/get/Mail_Mime-%{version}.tgz
Source1:	PHP-LICENSE-3.01
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

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

%description
A Package to enable easy creation of complex multipart emails. If you look for
a simple API for creating such emails, then Mail_Mime class will probably
suffice. Else you can use Mail_mimePart, which gives you better control about
MIME creation

%prep
%setup -q -c -n Mail_Mime-%{version}
[ -f package2.xml ] || mv package.xml package2.xml
mv package2.xml Mail_Mime-%{version}/Mail_Mime.xml

# Empty build section, nothing required
%build

%install
rm -rf %{buildroot} docdir

cd Mail_Mime-%{version}
%{__pear} install --nodeps --packagingroot %{buildroot} Mail_Mime.xml

# Move documentation
mkdir -p docdir
mv %{buildroot}%{pear_docdir}/* docdir
%{__install} -m 644 -c %{SOURCE1} docdir/Mail_Mime/LICENSE

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

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

%check
# Sanity check
lst=$(find %{buildroot}%{pear_xmldir} -exec grep -q %{buildroot} {} \; -print)
[ ! -z "$lst" ] && echo "Reference to BUILDROOT in $lst" && exit 1;

%clean
rm -rf %{buildroot}

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

%postun
# if refcount = 0 then package has been removed (not upgraded)
if [ "$1" -eq "0" ]; then
	%{__pear} uninstall --nodeps --ignore-errors --register-only Mail_Mime >/dev/null ||:
fi

%files
%defattr(-,root,root,-)
%doc Mail_Mime-%{version}/docdir/Mail_Mime/*
%{pear_xmldir}/Mail_Mime.xml
%{pear_testdir}/Mail_Mime
%{pear_datadir}/Mail_Mime
%{pear_phpdir}/Mail

%changelog
* Thu Aug 28 2008 Tom "spot" Callaway <tcallawa@redhat.com> 1.5.2-4
- fix license tag

* Thu Apr  3 2008 Brandon Holbrook <fedora at theholbrooks.org> 1.5.2-3
- Add Requirement for Mail_mimeDecode

* Wed May 16 2007 Brandon Holbrook <fedora at theholbrooks.org> 1.5.2-2
- Add Requirement for pear-1.6.0

* Wed May 16 2007 Brandon Holbrook <fedora at theholbrooks.org> 1.5.2-1
- Upgraded to 1.5.2

* Wed May 16 2007 Brandon Holbrook <fedora at theholbrooks.org> 1.4.0-1
- Upgraded to 1.4.0

* Wed Sep  6 2006 Brandon Holbrook <fedora at theholbrooks.org> 1.3.1-8
- Remove quotes from 'install' in %%post section (rpmlint has been fixed)
- More specific BR: php-pear EVR

* Tue Sep  5 2006 Brandon Holbrook <fedora at theholbrooks.org> 1.3.1-7
- New PEAR packaging standards

* Wed Jun 28 2006 Brandon Holbrook <fedora at theholbrooks.org> 1.3.1-6
- Replaced version dependency for BuildRequires: php-pear :)

* Wed Jun 28 2006 Brandon Holbrook <fedora at theholbrooks.org> 1.3.1-5
- Added Requires: php
- Removed version dependencies for php-pear(PEAR)
- Fixed incorrect URL line

* Tue Jun 27 2006 Brandon Holbrook <fedora at theholbrooks.org> 1.3.1-4
- Added comment about 'install' in %%post

* Tue Jun 27 2006 Brandon Holbrook <fedora at theholbrooks.org> 1.3.1-3
- Added php-pear version dependencies for (post) and (postun)
- Updated defattr
- Renamed from php-pear-Mail_Mime to php-pear-Mail-Mime
- Took ownership of /usr/share/pear/Mail/

* Mon Jun 26 2006 Brandon Holbrook <fedora at theholbrooks.org> 1.3.1-2
- inserted newlines into description

* Mon Jun 26 2006 Brandon Holbrook <fedora at theholbrooks.org> 1.3.1-1
- initial RPM borrowed HEAVILY from php-pear-Mail