SOURCES (AC-branch): rpm.macros, rpm.macros - macros for php/zend ...

glen glen at pld-linux.org
Tue Sep 13 22:16:18 CEST 2005


Author: glen                         Date: Tue Sep 13 20:16:15 2005 GMT
Module: SOURCES                       Tag: AC-branch
---- Log message:
- macros for php/zend api versions

---- Files affected:
SOURCES:
   rpm.macros (1.158.4.58 -> 1.158.4.59) 
SOURCES:
   rpm.macros (1.236 -> 1.237) 

---- Diffs:

================================================================
Index: SOURCES/rpm.macros
diff -u SOURCES/rpm.macros:1.158.4.58 SOURCES/rpm.macros:1.158.4.59
--- SOURCES/rpm.macros:1.158.4.58	Tue Sep  6 19:43:40 2005
+++ SOURCES/rpm.macros	Tue Sep 13 22:16:10 2005
@@ -470,6 +470,27 @@
 
 %php_pear_dir	%{_datadir}/pear
 
+# extract php/zend api versions
+%php_api_version %(awk '/#define php_api_version/{print $3}' /usr/include/php/main/php.h)
+%zend_module_api %(awk '/#define zend_module_api_no/{print $3}' /usr/include/php/zend/zend_modules.h)
+%zend_extension_api %(awk '/#define zend_extension_api_no/{print $3}' /usr/include/php/zend/zend_extensions.h)
+
+# directory where php includes are installed on system.
+%__php_includedir		/usr/include/php
+%php_api_version		%(awk '/#define php_api_version/{print $3}' %{__php_includedir}/main/php.h 2>/dev/null || echo error)
+%zend_module_api		%(awk '/#define zend_module_api_no/{print $3}' %{__php_includedir}/zend/zend_modules.h 2>/dev/null || echo error)
+%zend_extension_api		%(awk '/#define zend_extension_api_no/{print $3}' %{__php_includedir}/zend/zend_extensions.h 2>/dev/null || echo error)
+
+# helper macro
+%__php_api_requires() requires: php(%{expand:%1}) = %{expand:%{%{!?2:%{1}}%{?2}}}
+
+# macros for public use
+# for php extensions (php-pecl)
+%requires_php_extension %{__php_api_requires modules_api php_api_version}
+# for zend extensions
+%requires_zend_extension %{__php_api_requires zend_module_api} \
+%{__php_api_requires zend_extension_api}
+
 # Python specific macro definitions.
 # python main version
 %py_ver         %(echo `python -c "import sys; print sys.version[:3]"`)

================================================================
Index: SOURCES/rpm.macros
diff -u SOURCES/rpm.macros:1.236 SOURCES/rpm.macros:1.237
--- SOURCES/rpm.macros:1.236	Tue Sep  6 19:43:41 2005
+++ SOURCES/rpm.macros	Tue Sep 13 22:16:10 2005
@@ -471,6 +471,27 @@
 
 %php_pear_dir	%{_datadir}/pear
 
+# extract php/zend api versions
+%php_api_version %(awk '/#define PHP_API_VERSION/{print $3}' /usr/include/php/main/php.h)
+%zend_module_api %(awk '/#define ZEND_MODULE_API_NO/{print $3}' /usr/include/php/Zend/zend_modules.h)
+%zend_extension_api %(awk '/#define ZEND_EXTENSION_API_NO/{print $3}' /usr/include/php/Zend/zend_extensions.h)
+
+# directory where php includes are installed on system.
+%__php_includedir		/usr/include/php
+%php_api_version		%(awk '/#define PHP_API_VERSION/{print $3}' %{__php_includedir}/main/php.h 2>/dev/null || echo ERROR)
+%zend_module_api		%(awk '/#define ZEND_MODULE_API_NO/{print $3}' %{__php_includedir}/Zend/zend_modules.h 2>/dev/null || echo ERROR)
+%zend_extension_api		%(awk '/#define ZEND_EXTENSION_API_NO/{print $3}' %{__php_includedir}/Zend/zend_extensions.h 2>/dev/null || echo ERROR)
+
+# helper macro
+%__php_api_requires() Requires: php(%{expand:%1}) = %{expand:%{%{!?2:%{1}}%{?2}}}
+
+# macros for public use
+# for php extensions (php-pecl)
+%requires_php_extension %{__php_api_requires modules_api php_api_version}
+# for zend extensions
+%requires_zend_extension %{__php_api_requires zend_module_api} \
+%{__php_api_requires zend_extension_api}
+
 # Python specific macro definitions.
 # python main version
 %py_ver         %(echo `python -c "import sys; print sys.version[:3]"`)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/rpm.macros?r1=1.158.4.58&r2=1.158.4.59&f=u
    http://cvs.pld-linux.org/SOURCES/rpm.macros?r1=1.236&r2=1.237&f=u




More information about the pld-cvs-commit mailing list