]> git.pld-linux.org Git - packages/rpm-build-macros.git/blobdiff - rpm.macros
- close only if f is valid
[packages/rpm-build-macros.git] / rpm.macros
index 3ccc0e2b1cff03c67567c61507acbfcf5984e7b7..8064a617355b118a39bcc11c77b7b1344ce49091 100644 (file)
@@ -917,6 +917,10 @@ fi; \
 %ruby_vendordir                %{expand:%%global ruby_vendordir %(%{__ruby} -r rbconfig -e 'print RbConfig::CONFIG["vendordir"]' 2>/dev/null || echo ERROR)}%ruby_vendordir
 %ruby_version          %{expand:%%global ruby_version %(%{__ruby} -r rbconfig -e 'print RbConfig::CONFIG["ruby_version"]' 2>/dev/null || echo ERROR)}%ruby_version
 
+%ruby_gemdir           %{expand:%%global ruby_gemdir %(%{__ruby} -r rbconfig -e 'print RbConfig::CONFIG["rubylibdir"].sub(RbConfig::CONFIG["ruby_version"], "gems/#{RbConfig::CONFIG["ruby_version"]}")' 2>/dev/null || echo ERROR)}%{ruby_gemdir}
+%ruby_specdir          %{ruby_gemdir}/specifications
+
+# deprecated, similar functionality autogenerated with rpm5
 %ruby_ver_requires_eq  Requires:       ruby(ver) = %ruby_version
 %ruby_mod_ver_requires_eq      Requires:       ruby-modules(ver) = %ruby_version
 
@@ -942,7 +946,10 @@ fi; \
 %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             %(c=$(php-config --sysconfdir 2>/dev/null) || echo '' && echo ${c#/etc/php})
+%php_suffix                            %{expand:%%global php_suffix %(c=$(php-config --sysconfdir 2>/dev/null) || echo '' && echo ${c#/etc/php})%%{nil}}%php_suffix
+
+# php cli. version that php headers are installed for
+%__php                                 /usr/bin/%{php_name}
 
 # helper macro
 %__php_api_requires(v:) Requires: %{php_name}(%{expand:%1}) = %{expand:%{%{!?2:%{1}}%{?2}}}
@@ -1601,6 +1608,7 @@ fi \
 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}
 
@@ -1981,7 +1989,11 @@ s=""\
 for _, l in pairs(t) do\
        s=s..l.."\\n"\
 end\
-io.open("/etc/shells", "w"):write(s)\
+f = io.open("/etc/shells", "w")\
+if f then\
+       write(s)\
+       f:close()\
+end\
 %{nil}
 
 # Backwards compat. Use of %lua_ prefixed macros is preferred as these are cleaner to read.
This page took 0.03425 seconds and 4 git commands to generate.