spec: new macro '%macrofn' and conditional '%namespace'

This commit is contained in:
Pavel Raiskup 2015-11-19 06:37:36 +01:00
parent 189cced957
commit 51d455d0ea

View File

@ -3,10 +3,11 @@
%global rrcdir /usr/lib/rpm %global rrcdir /usr/lib/rpm
%global namespace db %{!?namespace:%global namespace db}
%global macro_ns %{?namespace:%{namespace}_} %global macro_ns %{?namespace:%{namespace}_}
%global script_ns %{?namespace:%{namespace}-} %global script_ns %{?namespace:%{namespace}-}
%global macrofn_ns %{?namespace:%{namespace}-} %global macrofn_ns %{?namespace:%{namespace}-}
%global macrofn() macros.%{?macrofn_ns}%1
Summary: More or less DB related rpm configuration files Summary: More or less DB related rpm configuration files
Name: %{?script_ns}rpm-config Name: %{?script_ns}rpm-config
@ -35,7 +36,7 @@ RPM configuration files used by DB team (but others might be interested too).
sed \ sed \
-e 's|@ML_MACRO_PFX@|%{?macro_ns}|g' \ -e 's|@ML_MACRO_PFX@|%{?macro_ns}|g' \
-e 's|@ML_FIX@|%ml_fix|g' \ -e 's|@ML_FIX@|%ml_fix|g' \
%{SOURCE1} > macros.%{?macrofn_ns}ml %{SOURCE1} > %{macrofn ml}
%install %install
mkdir -p %{buildroot}%{rrcdir} mkdir -p %{buildroot}%{rrcdir}