# $Revision$, $Date$
-# PLD rpm macros
+# PLD Linux rpm macros
%epoch 0
%x8664 x86_64 amd64 ia32e
%apache_modules_api %(awk '/#define MODULE_MAGIC_NUMBER_MAJOR/ {print $3}' /usr/include/apache/ap_mmn.h 2>/dev/null || echo ERROR)
# kernel version-release handling
-%__kernel_ver %([ -f %{_kernelsrcdir}/include/linux/version.h ] && (grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | head -n 1 | cut -d'"' -f2) || (awk '/^VERSION/ { ver = $0; gsub(/VERSION.*=/, NIL, ver); } /^PATCHLEVEL/ { plev = $0; gsub(/PATCHLEVEL.*=/, NIL, plev); } /^SUBLEVEL/ { slev = $0; gsub(/SUBLEVEL.*=/, NIL, slev); } /^EXTRAVERSION/ { ever = $0; gsub(/EXTRAVERSION.*=/, NIL, ever); gsub(/ /, NIL, ever); } END { printf("%d.%d.%d%s", ver, plev, slev, ever); }' %{_kernelsrcdir}/Makefile 2> /dev/null))
+%__kernel_ver %( VER_H=%{_kernelsrcdir}/include/linux/utsrelease.h; [ -f $VER_H ] || VER_H=%{_kernelsrcdir}/include/linux/version.h; [ -f $VER_H ] && (grep UTS_RELEASE $VER_H 2>/dev/null | head -n 1 | cut -d'"' -f2) || (awk '/^VERSION/ { ver = $0; gsub(/VERSION.*=/, NIL, ver); } /^PATCHLEVEL/ { plev = $0; gsub(/PATCHLEVEL.*=/, NIL, plev); } /^SUBLEVEL/ { slev = $0; gsub(/SUBLEVEL.*=/, NIL, slev); } /^EXTRAVERSION/ { ever = $0; gsub(/EXTRAVERSION.*=/, NIL, ever); gsub(/ /, NIL, ever); } END { printf("%d.%d.%d%s", ver, plev, slev, ever); }' %{_kernelsrcdir}/Makefile 2> /dev/null))
%__kernel_rel %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/fs.h 2>/dev/null --qf "%{RELEASE}" | grep -v "is not")
%__kernel_rpmvr %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/fs.h 2>/dev/null --qf "%{VERSION}-%{RELEASE}" | grep -v "is not")
%_kernel_ver %{__kernel_ver}%{?with_dist_kernel:%(echo %{__kernel_ver} | grep -q -e - || echo -%{__kernel_rel})}
# Ruby
%ruby_archdir %(ruby -r rbconfig -e 'print Config::CONFIG["archdir"]' 2>/dev/null || echo ERROR)
-%ruby_ridir %(ruby -r rbconfig -e 'include Config; print File.join(CONFIG["datadir"], "ri", CONFIG["ruby_version"], "system")' 2>/dev/null || echo ERROR)
+%ruby_ridir %(ruby -r rbconfig -e 'include Config; print File.join(CONFIG["datadir"], "ri", CONFIG["ruby_version"], "system")' 2>/dev/null || echo ERROR)
%ruby_rubylibdir %(ruby -r rbconfig -e 'print Config::CONFIG["rubylibdir"]' 2>/dev/null || echo ERROR)
%ruby_sitearchdir %(ruby -r rbconfig -e 'print Config::CONFIG["sitearchdir"]' 2>/dev/null || echo ERROR)
%ruby_sitelibdir %(ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]' 2>/dev/null || echo ERROR)
%ruby_ver_requires_eq Requires: ruby(ver) = %ruby_version
%ruby_mod_ver_requires_eq Requires: ruby-modules(ver) = %ruby_version
-%php_pear_dir %{_datadir}/pear
+%php_pear_dir /usr/share/pear
# directory where php includes are installed on system.
%__php_includedir /usr/include/php
# macros for public use
# for php extensions (php-pecl)
%requires_php_extension %{__php_api_requires modules_api php_api_version} \
+%{__php_api_requires zend_module_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
-%py_ver %(python -c "import sys; print sys.version[:3]")
+%py_ver %(python -c "import sys; print sys.version[:3]")
# directories
%py_prefix %(python -c "import sys; print sys.prefix")
%py_libdir %{py_prefix}/%{_lib}/python%{py_ver}
%py_scriptdir %{py_prefix}/share/python%{py_ver}
%py_incdir /usr/include/python%{py_ver}
-%py_sitedir %{py_libdir}/site-packages
+%py_sitedir %{py_libdir}/site-packages
%py_sitescriptdir %{py_scriptdir}/site-packages
%py_dyndir %{py_libdir}/lib-dynload
%{-M} \\\
%{-G:-G %{-G*}} \\\
%{expand:%{%{#}}} 1>&2 || exit $? \
- [ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i passwd \
+ [ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i passwd || : \
fi;
# Usage:
else \
echo "Adding group %{1} GID=%{-g*}." \
/usr/sbin/groupadd -g %{-g*} -r %{1} 1>&2 || exit $? \
- [ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group \
+ [ ! -x /usr/sbin/nscd ] || /usr/sbin/nscd -i group || : \
fi;
# apache_config_{install/uninstall} macros written by glen@pld-linux.org.
done \
%{nil}
-%env_update [ ! -x /sbin/env-update ] || /sbin/env-update -u
+%env_update [ ! -x /sbin/env-update ] || /sbin/env-update -u || :
# vim:ts=4 sw=4 noet