On Mon, Aug 05, 2013 at 02:17:25PM -0700, Greg Bailey wrote:
Hello list,
I have a package "mup" that currently fails to build in Rawhide due
to the introduction of the following Fedora 20 feature:
http://fedoraproject.org/wiki/Changes/UnversionedDocdirs
My current (broken) spec file has things like the following to fix
up file paths referenced by the upstream makefile:
sed -i -e 's|DOCDIR = $(PREFIX)/share/doc/packages/mup|DOCDIR =
$(PREFIX)/share/doc/%{name}-%{version}|' makefile
Install of patching the makefile, why not override the DOCDIR variable
on the make invocation? (Also, the makefile and other changes should
really be done in %prep, not %build--but using the following method
avoids changing the makefile at all). This works correctly on F20 and
older releases as well.
diff --git a/mup.spec b/mup.spec
index 6724e47..32dda29 100644
--- a/mup.spec
+++ b/mup.spec
@@ -1,7 +1,9 @@
+%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}}
+
Name: mup
Version: 6.1
-Release: 6%{?dist}
+Release: 7%{?dist}
Summary: A music notation program that can also generate MIDI files
Group: Applications/Multimedia
License: Mup
@@ -41,23 +43,18 @@ musical score described by the input.
%prep
%setup -q
-%build
-
# Preserve the timestamp of files that we copy from the Mup source tree
sed -i -e 's|cp |cp -p |' makefile
-# Modify the location of filepaths to conform to Filesystem Hierarchy Standard
-sed -i -e 's|LIBDIR = $(PREFIX)/lib/mup|LIBDIR = $(PREFIX)/share/mup|' makefile
-sed -i -e 's|DOCDIR = $(PREFIX)/share/doc/packages/mup|DOCDIR =
$(PREFIX)/share/doc/%{_doc_subdir}|' makefile
-
# Fix location of the Mup documentation in Mupmate preferences
-sed -i -e 's|/usr/share/doc/packages/mup|%{_docdir}/%{_doc_subdir}|'
mupmate/Preferences.C
+sed -i -e 's|/usr/share/doc/packages/mup|%{_pkgdocdir}|' mupmate/Preferences.C
-make %{?_smp_mflags} CFLAGS="%{optflags}"
+%build
+make %{?_smp_mflags} CFLAGS="%{optflags}"
LIBDIR="%{_datadir}/%{name}" DOCDIR="%{_pkgdocdir}"
%install
rm -rf %{buildroot}
-make DESTDIR=%{buildroot} install
+make DESTDIR="%{buildroot}" LIBDIR="%{buildroot}%{_datadir}/%{name}"
DOCDIR="%{buildroot}%{_pkgdocdir}" install
mkdir -p %{buildroot}/%{_datadir}/applications
cp -p %{SOURCE1} %{buildroot}/%{_datadir}/applications/