]> git.pld-linux.org Git - packages/rpm-build-macros.git/blobdiff - rpm.macros
- 1.571: add %%pear_package_print_optionalpackages
[packages/rpm-build-macros.git] / rpm.macros
index 23a8078c9fc0cac2c8fe201832bebcc117e48a89..6b2070778be7a4ca5bbc98ed105a0efc14988edb 100644 (file)
@@ -7,6 +7,7 @@
 
 %epoch         0
 %x8664         x86_64 amd64 ia32e
+%arm           armv3l armv4b armv4l armv5teb armv5tel
 
 # kernel compiler
 %kgcc          %{__cc}
@@ -245,6 +246,8 @@ CFLAGS="%{rpmcflags}" \
 CXXFLAGS="%{rpmcxxflags}" \
 LDFLAGS="%{rpmldflags}" \
 %{__cmake} \
+-DCMAKE_INSTALL_PREFIX=%{_prefix} \
+-DCMAKE_BUILD_TYPE=%{!?debug:Release}%{?debug:Debug} \
 }
 
 %scons { \
@@ -1001,7 +1004,7 @@ fi; \
 %xmms_effect_plugindir         %{expand:%%global xmms_effect_plugindir %(xmms-config --effect-plugin-dir 2>/dev/null || echo ERROR)}%xmms_effect_plugindir
 %xmms_general_plugindir                %{expand:%%global xmms_general_plugindir %(xmms-config --general-plugin-dir 2>/dev/null || echo ERROR)}%xmms_general_plugindir
 
-%_target_base_arch     %{expand:%%global _target_base_arch %(echo %{_target_cpu} | sed 's/i.86/i386/;s/athlon/i386/;s/pentium./i386/;s/amd64/x86_64/;s/ia32e/x86_64/;s/sparcv./sparc/')}%_target_base_arch
+%_target_base_arch     %{expand:%%global _target_base_arch %(echo %{_target_cpu} | sed 's/i.86/i386/;s/athlon/i386/;s/pentium./i386/;s/amd64/x86_64/;s/ia32e/x86_64/;s/sparcv./sparc/;s/arm.*/arm/')}%_target_base_arch
 
 # user/group checking macros
 #
@@ -1386,8 +1389,9 @@ else \
 fi \
 %{nil}
 
-# command invoking pear cli
-%__pear /usr/bin/pear
+# 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 %{php_pear_dir}/pearcmd.php
 
 %pear_install(a:d:n:zD) \
 %__pear \\\
@@ -1441,6 +1445,21 @@ if [ -f _noautoreq ]; then \
 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 \
+end \
+%{nil}
+
 
 # Register OpenLDAP schema.
 # Author: Elan Ruusamäe <glen@pld-linux.org>
@@ -1823,16 +1842,32 @@ else: \
 # Undos files
 #
 # Author: Paweł Zuzelski <pawelz@pld-linux.org>
+# Author: Elan Ruusamäe <glen@pld-linux.org>
 #
 # Usage:
 #   %undos list_of_files
+#   %undos -f EXT[,EXT]
+#   %undos -i -f EXT[,EXT]
+#
+#  -f EXT[,EXT] - find(1) files by extensions
+#  -i - case insensitive file search
+#
+# Example:
+#   Un-DOS all *.js, *.css files
+#   %undos -f js,css
+#   Un-DOS all *.js, *.JS files
+#   %undos -f js -i
+#   undos all Makefiles
+#   %{__find} -name Makefile | xargs %undos
 #
 # Requirements:
 # BuildRequires:       sed >= 4.0
-# BuildRequires:       rpmbuild(macros) >= 1.553
+# BuildRequires:       rpmbuild(macros) >= 1.565
 
-# NB: make sure this command stays on one line
-%undos         %{__sed} -i -e 's,\\r$,,'
+# NB: make sure this macro stays on one line
+# NB: make sure it includes newline escape
+%undos(f:i)    %{-f:%{__find} -regextype posix-extended -%{-i:i}regex '^.+\\.(%(echo %{-f*} | tr ',' '|'))$' -print0 | xargs -0} %{__sed} -i -e 's,\\r$,,' %* \
+%{nil}
 
 # Hook to register nagios object based plugins in Nagios NRPE daemon config.
 #
This page took 0.068029 seconds and 4 git commands to generate.