On 2013-07-29 16:54, Jan Kratochvil wrote: > This does not work, gdb.spec: > %files doc > %doc %{gdb_build}/gdb/doc/{gdb,annotate}.{html,pdf} > -> > /usr/share/doc/gdb-doc/annotate.html > /usr/share/doc/gdb-doc/annotate.pdf > /usr/share/doc/gdb-doc/gdb.html > /usr/share/doc/gdb-doc/gdb.pdf Right, special %doc uses the subpackage name. > If it should be /usr/share/doc/ then rpm macros need to be changed first > accordingly to s/-doc$// on the directory name. I don't think that's desirable. (I'm assuming you meant "If it should be /usr/share/doc/gdb ...".) > Therefore currently keeping the path /usr/share/doc/gdb-doc/ for > gdb-doc.rpm. If you wanted to move to /usr/share/doc/gdb, you could take advantage of the %{_pkgdocdir} property that it points to the main package, for example like in the attached patch.
diff --git a/gdb.spec b/gdb.spec index bbe6edf..366c0bc 100644 --- a/gdb.spec +++ b/gdb.spec @@ -24,6 +24,8 @@ %global _root_bindir %{_bindir} } +%{!?_pkgdocdir: %global _pkgdocdir %{_docdir}/%{name}-%{version}} + Summary: A GNU source-level debugger for C, C++, Fortran, Go and other languages Name: %{?scl_prefix}gdb @@ -1334,6 +1336,10 @@ make -j1 -C gdb/doc install DESTDIR=$RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT%{_mandir} %endif # noarch +install -dm 755 $RPM_BUILD_ROOT%{_pkgdocdir} +install -pm 644 ../{COPYING3,COPYING,COPYING.LIB,README,NEWS} \ + gdb/doc/{gdb,annotate}.{html,pdf} $RPM_BUILD_ROOT%{_pkgdocdir} + # Documentation only for development; keep 'rm's here after "noarch" above. rm -f $RPM_BUILD_ROOT%{_infodir}/gdbint* rm -f $RPM_BUILD_ROOT%{_infodir}/stabs* @@ -1351,7 +1357,12 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) -%doc COPYING3 COPYING COPYING.LIB README NEWS +%dir %{_pkgdocdir} +%doc %{_pkgdocdir}/* +%if 0%{!?el5:1} +%exclude %{_pkgdocdir}/*.html +%exclude %{_pkgdocdir}/*.pdf +%endif %{_bindir}/gcore %{_bindir}/gdb %config(noreplace) %{_sysconfdir}/gdbinit @@ -1392,8 +1403,10 @@ rm -rf $RPM_BUILD_ROOT %if 0%{!?el5:1} || "%{_target_cpu}" == "noarch" %files doc -%doc %{gdb_build}/gdb/doc/{gdb,annotate}.{html,pdf} %defattr(-,root,root) +%dir %{_pkgdocdir} +%doc %{_pkgdocdir}/*.html +%doc %{_pkgdocdir}/*.pdf %{_infodir}/annotate.info* %{_infodir}/gdb.info*
-- devel mailing list devel@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/devel Fedora Code of Conduct: http://fedoraproject.org/code-of-conduct