-%__php_provides %{_rpmhome}/php.prov
+#__php_provides %{_rpmhome}/php.prov
# define 'php_req_new' in ~/.rpmmacros to use php version of req finder
-%__php_requires env PHP_MIN_VERSION=%{?php_min_version} %{_rpmhome}/php.req%{?php_req_new:.php}
+#__php_requires env PHP_MIN_VERSION=%{?php_min_version} %{_rpmhome}/php.req%{?php_req_new:.php}
%__php_magic ^PHP script.*
%__php_path \\.php$
opts.on("--fix-permissions", "Force standard permissions for files installed") do
ARGV.delete("--fix-permissions")
fixperms = true
- end
+ end
opts.on("-i", "--install-dir GEMDIR", "Gem repository directory") do |val|
gemdir = val
end
%__ruby /usr/bin/ruby
+# helpers to 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 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 arch combo (CPU-OS, e.g. i686-linux)
+%ruby_arch %{expand:%%global ruby_arch %{__ruby_rbconfig arch}}%ruby_arch
%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_rubyhdrdir %{expand:%%global ruby_rubyhdrdir %{__ruby_rbconfig_path rubyhdrdir}}%ruby_rubyhdrdir
%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
Obsoletes: %{1} < %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}} \
Provides: %{1} = %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}}
+# for package versions comparison (incl. cc_version or _rpmversion)
+# BuildRequires: rpmbuild(macros) >= 1.750
+%_ver_lt() %(test $(rpmvercmp "%{1}" "%{2}" >/dev/null 2>&1; echo $?) -ne 2; echo $?)
+%_ver_ge() %(test $(rpmvercmp "%{1}" "%{2}" >/dev/null 2>&1; echo $?) -eq 2; echo $?)
+
+# noarch subpackage helper
+# BuildRequires: rpmbuild(macros) >= 1.752
+%noarchpackage \
+%if %{_ver_ge '%{_rpmversion}' '4.6'} \
+BuildArch: noarch \
+%endif \
+%{nil}
+
%apache_modules_api %{expand:%%global apache_modules_api %(awk '/#define MODULE_MAGIC_NUMBER_MAJOR/ {print $3}' /usr/include/apache/ap_mmn.h 2>/dev/null || echo ERROR)}%apache_modules_api
# sgml macros
};} \
%{nil}
+# BuildRequires: rpmbuild(macros) >= 1.751
+# Requires(post,postun): /usr/bin/texhash # if you want to ensure cache is updated
+%texhash() {{ \
+ umask 022; \
+ /usr/bin/texhash >&2; \
+};} \
+%{nil}
+
#-----------------------------------------------------------------
# post %install sequence:
# - autodeps exceptions
#!/bin/sh
-# Display bcond (_with_*, _without_*) macros from given spec
+# Display bcond (_with_*, _without_*) macros from given spec
# $Id$
if [ "$#" = 0 ]; then
/^%changelog/ { chlog=1 }
/_with(out)?_[_a-zA-Z0-9]+/ && chlog == 0 {
match($0, /_with(out)?_[_a-zA-Z0-9]+/);
- print substr($0, RSTART, RLENGTH)
- }
+ print substr($0, RSTART, RLENGTH)
+ }
/^%bcond_with/ && chlog == 0 {
match($0, /bcond_with(out)?[ \t]+[_a-zA-Z0-9]+/);
bcond = substr($0, RSTART +5 , RLENGTH -5);
if ! echo `rpm --eval "%$c"` | grep $c >/dev/null; then
echo " (on)"
- else
+ else
echo ""
fi
done
for bcond in $bconds; do
isset=`awk -F"\n" "BEGIN { val=0 }
- /^%define[\t ]+$bcond/ {
- if (match(\\$0, /$bcond[\t ]+0[\t ]*$/)) {
- val = 0
- } else if (match(\\$0, /$bcond[\t ]+1[\t ]*$/)) {
- val = 1
- } else {
- print \"couldn't determine $bcond value from \", \\$0
- }
- } END { print val }" $SPEC`;
+ /^%define[\t ]+$bcond/ {
+ if (match(\\$0, /$bcond[\t ]+0[\t ]*$/)) {
+ val = 0
+ } else if (match(\\$0, /$bcond[\t ]+1[\t ]*$/)) {
+ val = 1
+ } else {
+ print \"couldn't determine $bcond value from \", \\$0
+ }
+ }
+ END { print val }" $SPEC`;
if [ x"$isset" = x"1" ]; then
echo "WARN: $bcond defined in spec";
fi
done
-
-%define rpm_macros_rev 1.747
+%define rpm_macros_rev 1.754
%define find_lang_rev 1.40
# split into individual X_prov_ver if there is a reason to desync
%define prov_ver 4.15