%_emacs_lispdir %{expand:%%global _emacs_lispdir %(Z=$(emacs %___emacs_lispdir_helper); echo ${Z:-ERROR})}%_emacs_lispdir
%_xemacs_lispdir %{expand:%%global _xemacs_lispdir %(Z=$(xemacs %___emacs_lispdir_helper); echo ${Z:-ERROR})}%_xemacs_lispdir
-%__php_provides %{nil}
-%__php_requires %{nil}
%__perl_provides %{nil}
%__perl_requires %{nil}
%__mono_provides %{nil}
%perl_sitelib %{expand:%%global perl_sitelib %(eval $(%{__perl} -V:installsitelib 2>/dev/null); echo ${installsitelib:-ERROR})}%perl_sitelib
%perl_sitearch %{expand:%%global perl_sitearch %(eval $(%{__perl} -V:installsitearch 2>/dev/null); echo ${installsitearch:-ERROR})}%perl_sitearch
-# Ruby
-%__ruby /usr/bin/ruby
-
-# Ruby ABI version
-# NOTE: %ruby_version may be empty, depending how Ruby was built
-%ruby_abi %{expand:%%global ruby_abi %(%{__ruby} -r rbconfig -e 'print [RbConfig::CONFIG["MAJOR"], RbConfig::CONFIG["MINOR"]].join(".")' 2>/dev/null || echo ERROR)}%ruby_abi
-
-# get rbconfig parameter
-%__ruby_rbconfig() %(%{__ruby} -r rbconfig -e 'print RbConfig::CONFIG["%1"]' 2>/dev/null || echo ERROR)
-%__ruby_rbconfig_path() %(%{__ruby} -r rbconfig -r pathname -e 'print Pathname(RbConfig::CONFIG["%1"]).cleanpath' 2>/dev/null || echo ERROR)
-
-%ruby_archdir %{expand:%%global ruby_archdir %{__ruby_rbconfig_path archdir}}%ruby_archdir
-%ruby_libdir %{expand:%%global ruby_libdir %{__ruby_rbconfig rubylibdir}}%ruby_libdir
-%ruby_ridir %{expand:%%global ruby_ridir %(%{__ruby} -r rbconfig -e 'print File.join(RbConfig::CONFIG["datadir"], "ri", "system")' 2>/dev/null || echo ERROR)}%ruby_ridir
-%ruby_rubylibdir %{expand:%%global ruby_rubylibdir %{__ruby_rbconfig_path rubylibdir}}%ruby_rubylibdir
-%ruby_vendorarchdir %{expand:%%global ruby_vendorarchdir %{__ruby_rbconfig vendorarchdir}}%ruby_vendorarchdir
-%ruby_vendorlibdir %{expand:%%global ruby_vendorlibdir %{__ruby_rbconfig_path vendorlibdir}}%ruby_vendorlibdir
-%ruby_sitearchdir %{expand:%%global ruby_sitearchdir %{__ruby_rbconfig sitearchdir}}%ruby_sitearchdir
-%ruby_sitedir %{expand:%%global ruby_sitedir %{__ruby_rbconfig sitedir}}%ruby_sitedir
-%ruby_sitelibdir %{expand:%%global ruby_sitelibdir %{__ruby_rbconfig_path sitelibdir}}%ruby_sitelibdir
-%ruby_rdocdir /usr/share/rdoc
-%ruby_vendordir %{expand:%%global ruby_vendordir %{__ruby_rbconfig vendordir}}%ruby_vendordir
-%ruby_version %{expand:%%global ruby_version %(r=%{__ruby_rbconfig ruby_version}; echo ${r:-%%nil})}%ruby_version
-
-%ruby_gemdir %{expand:%%global ruby_gemdir %(%{__ruby} -r rubygems -e 'puts Gem.respond_to?(:default_dirs) ? Gem.default_dirs[:system][:gem_dir] : Gem.path.first' 2>/dev/null || echo ERROR)}%{ruby_gemdir}
-%ruby_specdir %{ruby_gemdir}/specifications
-
-# deprecated, ruby 2.0 noarch packages are versionless and extension dependency is generated by rpm5
-%ruby_ver_requires_eq %{nil}
-%ruby_mod_ver_requires_eq %{nil}
-
-%php_pear_dir /usr/share/pear
-%php_data_dir /usr/share/php
-%php_extensiondir %{expand:%%global php_extensiondir %(php-config --extension-dir 2>/dev/null || echo ERROR)}%php_extensiondir
-%php_sysconfdir %{expand:%%global php_sysconfdir %(php-config --sysconfdir 2>/dev/null || echo ERROR)}%php_sysconfdir
-%php_includedir %{expand:%%global php_includedir %(php-config --include-dir 2>/dev/null || echo ERROR)}%php_includedir
-
-# extract php/zend api versions
-%php_major_version %{expand:%%global php_major_version %(awk '/#define PHP_MAJOR_VERSION/{print $3}' %{php_includedir}/main/php_version.h 2>/dev/null || echo ERROR)}%php_major_version
-%php_minor_version %{expand:%%global php_minor_version %(awk '/#define PHP_MINOR_VERSION/{print $3}' %{php_includedir}/main/php_version.h 2>/dev/null || echo ERROR)}%php_minor_version
-%php_api_version %{expand:%%global php_api_version %(awk '/#define PHP_API_VERSION/{print $3}' %{php_includedir}/main/php.h 2>/dev/null || echo ERROR)}%php_api_version
-%php_pdo_api_version %{expand:%%global php_pdo_api_version %(awk '/#define PDO_DRIVER_API/{print $3}' %{php_includedir}/ext/pdo/php_pdo_driver.h 2>/dev/null || echo ERROR)}%php_pdo_api_version
-%php_debug %{expand:%%global php_debug %(awk '/#define ZEND_DEBUG/{print $3}' %{php_includedir}/main/php_config.h 2>/dev/null || echo ERROR)}%php_debug
-%zend_module_api %{expand:%%global zend_module_api %(awk '/#define ZEND_MODULE_API_NO/{print $3}' %{php_includedir}/Zend/zend_modules.h 2>/dev/null || echo ERROR)}%zend_module_api
-%zend_extension_api %{expand:%%global zend_extension_api %(awk '/#define ZEND_EXTENSION_API_NO/{print $3}' %{php_includedir}/Zend/zend_extensions.h 2>/dev/null || echo ERROR)}%zend_extension_api
-%_zend_zts %{expand:%%global _zend_zts %(Z=$(grep -sc '^#define ZTS 1' %{php_includedir}/main/php_config.h); echo ${Z:-ERROR})}%_zend_zts
-# "_ts" if ZTS enabled, empty otherwise
-%zend_zts %{expand:%%global _zend_zts_%{?_zend_zts} 1}%{?_zend_zts_1:_ts}
-
-# name of php package
-%php_name php%{?php_suffix}
-# use rpmbuild -D 'php_suffix 54' to build php extension for php 5.4
-# NOTE: error output must be empty. otherwise can't build pecl packages if no php*-devel is installed
-%php_suffix %{expand:%%global php_suffix %(c=$(php-config --sysconfdir 2>/dev/null) || echo '' && echo ${c#/etc/php})%%{nil}}%php_suffix
-
-# phpXY, version always present for using current php version (in regards of php*-devel package)
-%php_versuffix %{expand:%%global php_versuffix %((IFS=.; set -- $(php-config --version); echo $1$2))%%{nil}}%php_versuffix
-
-# php cli. version that php headers are installed for
-%__php /usr/bin/php%{php_versuffix}
-
-# helper macro
-%__php_api_requires() Requires: %{php_name}(%{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} \
-%{__php_api_requires zend_module_api} \
-%{__php_api_requires debug php_debug} \
-%{__php_api_requires 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 debug php_debug} \
-%{__php_api_requires thread-safety _zend_zts}
-
-# for php pdo modules (php-pecl-PDO_*)
-%requires_php_pdo_module %{__php_api_requires PDO_API php_pdo_api_version}
-
-# for using PHP post scripts. for PHP >= 5.0
-%php_webserver_restart \
-[ ! -f /etc/apache/conf.d/??_mod_php.conf ] || %service -q apache restart \
-[ ! -f /etc/httpd/conf.d/??_mod_php.conf ] || %service -q httpd restart \
-if [ -x /etc/rc.d/init.d/php-fcgi ]; then \
- PHP_FCGI_BINARY=; . /etc/sysconfig/php-fcgi 2>/dev/null \
- if [[ ${PHP_FCGI_BINARY:-php.fcgi} = *php.fcgi* ]]; then \
- %service -q php-fcgi restart \
- fi \
-fi \
-if [ -x /etc/rc.d/init.d/%{php_name}-fpm ]; then \
- %service -q %{php_name}-fpm restart \
-fi \
-%{nil}
-
-# for using php post scripts. for PHP >= 4.0 && PHP < 5.0
-%php4_webserver_restart \
-[ ! -f /etc/apache/conf.d/??_mod_php4.conf ] || %service -q apache restart \
-[ ! -f /etc/httpd/conf.d/??_mod_php4.conf ] || %service -q httpd restart \
-if [ -x /etc/rc.d/init.d/php-fcgi ]; then \
- PHP_FCGI_BINARY=; . /etc/sysconfig/php-fcgi 2>/dev/null \
- if [[ ${PHP_FCGI_BINARY:-php.fcgi} = *php4.fcgi* ]]; then \
- %service -q php-fcgi restart \
- fi \
-fi \
-%{nil}
-
# X.org helper macros
%__xorg_abi_requires_ge() Requires: xorg-xserver-server(%{expand:%1}-abi) >= %{expand:%{%2}}
%__xorg_abi_requires_lt() Requires: xorg-xserver-server(%{expand:%1}-abi) < %(awk -vv=%{expand:%{%2}} 'BEGIN{split(v, a, "."); printf("%s.0", a[1] + 1); exit}')
# BuildRequires: rpmbuild(macros) >= 1.450
%service(qn) {{%(export noop=%{-n:1} quiet=%{-q:1} RPM_BUILD_ROOT=%{buildroot}; /usr/lib/rpm/service_generator.sh %{*}) };}
-# PEAR install macros
-# Author: Elan Ruusamäe <glen@pld-linux.org>
-#
-# Usage:
-# %%pear_package_setup ...
-#
-# -a # - also unpack SOURCE#. for PEAR bootstrapping
-# -n FMT - create builddir with FMT, instead of default %%{pearname}-%%{version}
-# -z - unpack pear package and let pear use package.xml (not tarball) for install. for PEAR bootstrapping
-# -D - pass -D to %setup (so the build dir is not removed)
-# -c - register channel from local channel.xml file
-# -d - pass -d arg to pearcmd
-#
-# unpack PEAR package to %%{_builddir}/FMT. package is extracted with already
-# destination hierarchy. you should copy the tree to buildroot after
-# patching/reorganizing with %%pear_package_install.
-#
-# additionally BUILDROOT is stripped from files and files are converted to UNIX
-# line endings.
-#
-# the pear install process output is recorded to install.log, you should put it
-# to %%doc for later debug or just for information.
-#
-# additionally additional-packages.txt is produced if it was detected that the
-# package has optional dependencies. the file format is suitable of displaying
-# in %%post of a package. you should put this file to %%doc. noautocompressdoc is
-# automatically added for this file.
-
-
-# records install.log and transforms PEAR names to PLD Linux rpm package names.
-%__pear_install_log \
-tee install.log \
-# make post message of optional packages \
-grep -E 'can optionally use|Optional feature' install.log | sed -e 's,package "pear/,package "php-pear-,g;s,^pear/,php-pear-,;s,^pear/,php-pear-,' > optional-packages.txt \
-if [ -s optional-packages.txt ]; then \
- awk -F'"' '/use package/{print $2}' optional-packages.txt | sed -e "s,_,/,g;s,php-pear-, 'pear(,;s,$,.*)'," | tr -d '\\\n' > _noautoreq \
-else \
- rm -f optional-packages.txt \
-fi \
-%{nil}
-
-# Command invoking PEAR CLI
-# Same as /usr/bin/pear, except we force GMT timezone
-%__pear %__php -doutput_buffering=1 -dopen_basedir="" -dmemory_limit=-1 -ddate.timezone=GMT /usr/share/pear/pearcmd.php
-
-%pear_install(a:d:n:zD) \
-%__pear \\\
- -c %{builddir}/pearrc \\\
- -d doc_dir=/docs \\\
- -d temp_dir=/tmp \\\
- -d php_dir=%{-c:%{builddir}/}%{php_pear_dir} \\\
- -d bin_dir=%{_bindir} \\\
- -d data_dir=%{php_pear_dir}/data \\\
- -d test_dir=%{php_pear_dir}/tests \\\
- %{-d:%(echo "%{-d*}" | awk 'BEGIN{RS=","}{printf("-d %%s \\\\\\n\\t", $1)}')} \\\
- install \\\
- --packagingroot=%{builddir} \\\
- --offline \\\
- --nodeps \\\
- %{-f:--force} \\\
- %{!-z:%{S:%{-a*}%{!-a:0}}}%{-z:$_P} > .install.log || { c=$?; cat .install.log; exit $c; }; \
- %{-c:cp -a %{builddir}/%{builddir}/%{php_pear_dir} %{builddir}/%(dirname %{php_pear_dir}); rm -rf %{builddir}/%{builddir}; } \
-%{nil}
-
-# The main macro.
-# using this macro will append optional-packages.txt to the nocompressdoc list
-# as it's displayed to user after package install. and adding additional gzip
-# dep is just waste ;)
-%pear_package_setup(a:d:n:zDc:) \
-%define srcdir %{-n*}%{!-n:%{?_pearname}%{!?_pearname:%{pearname}}-%{version}} \
-%define builddir %{_builddir}/%{srcdir} \
-%setup -q -c -T %{-D:-D} -n %{srcdir} \
-%{-z:%{__tar} zxf %{S:0}; %{-a:%{__tar} zxf %{S:%{-a*}}}} \
-%{-z:_P=package2.xml; [ -f $_P ] || _P=package.xml; _N=%{srcdir}; mv $_P $_N; cd $_N} \
-%{-c:%{__pear} -c pearrc config-set php_dir %{builddir}/%{php_pear_dir}; %__pear -c %{builddir}/pearrc channel-add %{-c*}} \
-%pear_install \
-%{-z:cd ..} \
-%{__tar} --wildcards -zvxf %{S:0} package*.xml \
-cat %{-z:$_N/}.install.log | %__pear_install_log \
-%undos -f php,html,js,xml \
-%{!?_noautocompressdoc:%global _noautocompressdoc %{nil}}%{expand:%%global _noautocompressdoc %{_noautocompressdoc} optional-packages.txt} \
-%{!?_noautoprov:%global _noautoprov %{nil}}%{expand:%%global _noautoprov %{_noautoprov} 'pear(tests/.*)'} \
-%{nil}
-
-# Copies extracted PEAR package structure and PEAR registry to buildroot.
-# Author: Elan Ruusamäe <glen@pld-linux.org>
-%pear_package_install() \
-cp -a ./%{php_pear_dir}/{.registry,*} $RPM_BUILD_ROOT%{php_pear_dir} \
-# tests should not be packaged \
-%{__rm} -rf $RPM_BUILD_ROOT%{php_pear_dir}/tests \
-# cleanup backups \
-find $RPM_BUILD_ROOT%{php_pear_dir} '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v \
-# help the developer out a little: \
-if [ -f _noautoreq ]; then \
- echo "AutoReqdep detected:" \
- echo "_noautoreq $(cat _noautoreq)" \
-fi \
-%{nil}
-
-# Print optional package info for pear packages
-# Author: Elan Ruusamäe <glen@pld-linux.org>
-# Usage:
-# %post -p <lua>
-# %%pear_package_print_optionalpackages
-#
-# Requirements:
-# BuildRequires: rpmbuild(macros) >= 1.571
-%pear_package_print_optionalpackages \
-f = io.open("%{_docdir}/%{name}-%{version}/optional-packages.txt", "r") \
-if f then \
- for l in f:lines() do print(l); end \
- f:close() \
-end \
-%{nil}
-
-
# Register OpenLDAP schema.
# Author: Elan Ruusamäe <glen@pld-linux.org>
#