Blame db-rpm-config.spec

189cce
# https://fedoraproject.org/wiki/Packaging:Guidelines#Packaging_of_Additional_RPM_Macros
189cce
%global macrosdir       %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
189cce
189cce
%global rrcdir          /usr/lib/rpm
189cce
51d455
%{!?namespace:%global namespace db}
189cce
%global macro_ns        %{?namespace:%{namespace}_}
189cce
%global script_ns       %{?namespace:%{namespace}-}
189cce
%global macrofn_ns      %{?namespace:%{namespace}-}
51d455
%global macrofn()       macros.%{?macrofn_ns}%1
189cce
189cce
Summary: More or less DB related rpm configuration files
189cce
Name: %{?script_ns}rpm-config
189cce
Version: 1
189cce
Release: 1%{?dist}
189cce
License: GPL+
189cce
Group: Development/System
189cce
URL: https://github.com/devexp-db/db-rpm-config
189cce
189cce
Source0: multilib-fix
189cce
Source1: macros.ml
189cce
189cce
BuildArch: noarch
189cce
189cce
# Most probably we want to have everything moved to this package!
189cce
Provides: redhat-rpm-config = %{version}-%{release}
189cce
189cce
%description
189cce
RPM configuration files used by DB team (but others might be interested too).
189cce
189cce
%prep
189cce
%setup -c -T
189cce
189cce
%build
189cce
%global ml_fix %rrcdir/%{?script_ns}multilib-fix
189cce
sed \
189cce
    -e 's|@ML_MACRO_PFX@|%{?macro_ns}|g' \
189cce
    -e 's|@ML_FIX@|%ml_fix|g' \
51d455
    %{SOURCE1} > %{macrofn ml}
189cce
189cce
%install
189cce
mkdir -p %{buildroot}%{rrcdir}
189cce
mkdir -p %{buildroot}%{macrosdir}
189cce
# Multi-lib kludge.
189cce
install -m 644 -p macros.%{?macrofn_ns}ml %{buildroot}/%{macrosdir}
189cce
install -m 755 -p %{SOURCE0} %{buildroot}/%{ml_fix}
189cce
189cce
%files
189cce
%{rrcdir}
189cce
%{macrosdir}
189cce
189cce
%changelog
189cce
* Wed Nov 18 2015 Pavel Raiskup <praiskup@redhat.com> - 1-1
189cce
- initial packaging