]> git.pld-linux.org Git - packages/rpm-build-macros.git/blobdiff - rpm.macros
- add Author
[packages/rpm-build-macros.git] / rpm.macros
index 80bb2896411a309347e9c00b3e608de97a3c92b0..c7921eb061a0749432ccf7c6c1d7c795005373aa 100644 (file)
@@ -350,7 +350,7 @@ unset DISPLAY ||:\
 %__spec_install_post_strip {%{!?debug: \
 %{!?no_install_post_strip:__spec_install_post_strip() { \
 if [ -d "$RPM_BUILD_ROOT" ]; then \
-       filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*\.debug" ! -regex ".*%{_docdir}/.*" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \
+       filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*\.debug" ! -regex ".*%{_docdir}/.*" ! -regex ".*%{_includedir}/.*" %{?_noautostrip:! -regex "%{_noautostrip}"}`; \
        if [ -z "$filelist" ]; then \
                return; \
        fi; \
@@ -387,7 +387,7 @@ fi; }; __spec_install_post_strip } } }
 %__spec_install_post_chrpath {%{!?debug: \
 %{!?no_install_post_chrpath: __spec_install_post_chrpath() { \
 if [ -d "$RPM_BUILD_ROOT" ]; then \
-       files=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*" ! -regex ".*%{_docdir}/.*" %{?_noautochrpath:! -regex "%{_noautochrpath}"}`; \
+       files=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*" ! -regex ".*%{_docdir}/.*" ! -regex ".*%{_includedir}/.*"  %{?_noautochrpath:! -regex "%{_noautochrpath}"}`; \
        if [ -n "$files" ]; then \
                objs=`echo "$files" | xargs -r -d'\\n' file | awk -F: '/ELF.*(executable.*dynamically linked|shared object)/ {print $1}'`; \
        fi
@@ -944,23 +944,44 @@ if [ "$1" = "0" ] || [ "$2" = "0" ]; then \
 %service(q) {{%(export quiet=%{-q:1}; /usr/lib/rpm/service_generator.sh %{*}) };}
 
 
-# java macros. based on jpackage macros.java
+# Java macros. based on jpackage macros.java
+#
+# Root directory where all Java VMs/SDK/JREs are installed.
 %_jvmdir               %{_libdir}/jvm
+
+# Root directory where all Java VMs/SDK/JREs expose their jars
 %_jvmjardir            %{_libdir}/jvm-exports
-%_jvmprivdir           %{_libdir}/jvm-private
+
+# Root directory for all Java VM/SDK/JRE's private things.
+%_jvmprivdir   %{_libdir}/jvm-private
+
+# Root directory for all architecture dependent parts of Java VM/SDK/JRE's
 %_jvmlibdir            %{_libdir}/jvm
-%_jvmdatadir           %{_datadir}/jvm
-%_jvmsysconfdir                %{_sysconfdir}/jvm
-# FIXME: are these used?
+
+# Root directory for all architecture independent parts of Java VM/SDK/JRE's
+%_jvmdatadir   %{_datadir}/jvm
+
+# Root directory for all configurations parts of Java VM/SDK/JRE's
+%_jvmsysconfdir        %{_sysconfdir}/jvm
+
+# Root directory for all common architecture dependent parts of Java VM/SDK/JRE's
 %_jvmcommonlibdir      %{_libdir}/jvm-common
+
+# Root directory for all common architecture independent parts of Java VM/SDK/JRE's
 %_jvmcommondatadir     %{_datadir}/jvm-common
+
+# Root directory for all common configurations parts of Java VM/SDK/JRE's
 %_jvmcommonsysconfdir  %{_sysconfdir}/jvm-common
+
+# Directory where arch-specific (JNI) version-independent jars are installed.
 %_jnidir               %{_libdir}/java
-%java_home             %(unset JAVA_HOME; . %{_javadir}-utils/java-functions; set_jvm; echo $JAVA_HOME)
+
+
+%java_home             %([ -f %{_javadir}-utils/java-functions ] || { echo ERROR; exit 0; }; unset JAVA_HOME; . %{_javadir}-utils/java-functions; set_jvm; echo ${JAVA_HOME:-ERROR})
 
 %ant                   JAVA_HOME=%{java_home} ant
 %jar                   %{java_home}/bin/jar
-%java                  %(unset JAVACMD; . %{_javadir}-utils/java-functions; set_javacmd; echo $JAVACMD)
+%java                  %([ -f %{_javadir}-utils/java-functions ] || { echo ERROR; exit 0; }; unset JAVACMD; . %{_javadir}-utils/java-functions; set_javacmd; echo $JAVACMD)
 %javac                 %{java_home}/bin/javac
 %javadoc               %{java_home}/bin/javadoc
 
@@ -1044,7 +1065,7 @@ fi \
 # command invoking pear cli
 %__pear /usr/bin/pear
 
-# the main macro.
+# The main macro.
 # using this macro will append optional-packages.txt to the nocompressdoc list
 # as it's displayed to user after package install. and adding additional gzip
 # dep is just waste ;)
@@ -1076,9 +1097,8 @@ find . -type f -print0 | xargs -0 sed -i -e 's,\\r$,,' \
 %{!?_noautoprov:%global _noautoprov %{nil}}%{expand:%%global _noautoprov %{_noautoprov} 'pear(tests/.*)'} \
 %{nil}
 
-# copies exctracted PEAR package structure to buildroot.
-# also copies PEAR registry file.
-# please use this macro, for future extensions being possible.
+# Copies exctracted PEAR package structure and PEAR registry to buildroot.
+# Author: Elan Ruusamäe <glen@pld-linux.org>
 %pear_package_install() \
 cp -a ./%{php_pear_dir}/{.registry,*} $RPM_BUILD_ROOT%{php_pear_dir} \
 find $RPM_BUILD_ROOT%{php_pear_dir} '(' -name '*~' -o -name '*.orig' ')' | xargs -r rm -v \
@@ -1163,7 +1183,7 @@ done \
 # Developer note: don't touch it unless you know how to handle '\'.
 # - \ in script expands to nothing
 # - \\\ in script expands to \
-# - \\\ inside definition expands to noting
+# - \\\ inside definition expands to nothing
 # - \\\\\\\ inside definition expands to \
 # - in last line \ has to touch arguments so arguments passing
 #   in new lines (using \) will be supported
@@ -1189,7 +1209,7 @@ compile() {                                                                                                                       \
        L="<"; [[ '%{*}' != *$L$L* ]] || PATCH_SH="set -x -e;$(cat)"    \
        set -e -x                                                                                                               \
                                                                                                                                        \
-for cfg in %{?with_dist_kernel:%{?with_smp:smp} up}%{!?with_dist_kernel:nondist}; do \
+for cfg in %{?with_dist_kernel:%{?with_smp:smp} %{?with_up:up}}%{!?with_dist_kernel:nondist}; do \
        [ -r "%{_kernelsrcdir}/config-$cfg" ] || exit 1                                 \
                                                                                                                                        \
        rm -rf o                                                                                                                \
@@ -1266,16 +1286,25 @@ install -d %{KernelD}{,smp}/%{-d*}                                                                      \
 for MODULE in {%{-m*},}; do                                                                                    \
        [ -n "${MODULE}" ] || continue                                                                  \
        MNAME=${MODULE##*/}                                                                                             \
-       install ${MODULE}-%{?with_dist_kernel:up}%{!?with_dist_kernel:nondist}.ko \\\
-               %{KernelD}/%{-d*}/${MNAME}%{-s:-%{-s*}}.ko                                      \
-       %{?-s:echo "alias ${MNAME} ${MNAME}-%{-s*}"                                             \\\
-               >> %{ModprobeD}/%{-n*}.conf}                                                            \
-    %if %{with smp} && %{with dist_kernel}                                                     \
-       install ${MODULE}-smp.ko                                                                                \\\
-               %{KernelD}smp/%{-d*}/${MNAME}%{-s:-%{-s*}}.ko                           \
-       %{?-s:echo "alias ${MNAME} ${MNAME}-%{-s*}"                                             \\\
-               >> %{ModprobeD}smp/%{-n*}.conf}                                                         \
-    %endif                                                                                                                     \
+       %if %{without dist_kernel}                                                                              \
+               install %{MODULE}-nondist.ko                                                            \\\
+                       %{KernelD}/%{-d*}/${MNAME}%{-s:-%{-s*}}.ko                              \
+               %{?-s:echo "alias ${MNAME} ${MNAME}-%{-s*}"                                     \\\
+                       >> %{ModprobeD}/%{-n*}.conf}                                                    \
+       %else                                                                                                                   \
+       %if %{with up}                                                                                                  \
+               install ${MODULE}-up.ko                                                                         \\\
+                       %{KernelD}/%{-d*}/${MNAME}%{-s:-%{-s*}}.ko                              \
+               %{?-s:echo "alias ${MNAME} ${MNAME}-%{-s*}"                                     \\\
+                       >> %{ModprobeD}/%{-n*}.conf}                                                    \
+       %endif                                                                                                                  \
+       %if %{with smp}                                                                                                 \
+               install ${MODULE}-smp.ko                                                                        \\\
+                       %{KernelD}smp/%{-d*}/${MNAME}%{-s:-%{-s*}}.ko                   \
+               %{?-s:echo "alias ${MNAME} ${MNAME}-%{-s*}"                                     \\\
+                       >> %{ModprobeD}smp/%{-n*}.conf}                                                 \
+       %endif                                                                                                                  \
+       %endif                                                                                                                  \
 done                                                                                                                           \
 %{nil}
 
@@ -1328,6 +1357,8 @@ done                                                                                                                              \
 #
 #  <name> (required) -- name of the browser. usually %{name}.
 #  -p <plugindir> (required) -- in what directory browser searches for its plugins.
+#  -b -- default blacklists
+#  -a <arch> override arch
 #
 # Example:
 #   %browser_plugins_add_browser %{name} -p %{_firefoxdir}/plugins
@@ -1336,10 +1367,11 @@ done                                                                                                                            \
 %_browserpluginsdir                    %{_libdir}/browser-plugins
 %update_browser_plugins                /usr/sbin/update-browser-plugins || :
 
-%browser_plugins_add_browser(p:b:) \
+%browser_plugins_add_browser(p:b:a:) \
+       browser=%1.%{!-a:%{_target_base_arch}}%{-a*} \
        install -d $RPM_BUILD_ROOT%{_browserpluginsconfdir}/{blacklist,browsers}.d \
-       ln -s %{-p*} $RPM_BUILD_ROOT%{_browserpluginsconfdir}/browsers.d/%1.%{_target_base_arch} \
-       blacklist_file=$RPM_BUILD_ROOT%{_browserpluginsconfdir}/blacklist.d/%1.%{_target_base_arch}.blacklist \
+       ln -s %{-p*} $RPM_BUILD_ROOT%{_browserpluginsconfdir}/browsers.d/$browser \
+       blacklist_file=$RPM_BUILD_ROOT%{_browserpluginsconfdir}/blacklist.d/$browser.blacklist \
        echo '# This file format is shell globs at base dir of plugindir' > $blacklist_file \
        %{-b:cat >> $blacklist_file %{-b*}} \
 %{nil}
This page took 0.117081 seconds and 4 git commands to generate.