]> git.pld-linux.org Git - packages/rpm-pld-macros.git/blobdiff - rpm.macros
- bugfix
[packages/rpm-pld-macros.git] / rpm.macros
index 5a9c6d2c1e507fb8460c212b79a8f2083c3f8d78..0769b7eb352c73b8dd687d759be9b000c5cd1d93 100644 (file)
@@ -4,7 +4,7 @@
 # <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
@@ -534,6 +534,15 @@ Provides: %{1} = %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}
                                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; \
@@ -885,15 +894,20 @@ fi; \
 
 # 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
 
@@ -918,7 +932,8 @@ fi; \
 # 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}}}
@@ -949,8 +964,8 @@ if [ -x /etc/rc.d/init.d/php-fcgi ]; then \
                %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}
 
This page took 0.0407 seconds and 4 git commands to generate.