[php-pecl-radius/el6/master] clean spec

Remi Collet remi at fedoraproject.org
Sat Aug 28 13:11:45 UTC 2010


commit da6ab0314efef662fecf697bdfe2894160b7457f
Author: remi <fedora at famillecollet.com>
Date:   Sat Aug 28 15:05:56 2010 +0200

    clean spec

 .gitignore           |    1 +
 php-pecl-radius.spec |   49 ++++++++++++++++++++++++++++++++-----------------
 2 files changed, 33 insertions(+), 17 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index eeecf8f..63c857a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1 +1,2 @@
 radius-1.2.5.tgz
+package.xml
diff --git a/php-pecl-radius.spec b/php-pecl-radius.spec
index a5b3ada..db05a2e 100644
--- a/php-pecl-radius.spec
+++ b/php-pecl-radius.spec
@@ -2,23 +2,24 @@
 %{!?__pecl:     %{expand: %%global __pecl     %{_bindir}/pecl}}
 %{!?php_extdir: %{expand: %%global php_extdir %(php-config --extension-dir)}}
 
-%define pecl_name radius
+%global pecl_name radius
 
 Name:           php-pecl-radius
 Version:        1.2.5
-Release:        8%{?dist}
+Release:        9%{?dist}
 Summary:        Radius client library
 
 License:        BSD
 Group:          Development/Languages
 URL:            http://pecl.php.net/package/radius
 Source0:        http://pecl.php.net/get/radius-%{version}.tgz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 BuildRequires:  php-devel php-pear >= 1:1.4.9-1.2
+
 Requires(post): %{__pecl}
 Requires(postun): %{__pecl}
-Provides:       php-pecl(radius) = %{version}
+Provides:       php-pecl(%{pecl_name}) = %{version}
 
 %if %{?php_zend_api}0
 Requires:       php(zend-abi) = %{php_zend_api}
@@ -38,34 +39,43 @@ OS (for example against Windows Active-Directory via IAS).
 
 
 %prep
-%setup -qcn radius-%{version}
-[ -f package2.xml ] || mv package.xml package2.xml
-mv package2.xml %{pecl_name}-%{version}/%{pecl_name}.xml
-cd radius-%{version}
+%setup -qc
+cd %{pecl_name}-%{version}
+# package.xml is V2
+mv ../package.xml %{name}.xml
 
 
 %build
-cd radius-%{version}
+cd %{pecl_name}-%{version}
 phpize
 %configure
 make %{?_smp_mflags}
 
 
 %install
-cd radius-%{version}
+cd %{pecl_name}-%{version}
 rm -rf $RPM_BUILD_ROOT
 make install INSTALL_ROOT=$RPM_BUILD_ROOT
 
 # install config file
 install -d $RPM_BUILD_ROOT%{_sysconfdir}/php.d
-cat > $RPM_BUILD_ROOT%{_sysconfdir}/php.d/radius.ini << 'EOF'
-; Enable radius extension module
-extension=radius.so
+cat > $RPM_BUILD_ROOT%{_sysconfdir}/php.d/%{pecl_name}.ini << 'EOF'
+; Enable %{pecl_name} extension module
+extension=%{pecl_name}.so
 EOF
 
 # Install XML package description
 install -d $RPM_BUILD_ROOT%{pecl_xmldir}
-install -pm 644 %{pecl_name}.xml $RPM_BUILD_ROOT%{pecl_xmldir}/%{name}.xml
+install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pecl_xmldir}/%{name}.xml
+
+
+%check
+# simple module load test
+cd %{pecl_name}-%{version}
+php --no-php-ini \
+    --define extension_dir=modules \
+    --define extension=%{pecl_name}.so \
+    --modules | grep %{pecl_name}
 
 
 %if 0%{?pecl_install:1}
@@ -88,13 +98,18 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-,root,root,-)
-%doc radius-%{version}/CREDITS radius-%{version}/examples
-%config(noreplace) %{_sysconfdir}/php.d/radius.ini
-%{php_extdir}/radius.so
+%doc %{pecl_name}-%{version}/CREDITS %{pecl_name}-%{version}/examples
+%config(noreplace) %{_sysconfdir}/php.d/%{pecl_name}.ini
+%{php_extdir}/%{pecl_name}.so
 %{pecl_xmldir}/%{name}.xml
 
 
 %changelog
+* Sat Aug 28 2010 Remi Collet <Fedora at FamilleCollet.com> - 1.2.5-9
+- clean define
+- use more macros
+- add simple load test in %%check
+
 * Sun Jul 26 2009 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 1.2.5-8
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
 


More information about the scm-commits mailing list