diff --git a/epel-rpm-macros.spec b/epel-rpm-macros.spec index 9cf896b..679c0d3 100644 --- a/epel-rpm-macros.spec +++ b/epel-rpm-macros.spec @@ -1,6 +1,6 @@ Name: epel-rpm-macros Version: 6 -Release: 2 +Release: 3 Summary: Extra Packages for Enterprise Linux RPM macros Group: System Environment/Base @@ -31,11 +31,15 @@ install -Dpm 644 %{SOURCE0} \ %{buildroot}/etc/rpm/macros.zzz-epel %files -# Can't use %%license here yet +# Explicitly don't use %%license so that this package can be built without this +# package being installed. %doc GPL /etc/rpm/macros.zzz-epel %changelog +* Mon Jan 25 2016 Jason L Tibbitts III - 6-3 +- Try defining %%license a different (and much simpler) way. + * Wed Jan 13 2016 Orion Poplawski - 6-2 - Add %%nodejs_arches diff --git a/macros.zzz-epel b/macros.zzz-epel index 70f1811..ee25c07 100644 --- a/macros.zzz-epel +++ b/macros.zzz-epel @@ -1,65 +1,18 @@ # EPEL6-specific macros # This file is named such that it appears alphabetically after other macro -# files in /etc/rpm. This allows us to overwrite RHEL-provided macros if -# necessary. (It turns out that it is necessary; see _font_pkg below.) +# files in /etc/rpm. +# This macro defines %license to work like %doc. It hangs off of a +# redefinition of %description. It's not possible to have a simple definition +# because RPM will overwrite %license as soon as it parses a License: tag. -# This macro defines %license to work like %doc. -# -# This isn't as simple as it might seem, because RPM will write over the -# %license macro as soon as it sees the License: tag. This means that the -# macro has to be defined later, and rpm gives us no hooks to do that. We -# could add a simple macro that just defines the thing, but that only saves -# users having to paste in some line noise. Which is still an improvement, but -# we can do better. -# -# For whatever reason rpm lets us redefine %files. Since every package that's -# going to have a license file will have a %files section, we're golden. -%files(f:n:) %{lua: +# Ideally this should happen as late as possible, but it seems there are troubles +# with some other sets of macros if we use %files, so try doing it earlier. +%description %{lua: rpm.define("license %doc") - local args = rpm.expand("%**") - if type(args) == "nil" or string.len(args) == 0 then - print("%files\\n") - else - print("%files " .. args .. "\\n") - end + print("%description") } -# This macro overrides the existing macro from macros.fonts (part of the -# fontpackages-devel package). This is necessary because that macro has a bug -# which causes it to expand recursively if expanded in certain contextx. It is -# possible but not likely that Red Hat would update this package in RHEL6. -# -# The only difference is that a define is changed to a global on the third -# line, and that a guard against the font macros not actually being installed -# is added. -%_font_pkg(n:f:) \ -%{?_font_pkg_name:\ -%global spn %_font_pkg_name %{-n:%{-n*}} \ -%post -n %{spn} \ -if [ -x %{_bindir}/fc-cache ]; then \ - %{_bindir}/fc-cache %{_fontdir} || : \ -fi \ -\ -\ -%postun -n %{spn} \ -if [ $1 -eq 0 -a -x %{_bindir}/fc-cache ] ; then \ - %{_bindir}/fc-cache %{_fontdir} || : \ -fi\ -\ -\ -%files -n %{spn} \ -%defattr(0644,root,root,0755) \ -\ -%dir %{_fontdir} \ -%{lua: \ -for arg=1,rpm.expand("%#") do \ - print(rpm.expand("%{_fontdir}/%" .. arg) .. "\\n") \ -end} \ -%{-f:%{_fontconfig_templatedir}/%{-f*}} \ -%{-f:%config(noreplace) %{_fontconfig_confdir}/%{-f*} \ -}} %{nil} - # Add nodejs_arches - in redhat-rpm-config in EL7 %nodejs_arches %{ix86} x86_64 %{arm}