# other macros
%epoch 0
-%_enable_debug_packages 1
-
-%__id @__ID@
-%__id_u %{__id} -u
-%__chown_Rhf @__CHOWN_RHF@
-%__chgrp_Rhf @__CHGRP_RHF@
-
-%_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root:@ROOT_GROUP@
-%_fixgroup true
-%_fixperms %{__chmod} -Rf @FIXPERMS@
-%_topdir %(echo $HOME)/rpm
-#-----------------------------------------------------------------
-# CFLAGS and LDFLAGS used to build
-
-%debuginfocflags %{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1: -ggdb}%{expand:%%undefine __dic_%{?_enable_debug_packages}}
-
-%debugcflags -O0 -g -Wall
-%rpmcflags %{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}
-%rpmcxxflags %{rpmcflags}
-%rpmldflags %{nil}
-# %rpmldflags -Wl,--as-needed
# kernel compiler
%kgcc gcc
unset LINGUAS ||:\
%{nil}
-%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
+%install \
+%if 0%{?_enable_debug_packages}\
+%{?buildsubdir:%{debug_package}}\
+%endif\
%%install\
LANG=C\
export LANG\
unset LINGUAS ||:\
%{nil}
-# ------------------------------------------------------------------------
-# Conditional build stuff.
-
-# Check if symbol is defined.
-# Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
-%defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
-%undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
-
-# Shorthand for %{defined with_...}
-%with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
-%without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
-
-# Handle conditional builds. %bcond_with is for case when feature is
-# default off and needs to be activated with --with ... command line
-# switch. %bcond_without is for the dual case.
-#
-# %bcond_with foo defines symbol with_foo if --with foo was specified on
-# command line.
-# %bcond_without foo defines symbol with_foo if --without foo was *not*
-# specified on command line.
-#
-# For example:
-#
-# %bcond_with extra_fonts
-# %bcond_without static
-# %if %{with extra_fonts}
-# ...
-# %endif
-# %ifdef %{with static}
-# ...
-# %endif
-# %{?with_static: ... }
-# %{!?with_static: ... }
-# %{?with_extra_fonts: ... }
-# %{!?with_extra_fonts: ... }
-#
-# The bottom line: never use without_foo, _with_foo nor _without_foo, only
-# with_foo. This way changing default set of bconds for given spec is just
-# a matter of changing single line in it and syntax is more readable.
-%bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
-%bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
-# ------------------------------------------------------------------------
-
# Location of autoconf macros
%_aclocaldir %(aclocal --print-ac-dir)
%{?verbose:set -x;} \
if [ -d "$RPM_BUILD_ROOT" ]; then \
echo "Strip executable binaries, archives and shared object files."; \
- filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \
+ filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*\.debug" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \
elfexelist=`echo $filelist | xargs -r file | \
awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
elfsharedlist=`echo $filelist | xargs -r file | \
%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
+# extract php/zend api versions
+%php_major_version %(awk '/#define PHP_MAJOR_VERSION/{print $3}' %{__php_includedir}/main/php_version.h 2>/dev/null || echo ERROR)
%php_api_version %(awk '/#define PHP_API_VERSION/{print $3}' %{__php_includedir}/main/php.h 2>/dev/null || echo ERROR)
+%php_debug %(awk '/#define ZEND_DEBUG/{print $3}' %{__php_includedir}/main/php_config.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)
+%zend_zts %(Z=$(grep -sc '^#define ZTS 1' %{__php_includedir}/main/php_config.h); echo ${Z:-ERROR})
# helper macro
-%__php_api_requires() Requires: php(%{expand:%1}) = %{expand:%{%{!?2:%{1}}%{?2}}}
+%__php_api_requires(v:) Requires: php%{-v*}(%{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}
+%requires_php_extension %{__php_api_requires modules_api php_api_version} \
+%{__php_api_requires -v %php_major_version debug php_debug} \
+%{__php_api_requires -v %php_major_version thread-safety zend_zts}
+
# for zend extensions
%requires_zend_extension %{__php_api_requires zend_module_api} \
-%{__php_api_requires zend_extension_api}
+%{__php_api_requires zend_extension_api} \
+%{__php_api_requires -v %php_major_version debug php_debug} \
+%{__php_api_requires -v %php_major_version thread-safety zend_zts}
# Python specific macro definitions.
# python main version
else \
echo 'Run "/etc/rc.d/init.d/%1 %2" to %2 %{!?3:%1 service}%{?3:%(set -- %{*}; echo "$3")}.'; \
fi \
-else \
+%{!-q:else} \
%{!-q:echo 'Run "/etc/rc.d/init.d/%1 start" to start %{!?3:%1 service}%{?3:%(set -- %{*}; echo "$3")}.';} \
- %{-q::;} \
fi }; }