From c19c096a1381da06d33b66ec326e4de2f45ffcf2 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Sun, 10 Jun 2012 07:06:04 +0200 Subject: repo reorg --- php-pecl-gnupg.spec | 195 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 195 insertions(+) create mode 100644 php-pecl-gnupg.spec (limited to 'php-pecl-gnupg.spec') diff --git a/php-pecl-gnupg.spec b/php-pecl-gnupg.spec new file mode 100644 index 0000000..1373f87 --- /dev/null +++ b/php-pecl-gnupg.spec @@ -0,0 +1,195 @@ +%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}} +%global pecl_name gnupg + +Summary: Wrapper around the gpgme library +Name: php-pecl-gnupg +Version: 1.3.2 +Release: 3%{?dist} + +License: BSD +Group: Development/Languages +URL: http://pecl.php.net/package/gnupg +Source0: http://pecl.php.net/get/%{pecl_name}-%{version}.tgz + +# http://svn.php.net/viewvc/pecl/gnupg/trunk/tests/vars.inc?view=co +Source1: vars.inc +# https://bugs.php.net/60915 PHP 5.4 build +Patch0: gnupg-php54.patch +# https://bugs.php.net/60913 Fix test suite +Patch1: gnupg-tests.patch +# https://bugs.php.net/60916 Force use of /usr/bin/gpg +Patch2: gnupg-gpg1.patch + +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) +BuildRequires: php-devel +BuildRequires: gpgme-devel +BuildRequires: php-pear +BuildRequires: gnupg + +Requires(post): %{__pecl} +Requires(postun): %{__pecl} + +Requires: php(zend-abi) = %{php_zend_api} +Requires: php(api) = %{php_core_api} +# We force use of /usr/bin/gpg as gpg2 is unusable in non-interactive mode +Requires: gnupg + +Provides: php-pecl(%{pecl_name}) = %{version}-%{release} +Provides: php-pecl(%{pecl_name})%{?_isa} = %{version}-%{release} + +%{?filter_setup} + + +%description +This module allows you to interact with gnupg. + +Documentation : http://www.php.net/gnupg + + +%prep +%setup -c -q + +cp %{SOURCE1} %{pecl_name}-%{version}/tests +%patch0 -p0 -b .php54 +%patch1 -p0 -b .tests +%patch2 -p0 -b .gpg1 + +# Create configuration file +cat >%{pecl_name}.ini << 'EOF' +; Enable %{pecl_name} extension module +extension=%{pecl_name}.so +EOF + +%if 0%{?rhel} == 5 +# GnuPG seems to old +rm -f %{pecl_name}-%{version}/tests/gnupg_{oo,res}_listsignatures.phpt +%endif + +# Fix version for phpinfo() +# https://bugs.php.net/60914 +sed -i -e /PHP_GNUPG_VERSION/s/1.3.2-dev/1.3.2/ %{pecl_name}-%{version}/php_gnupg.h + +# Check extension version +extver=$(sed -n '/#define PHP_GNUPG_VERSION/{s/.* "//;s/".*$//;p}' %{pecl_name}-%{version}/php_gnupg.h) +if test "x${extver}" != "x%{version}"; then + : Error: Upstream extension version is ${extver}, expecting %{version}. + exit 1 +fi + + +%if 0%{?__ztsphp:1} +# Build ZTS extension if ZTS devel available (fedora >= 17) +cp -r %{pecl_name}-%{version} %{pecl_name}-zts +%endif + + +%build +export PHP_RPATH=no +export CFLAGS="$RPM_OPT_FLAGS -D_FILE_OFFSET_BITS=64 -DGNUPG_PATH='\"/usr/bin/gpg\"'" + +cd %{pecl_name}-%{version} +%{_bindir}/phpize +%configure \ + --with-libdir=%{_lib} \ + --with-php-config=%{_bindir}/php-config +make %{?_smp_mflags} + +%if 0%{?__ztsphp:1} +cd ../%{pecl_name}-zts +%{_bindir}/zts-phpize +%configure \ + --with-libdir=%{_lib} \ + --with-php-config=%{_bindir}/zts-php-config +make %{?_smp_mflags} +%endif + +%install +rm -rf %{buildroot} +# for short-circuit +rm -rf %{pecl_name}-*/modules/{json,mysqlnd}.so + +make install -C %{pecl_name}-%{version} \ + INSTALL_ROOT=%{buildroot} + +%if 0%{?__ztsphp:1} +make install -C %{pecl_name}-zts \ + INSTALL_ROOT=%{buildroot} + +# Drop in the bit of configuration +install -D -m 644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini +%endif +install -D -m 644 %{pecl_name}.ini %{buildroot}%{_sysconfdir}/php.d/%{pecl_name}.ini + +# Install XML package description +install -D -m 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml + + +%clean +rm -rf %{buildroot} + + +%post +%{pecl_install} %{pecl_xmldir}/%{name}.xml >/dev/null || : + + +%postun +if [ $1 -eq 0 ] ; then + %{pecl_uninstall} %{pecl_name} >/dev/null || : +fi + + +%check +cd %{pecl_name}-%{version} + +# run full test suite +TEST_PHP_EXECUTABLE=%{_bindir}/php \ +REPORT_EXIT_STATUS=1 \ +NO_INTERACTION=1 \ +php run-tests.php \ + -n -q \ + -d extension_dir=modules \ + -d extension=%{pecl_name}.so + +%if 0%{?__ztsphp:1} +cd ../%{pecl_name}-zts + +# run full test suite +TEST_PHP_EXECUTABLE=%{__ztsphp} \ +REPORT_EXIT_STATUS=1 \ +NO_INTERACTION=1 \ +%{__ztsphp} run-tests.php \ + -n -q \ + -d extension_dir=modules \ + -d extension=%{pecl_name}.so +%endif + + +%files +%defattr(-, root, root, -) +%doc %{pecl_name}-%{version}/{LICENSE,README} +%{pecl_xmldir}/%{name}.xml + +%config(noreplace) %{_sysconfdir}/php.d/%{pecl_name}.ini +%{php_extdir}/%{pecl_name}.so + +%if 0%{?__ztsphp:1} +%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini +%{php_ztsextdir}/%{pecl_name}.so +%endif + + +%changelog +* Sun May 06 2012 Remi Collet - 1.3.2-3 +- improve patch + +* Sat Jan 28 2012 Remi Collet - 1.3.2-2 +- build against PHP 5.4 + +* Sat Jan 28 2012 Remi Collet - 1.3.2-1 +- Initial RPM +- open upstream bugs + https://bugs.php.net/60913 - test suite fails + https://bugs.php.net/60914 - bad version + https://bugs.php.net/60915 - php 5.4 build fails + https://bugs.php.net/60916 - force use of /usr/bin/gpg + -- cgit