From 3b4be32aefec0174a358c49bedea33a70f503b16 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Mar 10 2014 17:08:49 +0000 Subject: - cleanups - install documentation in pecl_docdir - install tests in pecl_testdir - add missing License file - also provides php-mailparse --- diff --git a/2_02.txt b/2_02.txt new file mode 100644 index 0000000..af5b01c --- /dev/null +++ b/2_02.txt @@ -0,0 +1,75 @@ +-------------------------------------------------------------------- + The PHP License, version 2.02 +Copyright (c) 1999 - 2002 The PHP Group. All rights reserved. +-------------------------------------------------------------------- + +Redistribution and use in source and binary forms, with or without +modification, is permitted provided that the following conditions +are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + + 3. The name "PHP" must not be used to endorse or promote products + derived from this software without prior permission from the + PHP Group. This does not apply to add-on libraries or tools + that work in conjunction with PHP. In such a case the PHP + name may be used to indicate that the product supports PHP. + + 4. The PHP Group may publish revised and/or new versions of the + license from time to time. Each version will be given a + distinguishing version number. + Once covered code has been published under a particular version + of the license, you may always continue to use it under the + terms of that version. You may also choose to use such covered + code under the terms of any subsequent version of the license + published by the PHP Group. No one other than the PHP Group has + the right to modify the terms applicable to covered code created + under this License. + + 5. Redistributions of any form whatsoever must retain the following + acknowledgment: + "This product includes PHP, freely available from + http://www.php.net/". + + 6. The software incorporates the Zend Engine, a product of Zend + Technologies, Ltd. ("Zend"). The Zend Engine is licensed to the + PHP Association (pursuant to a grant from Zend that can be + found at http://www.php.net/license/ZendGrant/) for + distribution to you under this license agreement, only as a + part of PHP. In the event that you separate the Zend Engine + (or any portion thereof) from the rest of the software, or + modify the Zend Engine, or any portion thereof, your use of the + separated or modified Zend Engine software shall not be governed + by this license, and instead shall be governed by the license + set forth at http://www.zend.com/license/ZendLicense/. + + + +THIS SOFTWARE IS PROVIDED BY THE PHP DEVELOPMENT TEAM ``AS IS'' AND +ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A +PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PHP +DEVELOPMENT TEAM OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, +INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED +OF THE POSSIBILITY OF SUCH DAMAGE. + +-------------------------------------------------------------------- + +This software consists of voluntary contributions made by many +individuals on behalf of the PHP Group. + +The PHP Group can be contacted via Email at group@php.net. + +For more information on the PHP Group and the PHP project, +please see . diff --git a/php-pecl-mailparse.spec b/php-pecl-mailparse.spec index 5fd494c..d88d57c 100644 --- a/php-pecl-mailparse.spec +++ b/php-pecl-mailparse.spec @@ -1,6 +1,9 @@ -%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} +%{!?php_inidir: %global php_inidir %{_sysconfdir}/php.d} +%{!?__pecl: %global __pecl %{_bindir}/pecl} +%{!?__php: %global __php %{_bindir}/php} %global pecl_name mailparse +%global with_zts 0%{?__ztsphp:1} Summary: PHP PECL package for parsing and working with email messages Name: php-pecl-mailparse @@ -11,27 +14,33 @@ Group: Development/Languages URL: http://pecl.php.net/package/mailparse Source0: http://pecl.php.net/get/mailparse-%{version}.tgz +# https://bugs.php.net/65861 - Please Provides LICENSE file +# URL from mailparse.c header +Source1: http://www.php.net/license/2_02.txt -BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRequires: php-devel, php-pear # mbstring need for tests BuildRequires: php-mbstring # Required by phpize BuildRequires: autoconf, automake, libtool -Requires: php-mbstring +Requires: php-mbstring%{?_isa} Requires: php(zend-abi) = %{php_zend_api} Requires: php(api) = %{php_core_api} Requires(post): %{__pecl} Requires(postun): %{__pecl} -Provides: php-pecl(%{pecl_name}) = %{version}-%{release} +Provides: php-%{pecl_name} = %{version} +Provides: php-%{pecl_name}%{?_isa} = %{version} +Provides: php-pecl(%{pecl_name}) = %{version} +Provides: php-pecl(%{pecl_name})%{?_isa} = %{version} -# RPM 4.8 + +%if 0%{?fedora} < 20 +# Filter shared private %{?filter_provides_in: %filter_provides_in %{_libdir}/.*\.so$} %{?filter_setup} -# RPM 4.9 -%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}%{_libdir}/.*\\.so$ +%endif %description @@ -44,11 +53,16 @@ It can deal with rfc822 and rfc2045 (MIME) compliant messages. # the sources extract straight to it %setup -q -c -extver=$(sed -n '/#define PHP_MAILPARSE_VERSION/{s/.* "//;s/".*$//;p}' %{pecl_name}-%{version}/php_mailparse.h) +mv %{pecl_name}-%{version} NTS + +cd NTS +cp %{SOURCE1} LICENSE +extver=$(sed -n '/#define PHP_MAILPARSE_VERSION/{s/.* "//;s/".*$//;p}' php_mailparse.h) if test "x${extver}" != "x%{version}"; then : Error: Upstream version is ${extver}, expecting %{version}. exit 1 fi +cd .. cat > %{pecl_name}.ini << 'EOF' ; Enable mailparse extension module @@ -58,21 +72,21 @@ extension = mailparse.so ;mailparse.def_charset = us-ascii EOF -chmod -x %{pecl_name}-%{version}/*.{php,c,h} +chmod -x NTS/*.{php,c,h} -%if 0%{?__ztsphp:1} -cp -pr %{pecl_name}-%{version} %{pecl_name}-%{version}-zts +%if %{with_zts} +cp -pr NTS ZTS %endif %build -cd %{pecl_name}-%{version} +cd NTS phpize %configure --with-php-config=%{_bindir}/php-config make %{?_smp_mflags} -%if 0%{?__ztsphp:1} -cd ../%{pecl_name}-%{version}-zts +%if %{with_zts} +cd ../ZTS zts-phpize %configure --with-php-config=%{_bindir}/zts-php-config make %{?_smp_mflags} @@ -80,15 +94,12 @@ make %{?_smp_mflags} %install -rm -rf %{buildroot} -make -C %{pecl_name}-%{version} \ - install INSTALL_ROOT=%{buildroot} +make -C NTS install INSTALL_ROOT=%{buildroot} # Drop in the bit of configuration -install -Dpm 644 %{pecl_name}.ini %{buildroot}%{_sysconfdir}/php.d/z-%{pecl_name}.ini +install -Dpm 644 %{pecl_name}.ini %{buildroot}%{php_inidir}/z-%{pecl_name}.ini -%if 0%{?__ztsphp:1} -make -C %{pecl_name}-%{version}-zts \ - install INSTALL_ROOT=%{buildroot} +%if %{with_zts} +make -C ZTS install INSTALL_ROOT=%{buildroot} # Drop in the bit of configuration install -Dpm 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/z-%{pecl_name}.ini %endif @@ -96,63 +107,81 @@ install -Dpm 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/z-%{pecl_name}.in # Install XML package description install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml +# Test & Documentation +for i in $(grep 'role="test"' package.xml | sed -e 's/^.*name="//;s/".*$//') +do install -Dpm 644 NTS/$i %{buildroot}%{pecl_testdir}/%{pecl_name}/$i +done +for i in LICENSE $(grep 'role="doc"' package.xml | sed -e 's/^.*name="//;s/".*$//') +do install -Dpm 644 NTS/$i %{buildroot}%{pecl_docdir}/%{pecl_name}/$i +done -%check -cd %{pecl_name}-%{version} -ln -s %{php_extdir}/mbstring.so modules -TEST_PHP_EXECUTABLE=$(which php) \ +%check +: Minimal load test for NTS extension +%{__php} --no-php-ini \ + --define extension=mbstring.so \ + --define extension=%{buildroot}%{php_extdir}/%{pecl_name}.so \ + --modules | grep %{pecl_name} + +: Upstream test suite for NTS extension +cd NTS +TEST_PHP_EXECUTABLE=%{__php} \ NO_INTERACTION=1 \ -php run-tests.php \ - -n -q -d extension_dir=modules \ +%{__php} run-tests.php \ + -n -q \ -d extension=mbstring.so \ - -d extension=%{pecl_name}.so \ + -d extension=$PWD/modules/%{pecl_name}.so -%if 0%{?__ztsphp:1} -cd ../%{pecl_name}-%{version}-zts -ln -s %{php_ztsextdir}/mbstring.so modules +%if %{with_zts} +: Minimal load test for ZTS extension +%{__ztsphp} --no-php-ini \ + --define extension=mbstring.so \ + --define extension=%{buildroot}%{php_ztsextdir}/%{pecl_name}.so \ + --modules | grep %{pecl_name} +: Upstream test suite for ZTS extension +cd ../ZTS TEST_PHP_EXECUTABLE=%{__ztsphp} \ NO_INTERACTION=1 \ php run-tests.php \ - -n -q -d extension_dir=modules \ + -n -q \ -d extension=mbstring.so \ - -d extension=%{pecl_name}.so \ + -d extension=$PWD/modules/%{pecl_name}.so %endif -%clean -rm -rf %{buildroot} - - -%if 0%{?pecl_install:1} %post %{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : -%endif -%if 0%{?pecl_uninstall:1} %postun if [ $1 -eq 0 ] ; then %{pecl_uninstall} %{pecl_name} >/dev/null || : fi -%endif %files -%defattr(-,root,root,-) -%doc %{pecl_name}-%{version}/{README,CREDITS,try.php} +%doc %{pecl_docdir}/%{pecl_name} +%doc %{pecl_testdir}/%{pecl_name} # We prefix the config file with "z-" so that it loads after mbstring.ini -%config(noreplace) %{_sysconfdir}/php.d/z-mailparse.ini -%{php_extdir}/mailparse.so +%config(noreplace) %{php_inidir}/z-%{pecl_name}.ini +%{php_extdir}/%{pecl_name}.so %{pecl_xmldir}/%{name}.xml -%if 0%{?__ztsphp:1} -%config(noreplace) %{php_ztsinidir}/z-mailparse.ini -%{php_ztsextdir}/mailparse.so +%if %{with_zts} +%config(noreplace) %{php_ztsinidir}/z-%{pecl_name}.ini +%{php_ztsextdir}/%{pecl_name}.so %endif + %changelog +* Mon Mar 10 2014 Remi Collet - 2.1.6-5 +- cleanups +- install documentation in pecl_docdir +- install tests in pecl_testdir +- add missing License file +- also provides php-mailparse + * Sun Aug 04 2013 Fedora Release Engineering - 2.1.6-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild @@ -231,7 +260,7 @@ fi - Update mbfl tarball to 4.4.0 PHP sources. - Rename .ini file to "z-" to have it load after mbstring.so. -* Fri Apr 7 2005 Michael Schwendt +* Thu Apr 7 2005 Michael Schwendt - rebuilt * Wed Feb 16 2005 Matthias Saou 2.1-1