]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm.macros
- well, -ggdb will be enough
[packages/rpm.git] / rpm.macros
index 71a7582e93bad65c3a1f9ed35cac16dce97ac0d8..347300535aba1893e0528adba1314af1c4ff234f 100644 (file)
@@ -1,5 +1,8 @@
 # PLD rpm macros
 
+# other macros
+%_enable_debug_packages 1
+
 %__id          @__ID@
 %__id_u                %{__id} -u 
 %__chown_Rhf           @__CHOWN_RHF@
 #-----------------------------------------------------------------
 # CFLAGS and LDFLAGS used to build
 
+%if %{_enable_debug_packages}%{!?_enable_debug_packages:0}
+%debuginfocflags        -ggdb
+%endif
+
 %debugcflags   -O0 -g -Wall
-%rpmcflags     %{?debug:%debugcflags}%{!?debug:%optflags}
-%rpmldflags    %{!?debug:-s}
+%rpmcflags     %{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags:%debuginfocflags}
+%rpmldflags    %{nil}
 
 # kernel compiler
 %kgcc          gcc
@@ -49,8 +56,8 @@
  CXXFLAGS="${CXXFLAGS:-%rpmcflags}" ; export CXXFLAGS ; \
  FFLAGS="${FFLAGS:-%rpmcflags}" ; export FFLAGS ; \
  CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \
- %{?__cc:CC=%{__cc} ; export CC ; } \
- %{?__cxx:CXX=%{__cxx} ; export CXX ; } \
+ %{?__cc:CC="%{__cc}" ; export CC ; } \
+ %{?__cxx:CXX="%{__cxx}" ; export CXX ; } \
  %{?configuredir:%{configuredir}}%{!?configuredir:.}/configure \
        --host=%{_target_platform} \
        --prefix=%{_prefix} \
@@ -76,8 +83,8 @@
        CXXFLAGS="${CXXFLAGS:-%rpmcflags}" \
        FFLAGS="${FFLAGS:-%rpmcflags}" \
        CPPFLAGS="${CPPFLAGS:-}" \
-       %{?__cc:CC=%{__cc}} \
-       %{?__cxx:CXX=%{__cxx}} \
+       %{?__cc:CC="%{__cc}"} \
+       %{?__cxx:CXX="%{__cxx}"} \
        --build=%{_target_platform} \
        --prefix=%{_prefix} \
        --exec-prefix=%{_exec_prefix} \
        --x-libraries=/usr/X11R6/%{_lib} \
 }
 
+# ------------------------------------------------------------------------
+# Overloading of some basic macros
+%prep \
+%%prep\
+LANG=C\
+export LANG\
+unset DISPLAY ||:\
+%{nil}
+
+%build %%build\
+LANG=C\
+export LANG\
+unset DISPLAY ||:\
+%{nil}
+
+%install %{?_enable_debug_packages:%{?buildsubdir:%{debug_package}}}\
+%%install\
+LANG=C\
+export LANG\
+unset DISPLAY ||:\
+%{nil}
+
 # ------------------------------------------------------------------------
 # Conditional build stuff.
 
 %requires_releq()              %(LC_ALL="C" echo '%*' | xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}-%%{release}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
 %requires_releq_kernel_up()    %(LC_ALL="C" rpm -qf --qf 'Prereq: kernel-up = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -vE "(is not|no such)")
 %requires_releq_kernel_smp()   %(LC_ALL="C" rpm -qf --qf 'Prereq: kernel-smp = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -vE "(is not|no such)")
-%requires_eq_to %(LC_ALL="C" rpm -q --qf 'Requires: %1 = %%{epoch}:%%{version}\\n' %2 | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
+%requires_eq_to() %(LC_ALL="C" rpm -q --qf 'Requires: %1 = %%{epoch}:%%{version}\\n' %2 | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
 
 %apache_modules_api %(awk '/#define MODULE_MAGIC_NUMBER_MAJOR/ {print $3}' /usr/include/apache/ap_mmn.h 2>/dev/null || echo ERROR)
 
 # kernel version-release handling
-%__kernel_ver    %(grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | cut -d'"' -f2)
-%__kernel_rel    %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/version.h --queryformat "%{RELEASE}" | grep -v "is not")
+%__kernel_ver   %([ -f %{_kernelsrcdir}/include/linux/version.h ] && (grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | cut -d'"' -f2) || (awk '/^VERSION/ { ver = $0; gsub(/VERSION.*=/, NIL, ver); } /^PATCHLEVEL/ { plev = $0; gsub(/PATCHLEVEL.*=/, NIL, plev); } /^SUBLEVEL/ { slev = $0; gsub(/SUBLEVEL.*=/, NIL, slev); } END { printf("%d.%d.%d", ver, plev, slev); }' %{_kernelsrcdir}/Makefile 2> /dev/null))
+%__kernel_rel    %(LC_ALL="C" rpm -qf %{_kernelsrcdir}/include/linux/fs.h --queryformat "%{RELEASE}" | grep -v "is not")
 %_kernel_ver     %(echo %{__kernel_ver}%{!?_without_dist_kernel:-%{__kernel_rel}})
 %_kernel_ver_str %(echo %{_kernel_ver} | sed s/-/_/g)
 
 #
 #%no_install_post_compress_docs        1
 %__spec_install_post_compress_docs { \
-echo "Compress man and info pages."; \
 %{!?no_install_post_compress_docs: \
+       echo "Compress man and info pages."; \
        %{?verbose:set -x;} \
        for i in /usr/share/man /usr/X11R6/man /usr/share/info; do \
                if [ -d "$RPM_BUILD_ROOT$i" ]; then \
@@ -417,3 +446,4 @@ fi; \
 %xmms_effect_plugindir        %(xmms-config --effect-plugin-dir)
 %xmms_general_plugindir       %(xmms-config --general-plugin-dir)
 
+%_target_base_arch     %(echo %{_target_cpu} | sed 's/i.86/i386/;s/athlon/i386/;s/pentium./i386/;s/amd64/x86_64/')
This page took 0.032141 seconds and 4 git commands to generate.