epienbro pushed to mingw-filesystem (f20). "Place the RPM macros in /usr/lib/rpm/macros.d when using a modern RPM"

notifications at fedoraproject.org notifications at fedoraproject.org
Sat Apr 11 18:50:59 UTC 2015


>From 7871a5f4f525ea215044154f84810e014428c5ce Mon Sep 17 00:00:00 2001
From: Erik van Pienbroek <epienbro at fedoraproject.org>
Date: Sun, 9 Feb 2014 01:04:35 +0100
Subject: Place the RPM macros in /usr/lib/rpm/macros.d when using a modern RPM


diff --git a/mingw-filesystem.spec b/mingw-filesystem.spec
index d8e141d..314fd5d 100644
--- a/mingw-filesystem.spec
+++ b/mingw-filesystem.spec
@@ -1,8 +1,13 @@
 %global debug_package %{nil}
 
+# Place RPM macros in %%{_rpmconfigdir}/macros.d if it exists (RPM 4.11+)
+# Otherwise, use %%{_sysconfdir}/rpm
+# https://lists.fedoraproject.org/pipermail/devel/2014-January/195026.html
+%global macrosdir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
+
 Name:           mingw-filesystem
 Version:        99
-Release:        3%{?dist}
+Release:        4%{?dist}
 Summary:        MinGW cross compiler base filesystem and environment
 
 Group:          Development/Libraries
@@ -140,10 +145,10 @@ mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
 install -m 644 %{SOURCE4} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
 install -m 644 %{SOURCE5} $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/
 
-mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpm
-install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.mingw
-install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.mingw32
-install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/rpm/macros.mingw64
+mkdir -p $RPM_BUILD_ROOT%{macrosdir}
+install -m 644 %{SOURCE1} $RPM_BUILD_ROOT%{macrosdir}/macros.mingw
+install -m 644 %{SOURCE2} $RPM_BUILD_ROOT%{macrosdir}/macros.mingw32
+install -m 644 %{SOURCE3} $RPM_BUILD_ROOT%{macrosdir}/macros.mingw64
 
 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/rpmlint
 install -m 644 %{SOURCE10} $RPM_BUILD_ROOT%{_sysconfdir}/rpmlint/
@@ -275,13 +280,13 @@ install -m 0644 %{SOURCE12} $RPM_BUILD_ROOT%{_datadir}/mingw/
 %doc COPYING
 %dir %{_sysconfdir}/rpmlint/
 %config(noreplace) %{_sysconfdir}/rpmlint/mingw-rpmlint.config
-%{_sysconfdir}/rpm/macros.mingw
+%{macrosdir}/macros.mingw
 %{_libexecdir}/mingw-scripts
 %{_rpmconfigdir}/mingw*
 %dir %{_datadir}/mingw/
 
 %files -n mingw32-filesystem
-%{_sysconfdir}/rpm/macros.mingw32
+%{macrosdir}/macros.mingw32
 %config(noreplace) %{_sysconfdir}/profile.d/mingw32.sh
 %{_bindir}/mingw32-configure
 %{_bindir}/mingw32-cmake
@@ -292,7 +297,7 @@ install -m 0644 %{SOURCE12} $RPM_BUILD_ROOT%{_datadir}/mingw/
 %{_datadir}/mingw/Toolchain-mingw32.cmake
 
 %files -n mingw64-filesystem
-%{_sysconfdir}/rpm/macros.mingw64
+%{macrosdir}/macros.mingw64
 %config(noreplace) %{_sysconfdir}/profile.d/mingw64.sh
 %{_bindir}/mingw64-configure
 %{_bindir}/mingw64-cmake
@@ -304,6 +309,9 @@ install -m 0644 %{SOURCE12} $RPM_BUILD_ROOT%{_datadir}/mingw/
 
 
 %changelog
+* Sat Feb  8 2014 Erik van Pienbroek <epienbro at fedoraproject.org> - 99-4
+- Place the RPM macros in /usr/lib/rpm/macros.d when using a modern RPM
+
 * Sat Aug  3 2013 Erik van Pienbroek <epienbro at fedoraproject.org> - 99-3
 - Own the folders %%{mingw32_libdir}/cmake and %%{mingw64_libdir}/cmake
 - Own all the locale folders below %%{mingw32_datadir}/locale and %%{mingw64_datadir}/locale (RHBZ #798329)
-- 
cgit v0.10.2


	http://pkgs.fedoraproject.org/cgit/mingw-filesystem.git/commit/?h=f20&id=7871a5f4f525ea215044154f84810e014428c5ce


More information about the scm-commits mailing list