File php5-mailparse.spec of Package php5-mailparse

#
# spec file for package php5-mailparse
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define pkg_name    mailparse
Name:           php5-mailparse
Version:        2.1.6
Release:        0
Summary:        Email Message Manipulation
License:        PHP-2.2
Group:          Productivity/Networking/Web/Servers
Url:            http://pecl.php.net/package/mailparse
Source:         http://pecl.php.net/get/%{pkg_name}-%{version}.tgz
# PATCH-FIX-UPSTREAM mailparse-2.1.5-64bit.patch
Patch0:         mailparse-2.1.5-64bit.patch
# PATCH-FIX-UPSTREAM fix_mbstring_requirement.patch
Patch1:         fix_mbstring_requirement.patch
Patch2:         mailparse-update.patch
BuildRequires:  php5-devel
BuildRequires:  re2c
Requires:       php5-mbstring
Provides:       php-mailparse = %{version}
Obsoletes:      php-mailparse < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
%if %{?php_zend_api}0
Requires:       php(api) = %{php_core_api}
Requires:       php(zend-abi) = %{php_zend_api}
%else
%requires_eq    php5
%endif

%description
Mailparse is an extension for parsing and working with email messages.
It can deal with rfc822 and rfc2045 (MIME) compliant messages.

%prep
%setup -q -n %{pkg_name}-%{version}
# %patch0
%patch1
%patch2 -p1

%build
rm php_mailparse_rfc822.c
%{_bindir}/phpize
%configure
make %{?_smp_mflags}

%install
make DESTDIR=%{buildroot} install %{?_smp_mflags} INSTALL_ROOT=%{buildroot}
mkdir -p %{buildroot}%{_sysconfdir}/php5/conf.d
echo "extension=%{pkg_name}.so" >> %{buildroot}%{_sysconfdir}/php5/conf.d/%{pkg_name}.ini

%files
%defattr(-,root,root,-)
%doc CREDITS README
%{_libdir}/php5/extensions/%{pkg_name}.so
%config(noreplace) %{_sysconfdir}/php5/conf.d/%{pkg_name}.ini

%changelog
openSUSE Build Service is sponsored by