]> git.pld-linux.org Git - packages/rpm.git/blobdiff - rpm.macros
- adjusted for current pl.po patch
[packages/rpm.git] / rpm.macros
index 4b3ac21d693a13f6762af60427b3c548f42a4bee..5f293bb53440cf238b8586f3a217cd5da76f48f6 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
 
+%debuginfocflags       %{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1: -ggdb}%{expand:%%undefine __dic_%{?_enable_debug_packages}}
+
 %debugcflags   -O0 -g -Wall
-%rpmcflags     %{?debug:%debugcflags}%{!?debug:%optflags}
-# %rpmldflags  %{!?debug:-s}
+%rpmcflags     %{?debug:%debugcflags}%{!?debug:%optflags}%{?debuginfocflags}
 %rpmldflags    %{nil}
 
 # kernel compiler
@@ -50,8 +54,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} \
@@ -77,8 +81,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.
 
 #
 #%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 \
@@ -342,11 +368,11 @@ echo "Compress kernel modules if any."; \
 # Requires/Provides automation
 # exceptions system by Jacek Konieczny <jajcus@pld.org.pl>
 #
-%_noautoreqfiles       %(sed -e s'/#.*//' /etc/rpm/noautoreqfiles)
-%_noautoprovfiles      %(sed -e s'/#.*//' /etc/rpm/noautoprovfiles)
-%_noautoreq            %(sed -e s'/#.*//' /etc/rpm/noautoreq)
-%_noautoreqdep         %(sed -e s'/#.*//' /etc/rpm/noautoreqdep)
-%_noautoprov           %(sed -e s'/#.*//' /etc/rpm/noautoprov)
+%__noautoreqfiles      %(sed -e s'/#.*//' /etc/rpm/noautoreqfiles)%{?_noautoreqfiles: %{_noautoreqfiles}}
+%__noautoprovfiles     %(sed -e s'/#.*//' /etc/rpm/noautoprovfiles)%{?_noautoprovfiles: %{_noautoprovfiles}}
+%__noautoreq           %(sed -e s'/#.*//' /etc/rpm/noautoreq)%{?_noautoreq: %{_noautoreq}}
+%__noautoreqdep                %(sed -e s'/#.*//' /etc/rpm/noautoreqdep)%{?_noautoreqdep: %{_noautoreqdep}}
+%__noautoprov          %(sed -e s'/#.*//' /etc/rpm/noautoprov)%{?_noautoprov: %{_noautoprov}}
 #%_noautocompressdoc   %{nil}
 #
 %_missing_doc_files_terminate_build    1%{nil}
@@ -418,3 +444,23 @@ 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/')
+
+# user/group checking macros
+#
+# Usage:
+#      %userremove myuser
+#
+%userremove    /usr/lib/rpm/user_group.sh user del
+%groupremove   /usr/lib/rpm/user_group.sh group del
+#
+# Usage:
+#      if %usertestrm myuser; then
+#              /usr/sbin/userdel -r myuser
+# Note:
+#      use these macros only if you need to call userdel/groupdel with
+#      a non-standard option or take an extra action; otherwise use the
+#      %userremove/%groupremove macros
+#
+%usertestrm    /usr/lib/rpm/user_group.sh user testrm
+%grouptestrm   /usr/lib/rpm/user_group.sh group testrm
This page took 0.034339 seconds and 4 git commands to generate.