# <http://www.pld-linux.org/>
# can be used by builder script to check for version
-%rpm_build_macros $Revision$
+%rpm_build_macros {Revision}
%epoch 0
%x8664 x86_64 amd64 ia32e
echo ".so $l" > $a; \
echo >&2 "Converted ${a#$RPM_BUILD_ROOT} from symlink to man link: $l"; \
done; \
+ # verify that .so links point to existing files (not allowed to point to "other package") \
+ # TODO: iterate over all man dirs, but in Th there is only one true man dir \
+ err=$(grep -rl '^\.so ' "$RPM_BUILD_ROOT$i" | while read doc; do \
+ l=$(cat "$doc"); \
+ l=${l#.so }; \
+ d=$(dirname $doc); \
+ test -e $RPM_BUILD_ROOT$i/$l || test -e $d/$l || echo " ${doc#$RPM_BUILD_ROOT} points to inexistent manpage: $l"; \
+ done); \
+ test "$err" != "" && { echo >&2 "Man page link errors:"; echo >&2 "$err"; exit 1; }; \
find "$RPM_BUILD_ROOT$i" -type f -size +%{_min_compress_bytes}c -print | xargs -r %{__gzip} -9nf; \
fi; \
done; \
# Ruby
%__ruby /usr/bin/ruby
+
%ruby_archdir %{expand:%%global ruby_archdir %(%{__ruby} -r rbconfig -e 'print Config::CONFIG["archdir"]' 2>/dev/null || echo ERROR)}%ruby_archdir
+%ruby_libdir %{expand:%%global ruby_libdir %(%{__ruby} -r rbconfig -e 'print Config::CONFIG["rubylibdir"]' 2>/dev/null || echo ERROR)}%ruby_libdir
%ruby_ridir %{expand:%%global 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_rubylibdir %{expand:%%global ruby_rubylibdir %(%{__ruby} -r rbconfig -e 'print Config::CONFIG["rubylibdir"]' 2>/dev/null || echo ERROR)}%ruby_rubylibdir
%ruby_vendorarchdir %{expand:%%global ruby_vendorarchdir %(%{__ruby} -r rbconfig -e 'print Config::CONFIG["vendorarchdir"]' 2>/dev/null || echo ERROR)}%ruby_vendorarchdir
%ruby_vendorlibdir %{expand:%%global ruby_vendorlibdir %(%{__ruby} -r rbconfig -e 'print Config::CONFIG["vendorlibdir"]' 2>/dev/null || echo ERROR)}%ruby_vendorlibdir
%ruby_sitearchdir %{expand:%%global ruby_sitearchdir %(%{__ruby} -r rbconfig -e 'print Config::CONFIG["sitearchdir"]' 2>/dev/null || echo ERROR)}%ruby_sitearchdir
+%ruby_sitedir %{expand:%%global ruby_sitedir %(%{__ruby} -r rbconfig -e 'print Config::CONFIG["sitedir"]' 2>/dev/null || echo ERROR)}%ruby_sitedir
%ruby_sitelibdir %{expand:%%global ruby_sitelibdir %(%{__ruby} -r rbconfig -e 'print Config::CONFIG["sitelibdir"]' 2>/dev/null || echo ERROR)}%ruby_sitelibdir
%ruby_rdocdir /usr/share/rdoc
+%ruby_vendordir %{expand:%%global ruby_vendordir %(%{__ruby} -r rbconfig -e 'print Config::CONFIG["vendordir"]' 2>/dev/null || echo ERROR)}%ruby_vendordir
%ruby_version %{expand:%%global ruby_version %(%{__ruby} -r rbconfig -e 'print Config::CONFIG["ruby_version"]' 2>/dev/null || echo ERROR)}%ruby_version
+
%ruby_ver_requires_eq Requires: ruby(ver) = %ruby_version
%ruby_mod_ver_requires_eq Requires: ruby-modules(ver) = %ruby_version
# name of php package
%php_name php%{?php_suffix}
# use rpmbuild -D 'php_suffix 54' to build php extension for php 5.4
-%php_suffix %{nil}
+# NOTE: error output must be empty. otherwise can't build pecl packages if no php*-devel is installed
+%php_suffix %(c=$(php-config --sysconfdir 2>/dev/null) || echo '' && echo ${c#/etc/php})
# helper macro
%__php_api_requires(v:) Requires: %{php_name}(%{expand:%1}) = %{expand:%{%{!?2:%{1}}%{?2}}}
%service -q php-fcgi restart \
fi \
fi \
-if [ -x /etc/rc.d/init.d/php-fpm ]; then \
- %service -q php-fpm restart \
+if [ -x /etc/rc.d/init.d/%{php_name}-fpm ]; then \
+ %service -q %{php_name}-fpm restart \
fi \
%{nil}