[php-pecl-radius] - Update to 1.2.7 (security) - build ZTS extension - spec cleanups
Remi Collet
remi at fedoraproject.org
Fri Jun 28 09:19:25 UTC 2013
commit 410098933d3da5397fe296027840199c88909a98
Author: Remi Collet <rcollet at redhat.com>
Date: Fri Jun 28 11:18:57 2013 +0200
- Update to 1.2.7 (security)
- build ZTS extension
- spec cleanups
.gitignore | 5 +-
php-pecl-radius.spec | 119 +++++++++++++++++++++++++++++--------------------
radius-php54.patch | 11 -----
sources | 2 +-
4 files changed, 74 insertions(+), 63 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index 63c857a..41e8a99 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
-radius-1.2.5.tgz
-package.xml
+*spec~
+clog
+/radius-1.2.7.tgz
diff --git a/php-pecl-radius.spec b/php-pecl-radius.spec
index a048f5a..8e0c088 100644
--- a/php-pecl-radius.spec
+++ b/php-pecl-radius.spec
@@ -1,43 +1,37 @@
-%global php_apiver %((echo 0; php -i 2>/dev/null | sed -n 's/^PHP API => //p') | tail -1)
-%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
-%{!?php_extdir: %{expand: %%global php_extdir %(php-config --extension-dir)}}
+%{!?php_inidir: %{expand: %%global php_inidir %{_sysconfdir}/php.d}}
+%{!?__pecl: %{expand: %%global __pecl %{_bindir}/pecl}}
%global pecl_name radius
+%global with_zts 0%{?__ztsphp:1}
Name: php-pecl-radius
-Version: 1.2.5
-Release: 16%{?dist}
+Version: 1.2.7
+Release: 1%{?dist}
Summary: Radius client library
+# https://bugs.php.net/65156 - request LICENSE file
License: BSD
Group: Development/Languages
URL: http://pecl.php.net/package/radius
Source0: http://pecl.php.net/get/radius-%{version}.tgz
-# http://svn.php.net/viewvc/pecl/radius/trunk/radius.c?r1=256497&r2=297236&sortby=date
-Patch0: radius-php54.patch
-
-BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: php-devel php-pear >= 1:1.4.9-1.2
+BuildRequires: php-devel
+BuildRequires: php-pear
Requires(post): %{__pecl}
Requires(postun): %{__pecl}
-Provides: php-pecl(%{pecl_name}) = %{version}
-
-%if 0%{?php_zend_api:1}
Requires: php(zend-abi) = %{php_zend_api}
Requires: php(api) = %{php_core_api}
-%else
-# for EL-5
-Requires: php-api = %{php_apiver}
-%endif
+
+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
+# Filter private shared
%{?filter_provides_in: %filter_provides_in %{php_extdir}/.*\.so$}
%{?filter_setup}
-# RPM 4.9
-%global __provides_exclude_from %{?__provides_exclude_from:%__provides_exclude_from|}%{php_extdir}/.*\\.so$
%description
@@ -52,72 +46,99 @@ OS (for example against Windows Active-Directory via IAS).
%setup -qc
cd %{pecl_name}-%{version}
-%patch0 -p3 -b .php54
+extver=$(sed -n '/#define PHP_RADIUS_VERSION/{s/.* "//;s/".*$//;p}' php_radius.h)
+if test "x${extver}" != "x%{version}"; then
+ : Error: Upstream version is ${extver}, expecting %{version}.
+ exit 1
+fi
+cd ..
-# package.xml is V2
-mv ../package.xml %{name}.xml
+cat > %{pecl_name}.ini << 'EOF'
+; Enable %{pecl_name} extension module
+extension=%{pecl_name}.so
+EOF
+
+%if %{with_zts}
+cp -pr %{pecl_name}-%{version} %{pecl_name}-%{version}-zts
+%endif
%build
cd %{pecl_name}-%{version}
-phpize
-%configure
+%{_bindir}/phpize
+%configure --with-php-config=%{_bindir}/php-config
make %{?_smp_mflags}
+%if %{with_zts}
+cd ../%{pecl_name}-%{version}-zts
+%{_bindir}/zts-phpize
+%configure --with-php-config=%{_bindir}/zts-php-config
+make %{?_smp_mflags}
+%endif
+
%install
-cd %{pecl_name}-%{version}
-rm -rf $RPM_BUILD_ROOT
-make install INSTALL_ROOT=$RPM_BUILD_ROOT
+make -C %{pecl_name}-%{version} \
+ install INSTALL_ROOT=%{buildroot}
+
+# Install XML package description
+install -Dpm 644 package.xml %{buildroot}%{pecl_xmldir}/%{name}.xml
# install config file
-install -d $RPM_BUILD_ROOT%{_sysconfdir}/php.d
-cat > $RPM_BUILD_ROOT%{_sysconfdir}/php.d/%{pecl_name}.ini << 'EOF'
-; Enable %{pecl_name} extension module
-extension=%{pecl_name}.so
-EOF
+install -Dpm644 %{pecl_name}.ini %{buildroot}%{php_inidir}/%{pecl_name}.ini
-# Install XML package description
-install -d $RPM_BUILD_ROOT%{pecl_xmldir}
-install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pecl_xmldir}/%{name}.xml
+%if %{with_zts}
+make -C %{pecl_name}-%{version}-zts \
+ install INSTALL_ROOT=%{buildroot}
+
+install -Dpm644 %{pecl_name}.ini %{buildroot}%{php_ztsinidir}/%{pecl_name}.ini
+%endif
%check
# simple module load test
-cd %{pecl_name}-%{version}
php --no-php-ini \
- --define extension_dir=modules \
+ --define extension_dir=%{pecl_name}-%{version}/modules \
--define extension=%{pecl_name}.so \
--modules | grep %{pecl_name}
+%if %{with_zts}
+%{__ztsphp} --no-php-ini \
+ --define extension_dir=%{pecl_name}-%{version}-zts/modules \
+ --define extension=%{pecl_name}.so \
+ --modules | grep %{pecl_name}
+%endif
+
-%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
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
-%doc %{pecl_name}-%{version}/CREDITS %{pecl_name}-%{version}/examples
-%config(noreplace) %{_sysconfdir}/php.d/%{pecl_name}.ini
-%{php_extdir}/%{pecl_name}.so
+%doc %{pecl_name}-%{version}/{CREDITS,examples}
%{pecl_xmldir}/%{name}.xml
+%config(noreplace) %{php_inidir}/%{pecl_name}.ini
+%{php_extdir}/%{pecl_name}.so
+
+%if %{with_zts}
+%config(noreplace) %{php_ztsinidir}/%{pecl_name}.ini
+%{php_ztsextdir}/%{pecl_name}.so
+%endif
%changelog
+* Fri Jun 28 2013 Remi Collet <remi at fedoraproject.org> - 1.2.7-1
+- Update to 1.2.7 (security)
+- build ZTS extension
+- spec cleanups
+
* Fri Mar 22 2013 Remi Collet <rcollet at redhat.com> - 1.2.5-16
- rebuild for http://fedoraproject.org/wiki/Features/Php55
diff --git a/sources b/sources
index 161fd3e..b0d22dc 100644
--- a/sources
+++ b/sources
@@ -1 +1 @@
-25d867dab8def71ab1b3e2410491ff4d radius-1.2.5.tgz
+6d7ecfebf3f1a337cbe9fdce491aa762 radius-1.2.7.tgz
More information about the scm-commits
mailing list