%_defaultdocdir %{_usr}/share/doc
%_fixowner [ `%{__id_u}` = '0' ] && %{__chown_Rhf} root.@ROOT_GROUP@
%_fixgroup true
+%_fixperms %{__chmod} -Rf @FIXPERMS@
%_topdir %(echo $HOME)/rpm
%_exec_prefix %{_prefix}
%_bindir %{_exec_prefix}/bin
#-----------------------------------------------------------------
# CFLAGS and LDFLAGS used to build
-%debugcflags -O0 -g
+%debugcflags -O0 -g -Wall
%rpmcflags %{?debug:%debugcflags}%{!?debug:%optflags}
%rpmldflags %{!?debug:-s}
CPPFLAGS="${CPPFLAGS:-}" ; export CPPFLAGS ; \
%{?__cc:CC=%{__cc} ; export CC ; } \
%{?__cxx:CXX=%{__cxx} ; export CXX ; } \
- %{?configuredir:%{configuredir}}%{?!configuredir:.}/configure \
+ %{?configuredir:%{configuredir}}%{!?configuredir:.}/configure \
--host=%{_target_platform} \
--prefix=%{_prefix} \
--exec-prefix=%{_exec_prefix} \
--infodir=%{_infodir} \
}
+# ------------------------------------------------------------------------
+# Conditional build stuff.
+
+# Check if symbol is defined.
+# Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
+%defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
+%undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
+
+# Shorthand for %{defined with_...}
+%with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
+%without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
+
+# Handle conditional builds. %bcond_with is for case when feature is
+# default off and needs to be activated with --with ... command line
+# switch. %bcond_without is for the dual case.
+#
+# %bcond_with foo defines symbol with_foo if --with foo was specified on
+# command line.
+# %bcond_without foo defines symbol with_foo if --without foo was *not*
+# specified on command line.
+#
+# For example:
+#
+# %bcond_with extra_fonts
+# %bcond_without static
+# %if %{with extra_fonts}
+# ...
+# %endif
+# %ifdef %{with static}
+# ...
+# %endif
+# %{?with_static: ... }
+# %{!?with_static: ... }
+# %{?with_extra_fonts: ... }
+# %{!?with_extra_fonts: ... }
+#
+# The bottom line: never use without_foo, _with_foo nor _without_foo, only
+# with_foo. This way changing default set of bconds for given spec is just
+# a matter of changing single line in it and syntax is more readable.
+%bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
+%bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
+# ------------------------------------------------------------------------
+
+
# Location of autoconf macros
%_aclocaldir %(aclocal --print-ac-dir)
%xmms_general_plugindir %(xmms-config --general-plugin-dir)
# If non-empty "debug" macro defined, add "dbg" suffix to release number
-%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
+%_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm
# requires name = version-release
%requires_releq() %(LC_ALL="C" rpm -q --queryformat 'Requires:%%{NAME} = %%{VERSION}-%%{RELEASE}' %1| grep -v "is not")
; do echo $l; done >> %1 \
}
-#-----------------------------------------------------------------
-# Update all GConf2 schemas
-#
-# Requires: GConf2
-#
-%gconf_schema_install { umask 022; \
- GCONF_CONFIG_SOURCE="xml:readwrite:/etc/gconf/gconf.xml.defaults" \
- /usr/bin/gconftool-2 --makefile-install-rule \
- /etc/gconf/schemas/*.schemas > /dev/null \
-}
-
#-----------------------------------------------------------------
# find and gzip all files in %{_mandir} and %{infodir}
#
%__spec_install_post_strip {%{!?debug: \
%{!?no_install_post_strip: \
%{?verbose:set -x;} \
- echo "Strip executable binaries and shared object files."; \
+ echo "Strip executable binaries, archives and shared object files."; \
filelist=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*"`; \
elfexelist=`echo $filelist | xargs -r file | \
awk '/ELF.*executable/ {print $1}' | cut -d: -f1`; \
elfsharedlist=`echo $filelist | xargs -r file | \
awk '/LF.*shared object/ {print $1}' | cut -d: -f1`; \
+ elfarchiveslist=`echo $filelist | xargs -r file | \
+ awk '/current ar archive/ {print $1}' | cut -d: -f1`; \
if [ -n "$elfexelist" ]; then \
strip --remove-section=.note --remove-section=.comment $elfexelist; \
fi; \
if [ -n "$elfsharedlist" ]; then \
strip --strip-unneeded --remove-section=.note --remove-section=.comment $elfsharedlist; \
+ fi; \
+ if [ -n "$elfarchiveslist" ]; then \
+ strip --strip-debug --remove-section=.note --remove-section=.comment $elfarchiveslist; \
fi; } \
} }
#-----------------------------------------------------------------
if test -d $RPM_BUILD_ROOT/lib/modules ; then \
find $RPM_BUILD_ROOT/lib/modules -name \*.o -type f -print | \
xargs -r %{__gzip} -9nf; \
- find $RPM_BUILD_ROOT/lib/modules -name \*.o -type l -printf "%p %l\n" | \
- while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \
+ find $RPM_BUILD_ROOT/lib/modules -name \*.o -type l -printf "%p %l\n" | \
+ while read a b; do ln -sf $b.gz $a.gz; rm -f $a; done; \
fi; \
} }
%_source_payload w9.gzdio
%_binary_payload w9.bzdio
+#-----------------------------------------------------------------
+# Update all GConf2 schemas
+#
+# Requires: GConf2
+#
+%gconf_schema_install { umask 022; \
+ GCONF_CONFIG_SOURCE="xml:readwrite:/etc/gconf/gconf.xml.defaults" \
+ /usr/bin/gconftool-2 --makefile-install-rule \
+ /etc/gconf/schemas/*.schemas > /dev/null \
+}
+
#-----------------------------------------------------------------
# post %install sequence:
# - autodeps exceptions
# - compress all man and info pages,
# - strip all ELF executables and ELF shared objects if not %debug.
+# - compress kernel modules if any
###################################################################
# Requires/Provides automation
fi; \
}
-# ------------------------------------------------------------------------
-# Conditional build stuff.
-
-# Check if symbol is defined.
-# Example usage: %if %{defined with_foo} && %{undefined with_bar} ...
-%defined() %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
-%undefined() %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
-
-# Shorthand for %{defined with_...}
-%with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
-%without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
-
-# Handle conditional builds. %bcond_with is for case when feature is
-# default off and needs to be activated with --with ... command line
-# switch. %bcond_without is for the dual case.
-#
-# %bcond_with foo defines symbol with_foo if --with foo was specified on
-# command line.
-# %bcond_without foo defines symbol with_foo if --without foo was *not*
-# specified on command line.
-#
-# For example:
-#
-# %bcond_with extra_fonts
-# %bcond_without static
-# %ifdef with_extra_fonts
-# ...
-# %endif
-# %ifdef with_static
-# ...
-# %endif
-# %{?with_static: ... }
-# %{!?with_static: ... }
-# %{?with_extra_fonts: ... }
-# %{!?with_extra_fonts: ... }
-#
-# The bottom line: never use without_foo, _with_foo nor _without_foo, only
-# with_foo. This way changing default set of bconds for given spec is just
-# a matter of changing single line in it and syntax is more readable.
-%bcond_with() %{expand:%%{?_with_%{1}:%%global with_%{1} 1}}
-%bcond_without() %{expand:%%{!?_without_%{1}:%%global with_%{1} 1}}
-# ------------------------------------------------------------------------