3b4be32
%{!?php_inidir:  %global php_inidir   %{_sysconfdir}/php.d}
3b4be32
%{!?__pecl:      %global __pecl       %{_bindir}/pecl}
3b4be32
%{!?__php:       %global __php        %{_bindir}/php}
d278117
3cffd88
%global pecl_name mailparse
3b4be32
%global with_zts  0%{?__ztsphp:1}
d2a7d57
%if "%{php_version}" < "5.6"
7a188df
# After mbstring
7a188df
%global ini_name  z-%{pecl_name}.ini
7a188df
%else
7a188df
# After 20-mbstring
7a188df
%global ini_name  40-%{pecl_name}.ini
7a188df
%endif
3cffd88
3cffd88
Summary:   PHP PECL package for parsing and working with email messages
3cffd88
Name:      php-pecl-mailparse
206c1fa
Version:   2.1.6
4dc76e1
Release:   12%{?dist}
3cffd88
License:   PHP
3cffd88
Group:     Development/Languages
3cffd88
URL:       http://pecl.php.net/package/mailparse
3cffd88
Source0:   http://pecl.php.net/get/mailparse-%{version}.tgz
3cffd88
3b4be32
# https://bugs.php.net/65861 - Please Provides LICENSE file
3b4be32
# URL from mailparse.c header
3b4be32
Source1:   http://www.php.net/license/2_02.txt
c312cc8
3cffd88
BuildRequires: php-devel, php-pear
3cffd88
# mbstring need for tests
3cffd88
BuildRequires: php-mbstring
3cffd88
# Required by phpize
3cffd88
BuildRequires: autoconf, automake, libtool
3cffd88
3b4be32
Requires: php-mbstring%{?_isa}
0e158a1
Requires: php(zend-abi) = %{php_zend_api}
0e158a1
Requires: php(api) = %{php_core_api}
d278117
Requires(post): %{__pecl}
d278117
Requires(postun): %{__pecl}
3cffd88
3b4be32
Provides: php-%{pecl_name} = %{version}
3b4be32
Provides: php-%{pecl_name}%{?_isa} = %{version}
3b4be32
Provides: php-pecl(%{pecl_name}) = %{version}
3b4be32
Provides: php-pecl(%{pecl_name})%{?_isa} = %{version}
3cffd88
3b4be32
7a188df
%if 0%{?fedora} < 20 && 0%{?rhel} < 7
3b4be32
# Filter shared private
206c1fa
%{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$}
c312cc8
%{?filter_setup}
3b4be32
%endif
3cffd88
cvsextras 61e73db
cvsextras 61e73db
%description
cvsextras 61e73db
Mailparse is an extension for parsing and working with email messages.
cvsextras 61e73db
It can deal with rfc822 and rfc2045 (MIME) compliant messages.
cvsextras 61e73db
cvsextras 61e73db
831fe84
%prep
0e158a1
# We need to create our working directory since the package*.xml files from
0e158a1
# the sources extract straight to it
0e158a1
%setup -q -c
d278117
3b4be32
mv %{pecl_name}-%{version} NTS
3b4be32
3b4be32
cd NTS
3b4be32
cp %{SOURCE1} LICENSE
3b4be32
extver=$(sed -n '/#define PHP_MAILPARSE_VERSION/{s/.* "//;s/".*$//;p}' php_mailparse.h)
c312cc8
if test "x${extver}" != "x%{version}"; then
c312cc8
   : Error: Upstream version is ${extver}, expecting %{version}.
c312cc8
   exit 1
c312cc8
fi
3b4be32
cd ..
c312cc8
7a188df
cat > %{ini_name} << 'EOF'
c312cc8
; Enable mailparse extension module
c312cc8
extension = mailparse.so
c312cc8
c312cc8
; Set the default charset
c312cc8
;mailparse.def_charset = us-ascii
c312cc8
EOF
c312cc8
3b4be32
chmod -x NTS/*.{php,c,h}
cvsextras 61e73db
3b4be32
%if %{with_zts}
3b4be32
cp -pr NTS ZTS
206c1fa
%endif
206c1fa
cvsextras 61e73db
cvsextras 61e73db
%build
3b4be32
cd NTS
cvsextras 61e73db
phpize
206c1fa
%configure --with-php-config=%{_bindir}/php-config
c312cc8
make %{?_smp_mflags}
cvsextras 61e73db
3b4be32
%if %{with_zts}
3b4be32
cd ../ZTS
206c1fa
zts-phpize
206c1fa
%configure --with-php-config=%{_bindir}/zts-php-config
206c1fa
make %{?_smp_mflags}
206c1fa
%endif
206c1fa
cvsextras 61e73db
cvsextras 61e73db
%install
3b4be32
make -C NTS install INSTALL_ROOT=%{buildroot}
c312cc8
# Drop in the bit of configuration
7a188df
install -Dpm 644 %{ini_name} %{buildroot}%{php_inidir}/%{ini_name}
d278117
3b4be32
%if %{with_zts}
3b4be32
make -C ZTS install INSTALL_ROOT=%{buildroot}
206c1fa
# Drop in the bit of configuration
7a188df
install -Dpm 644 %{ini_name} %{buildroot}%{php_ztsinidir}/%{ini_name}
206c1fa
%endif
206c1fa
206c1fa
# Install XML package description
206c1fa
install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
206c1fa
3b4be32
# Test & Documentation
3b4be32
for i in $(grep 'role="test"' package.xml | sed -e 's/^.*name="//;s/".*$//')
3b4be32
do install -Dpm 644 NTS/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i
3b4be32
done
3b4be32
for i in LICENSE $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//')
3b4be32
do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i
3b4be32
done
d278117
c312cc8
3b4be32
%check
3b4be32
: Minimal load test for NTS extension
3b4be32
%{__php} --no-php-ini \
3b4be32
    --define extension=mbstring.so \
3b4be32
    --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \
3b4be32
    --modules | grep %{pecl_name}
3b4be32
3b4be32
: Upstream test suite for NTS extension
3b4be32
cd NTS
3b4be32
TEST_PHP_EXECUTABLE=%{__php} \
206c1fa
NO_INTERACTION=1 \
3b4be32
%{__php} run-tests.php \
3b4be32
    -n -q \
d278117
    -d extension=mbstring.so \
3b4be32
    -d extension=$PWD/modules/%{pecl_name}.so
d278117
3b4be32
%if %{with_zts}
3b4be32
: Minimal load test for ZTS extension
3b4be32
%{__ztsphp} --no-php-ini \
3b4be32
    --define extension=mbstring.so \
3b4be32
    --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \
3b4be32
    --modules | grep %{pecl_name}
206c1fa
3b4be32
: Upstream test suite for ZTS extension
3b4be32
cd ../ZTS
206c1fa
TEST_PHP_EXECUTABLE=%{__ztsphp} \
206c1fa
NO_INTERACTION=1 \
206c1fa
php run-tests.php \
3b4be32
    -n -q \
206c1fa
    -d extension=mbstring.so \
3b4be32
    -d extension=$PWD/modules/%{pecl_name}.so
206c1fa
%endif
206c1fa
cvsextras 61e73db
d278117
%post
d278117
%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || :
d278117
d278117
d278117
%postun
d278117
if [ $1 -eq 0 ] ; then
d278117
    %{pecl_uninstall} %{pecl_name} >/dev/null || :
d278117
fi
d278117
d278117
cvsextras 61e73db
%files
3b4be32
%doc %{pecl_docdir}/%{pecl_name}
3b4be32
%doc %{pecl_testdir}/%{pecl_name}
7a188df
%config(noreplace) %{php_inidir}/%{ini_name}
3b4be32
%{php_extdir}/%{pecl_name}.so
d278117
%{pecl_xmldir}/%{name}.xml
cvsextras 61e73db
3b4be32
%if %{with_zts}
7a188df
%config(noreplace) %{php_ztsinidir}/%{ini_name}
3b4be32
%{php_ztsextdir}/%{pecl_name}.so
206c1fa
%endif
cvsextras 61e73db
3b4be32
cvsextras 61e73db
%changelog
4dc76e1
* Thu Feb 04 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.1.6-12
4dc76e1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
4dc76e1
b57e6f8
* Thu Jun 18 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.6-11
b57e6f8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
b57e6f8
33123c1
* Sun Aug 17 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.6-10
33123c1
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
33123c1
d2a7d57
* Thu Jun 19 2014 Remi Collet <rcollet@redhat.com> - 2.1.6-9
d2a7d57
- rebuild for https://fedoraproject.org/wiki/Changes/Php56
d2a7d57
0a46a7f
* Sat Jun 07 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.6-8
0a46a7f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_Mass_Rebuild
0a46a7f
7a188df
* Thu Apr 24 2014 Remi Collet <rcollet@redhat.com> - 2.1.6-7
7a188df
- add numerical prefix to extension configuration file
7a188df
349652a
* Mon Mar 10 2014 Remi Collet <rcollet@redhat.com> - 2.1.6-6
3b4be32
- cleanups
3b4be32
- install documentation in pecl_docdir
3b4be32
- install tests in pecl_testdir
3b4be32
- add missing License file
3b4be32
- also provides php-mailparse
3b4be32
f41cd6c
* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.6-5
f41cd6c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
f41cd6c
Remi Collet f44a190
* Fri Mar 22 2013 Remi Collet <rcollet@redhat.com> - 2.1.6-4
Remi Collet f44a190
- rebuild for http://fedoraproject.org/wiki/Features/Php55
Remi Collet f44a190
4f3558b
* Thu Feb 14 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.6-3
4f3558b
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild
4f3558b
55750c3
* Sat Jul 21 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.6-2
55750c3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild
55750c3
206c1fa
* Sat Mar 10 2012 Remi Collet <remi@fedoraproject.org> - 2.1.6-1
206c1fa
- update to 2.1.6
206c1fa
- enable ZTS build
206c1fa
c312cc8
* Thu Jan 19 2012 Remi Collet <remi@fedoraproject.org> - 2.1.5-6
c312cc8
- rebuild against PHP 5.4, with patch
c312cc8
- fix filters
c312cc8
988b384
* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.5-5
988b384
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
988b384
56f9636
* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.5-4
56f9636
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
56f9636
3cffd88
* Sat Oct 23 2010  Remi Collet <Fedora@FamilleCollet.com> 2.1.5-3
3cffd88
- add filter_provides to avoid private-shared-object-provides mailparse.so
3cffd88
- spec cleanup
3cffd88
ca60303
* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.1.5-2
ca60303
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
ca60303
7788c66
* Sun Jul 12 2009  Remi Collet <Fedora@FamilleCollet.com> 2.1.5-1
7788c66
- update to 2.1.5 (bugfix + php 5.3.0 compatibility)
3192c22
bba783a
* Mon Apr 14 2008  Remi Collet <Fedora@FamilleCollet.com> 2.1.4-1
bba783a
- update to 2.1.4 (bugfix)
4afbab6
- package2.xml is now provided
bba783a
d278117
* Sun Feb 24 2008  Remi Collet <Fedora@FamilleCollet.com> 2.1.3-1
d278117
- update to 2.1.3
d278117
- add post(un) scriplet
d278117
- add check
d278117
a140614
* Tue Feb 19 2008 Fedora Release Engineering <rel-eng@fedoraproject.org> - 2.1.1-9
a140614
- Autorebuild for GCC 4.3
a140614
47767ac
* Wed Aug 22 2007 Matthias Saou <http://freshrpms.net/> 2.1.1-8
47767ac
- Rebuild for new BuildID feature.
47767ac
44384fe
* Mon Aug  6 2007 Matthias Saou <http://freshrpms.net/> 2.1.1-7
44384fe
- Update License field.
44384fe
- Remove dist tag, since the package will seldom change.
44384fe
0e158a1
* Tue Jun 19 2007 Matthias Saou <http://freshrpms.net/> 2.1.1-6
0e158a1
- Fix package requirements by adding build-time zend-abi version.
0e158a1
- Clean up spec to conform to current PHP packaging rules.
0e158a1
- No longer bundle part of mbstring (mbfl), at last! (makes spec F7+ specific)
0e158a1
6f4a54c
* Mon Aug 28 2006 Matthias Saou <http://freshrpms.net/> 2.1.1-5
6f4a54c
- FC6 rebuild.
6f4a54c
- Add php-api requirement and php-pecl(mailparse) provides.
6f4a54c
6c6375a
* Mon Mar  6 2006 Matthias Saou <http://freshrpms.net/> 2.1.1-4
6c6375a
- Add missing php-mbstring requirement (#197410).
6c6375a
8cf648f
* Mon Mar  6 2006 Matthias Saou <http://freshrpms.net/> 2.1.1-3
8cf648f
- FC5 rebuild.
8cf648f
4e2ae12
* Thu Feb  9 2006 Matthias Saou <http://freshrpms.net/> 2.1.1-2
4e2ae12
- Rebuild for new gcc/glibc and FC5's PHP 5.1.
4e2ae12
0c24211
* Wed Jul 20 2005 Matthias Saou <http://freshrpms.net/> 2.1.1-1
0c24211
- Update to 2.1.1.
0c24211
- Update mbfl tarball to 4.4.0 PHP sources.
0c24211
- Rename .ini file to "z-<name>" to have it load after mbstring.so.
0c24211
3b4be32
* Thu Apr  7 2005 Michael Schwendt <mschwendt[AT]users.sf.net>
5cd48a6
- rebuilt
5cd48a6
0356ee1
* Wed Feb 16 2005 Matthias Saou <http://freshrpms.net/> 2.1-1
0356ee1
- Update to 2.1.
0356ee1
96854f5
* Thu Jan 13 2005 Matthias Saou <http://freshrpms.net/> 2.0b-5
96854f5
- Bump release.
96854f5
cvsextras 2a26934
* Tue Jul 27 2004 Matthias Saou <http://freshrpms.net/> 2.0b-4
cvsextras 2a26934
- Update included mbfl source to 4.3.8 as the current 4.3.4 doesn't work
cvsextras 2a26934
  anymore.
cvsextras 2a26934
cvsextras 2a26934
* Fri May 21 2004 Matthias Saou <http://freshrpms.net/> 2.0b-3
cvsextras 2a26934
- Rebuild for Fedora Core 2.
cvsextras 2a26934
- No need for a strict dependency on this package, it works fine with
cvsextras 2a26934
  php 4.3.6 when compiled against 4.3.4.
cvsextras 2a26934
cvsextras 61e73db
* Fri May  7 2004 Matthias Saou <http://freshrpms.net/> 2.0b-2
cvsextras 61e73db
- Added php.d entry to auto-load the module with recent php packages.
cvsextras 61e73db
- Added more macros to the spec file.
cvsextras 61e73db
cvsextras 61e73db
* Mon Apr 26 2004 Matthias Saou <http://freshrpms.net/> 2.0b-1
cvsextras 61e73db
- Initial RPM release.
cvsextras 61e73db
- Included part of php-4.3.4's mbfl includes, ugly.
cvsextras 61e73db