Rex Dieter wrote:

> Rex Dieter wrote on Oct 16:
> 
>> I'd like to be able to conditionalize some package features depending on
>> if
>> epel repo is enabled or not.  One way to accomplish that goal is if epel-
>> release defined some macro, say, something like %{epel}, similar to
>> %{feodra} or %{rhel}
>> 
>> (I don't care what the macro is named, as long as the bikeshed remains
>> blue)
>> 
>> My primary motivation is to simplify the task of doing something like:
>> https://copr.fedoraproject.org/coprs/rdieter/kde4/
>> where I currently end up patching various .spec files (mostly to enable
>> features due to having epel available), and I'd like to be able to
>> minimize having to do that.
>> 
>> thoughts?
> 
> ping, any comment or objection?
> 
> I'll work on a patch for epel-release to implement a %{epel} macro, in
> case anyone was waiting for implementation details.

Here's the epel-release patch as promised (epel7 branch), attached.

-- Rex
>From 6208a680f648b1ac0e0eb3582d5d85a76cdb48bd Mon Sep 17 00:00:00 2001
From: Rex Dieter <[email protected]>
Date: Fri, 31 Oct 2014 07:36:53 -0500
Subject: [PATCH] implement %epel macro

---
 epel-release.spec |    9 ++++++++-
 macros.epel       |    3 +++
 2 files changed, 11 insertions(+), 1 deletions(-)
 create mode 100644 macros.epel

diff --git a/epel-release.spec b/epel-release.spec
index 9427b01..c0c0965 100644
--- a/epel-release.spec
+++ b/epel-release.spec
@@ -1,6 +1,6 @@
 Name:           epel-release       
 Version:        7
-Release:        2
+Release:        3
 Summary:        Extra Packages for Enterprise Linux repository configuration
 
 Group:          System Environment/Base 
@@ -14,6 +14,7 @@ Source0:        http://download.fedoraproject.org/pub/epel/RPM-GPG-KEY-EPEL-7
 Source1:        GPL	
 Source2:        epel.repo	
 Source3:        epel-testing.repo	
+Source4:        macros.epel
 
 BuildArch:     noarch
 Requires:      redhat-release >=  %{version} 
@@ -41,6 +42,7 @@ install -Dpm 644 %{SOURCE0} \
 install -dm 755 $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d
 install -pm 644 %{SOURCE2} %{SOURCE3}  \
     $RPM_BUILD_ROOT%{_sysconfdir}/yum.repos.d
+install -pm -D ${SOURCE3} $RPM_BUILD_ROOT/usr/lib/rpm/macros.d/macros.epel
 
 %clean
 rm -rf $RPM_BUILD_ROOT
@@ -50,9 +52,14 @@ rm -rf $RPM_BUILD_ROOT
 %doc GPL
 %config(noreplace) /etc/yum.repos.d/*
 /etc/pki/rpm-gpg/*
+/usr/lib/rpm/macros.d/macros.epel
+
 
 
 %changelog
+* Fri Oct 31 2014 Rex Dieter <[email protected]> 7-3
+- implement %%epel macro
+
 * Tue Sep 02 2014 Kevin Fenzi <[email protected]> 7-2
 - Make repo files config(noreplace). Fixes bug #1135576
 
diff --git a/macros.epel b/macros.epel
new file mode 100644
index 0000000..fb4413f
--- /dev/null
+++ b/macros.epel
@@ -0,0 +1,3 @@
+# epel macros
+
+%epel %{?rhel}%{!?:rhel:7}
-- 
1.7.1


_______________________________________________
epel-devel mailing list
[email protected]
https://admin.fedoraproject.org/mailman/listinfo/epel-devel

Reply via email to