[tools] Change target directory for doc

John J. McDonough jjmcd at fedoraproject.org
Mon Jan 28 19:48:11 UTC 2013


commit dc7308562b374bfdfff8bcf426ff16d070c75e4c
Author: John J. McDonough <jjmcd at fedoraproject.org>
Date:   Mon Jan 28 14:42:21 2013 -0500

    Change target directory for doc
    
    Previously, Fedora documentation was installed in /usr/share/doc/HTML
    with subdirectories for the document, and then the language.  Over
    time, other documents changed to a subdiretory for each language and
    then the document.
    
    Later still, it became the custom to place documentation in
    /usr/share/doc/<application>-<version>.  Since many users were
    examining documents directly, rather than through the menu, it was
    believed that moving the system documentation, especially the Release
    Notes, would be a problem for these users.
    
    In the Fedora 17 Release Notes, users were advised that the Release
    Notes would be moving to the now standard directory for Fedora 18.
    This change implements that move.

 tools/doc-publican-rpm/doc-publican-rpm.spec |    6 +++++-
 tools/doc-publican-rpm/makeDesktopFile.c     |   12 ++++++------
 tools/doc-publican-rpm/makeSpecFile.c        |   19 +++++++++----------
 3 files changed, 20 insertions(+), 17 deletions(-)
---
diff --git a/tools/doc-publican-rpm/doc-publican-rpm.spec b/tools/doc-publican-rpm/doc-publican-rpm.spec
index d0b567c..bbd6c6b 100644
--- a/tools/doc-publican-rpm/doc-publican-rpm.spec
+++ b/tools/doc-publican-rpm/doc-publican-rpm.spec
@@ -1,6 +1,6 @@
 Summary:	Package a multiple-language Publican document
 Name:		doc-publican-rpm
-Version:	3.2.0
+Version:	4.0.0
 Release:	1%{?dist}
 License:	GPLv2
 Group:		System Environment/Base
@@ -72,6 +72,10 @@ rm -rf $RPM_BUILD_ROOT
 /usr/share/%{name}/
 
 %changelog
+* Mon Jan 28 2012 John J. McDonough <jjmcd at fedoraproject.org> - 4.0.0-1
+- Place document in /usr/share/doc/basename-version instead
+  of /usr/share/doc/HTML/basename
+
 * Tue May 10 2011 John J. McDonough <jjmcd at fedoraproject.org> - 3.2.0-1
 - Use package name for icon name
 
diff --git a/tools/doc-publican-rpm/makeDesktopFile.c b/tools/doc-publican-rpm/makeDesktopFile.c
index d84835c..1d83428 100644
--- a/tools/doc-publican-rpm/makeDesktopFile.c
+++ b/tools/doc-publican-rpm/makeDesktopFile.c
@@ -93,8 +93,8 @@ void makeDesktopFile( char *szDir )
 	      szCLang,szTextString);
     }
   // BZ684546 Changed from htmlview to xdg-open
-  fprintf(f,"Exec=xdg-open file:///usr/share/doc/HTML/%s/index.html\n",
-	  szBasename);
+  fprintf(f,"Exec=xdg-open file:///usr/share/doc/%s-%s/index.html\n",
+	  szBasename,szVersion);
   // BZ587704 Use new icon instead of Publican icon
   fprintf(f,"Icon=%s\n",szBasename);
   fprintf(f,"Terminal=false\n");
@@ -149,8 +149,8 @@ void makeDesktopFile( char *szDir )
 	      szCLang,szTextString);
     }
   // BZ684546 Changed from htmlview to xdg-open
-  fprintf(f,"Exec=xdg-open file:///usr/share/doc/HTML/%s/index.html\n",
-	  szBasename);
+  fprintf(f,"Exec=xdg-open file:///usr/share/doc/%s-%s/index.html\n",
+	  szBasename,szVersion);
   // BZ587704 Use new icon instead of Publican icon
   fprintf(f,"Icon=%s\n",szBasename);
   fprintf(f,"Terminal=false\n");
@@ -219,8 +219,8 @@ void makeDesktopFile( char *szDir )
    /* 	      szCLang,szTextString);  */
    /*   }  */
   // BZ684546 Changed from htmlview to xdg-open
-  fprintf(f,"Exec=xdg-open file:///usr/share/doc/HTML/%s/index.html\n",
-	  szBasename);
+  fprintf(f,"Exec=xdg-open file:///usr/share/doc/%s-%s/index.html\n",
+	  szBasename,szVersion);
   // BZ587704 Use new icon instead of Publican icon
   fprintf(f,"Icon=%s\n",szBasename);
   fprintf(f,"Terminal=false\n");
diff --git a/tools/doc-publican-rpm/makeSpecFile.c b/tools/doc-publican-rpm/makeSpecFile.c
index b2a56d5..82d368d 100644
--- a/tools/doc-publican-rpm/makeSpecFile.c
+++ b/tools/doc-publican-rpm/makeSpecFile.c
@@ -12,13 +12,13 @@
 
   Specfile install peudocode:
 \code
-Make /usr/share/doc/HTML/<basename> directory
+Make /usr/share/doc/<basename>-<version> directory
 For all languages in the rpm
-    Call doAdir for /usr/share/doc/HTML/<basename>/<lang> directory:
+    Call doAdir for /usr/share/doc/<basename>-<version>/<lang> directory:
       Create directory
       Call self for subdirectories
       Install any files
-Install /usr/share/doc/HTML/<basename>/index.html
+Install /usr/share/doc/<basename>-<version>/index.html
 Install /usr/share/applications/<basename>.desktop
 \endcode
 */
@@ -327,8 +327,7 @@ void makeSpecFile( void )
 
   fprintf(f,"%%install\n");
   fprintf(f,"rm -rf $RPM_BUILD_ROOT\n");
-  fprintf(f,"mkdir -p $RPM_BUILD_ROOT%%{_defaultdocdir}/HTML\n");
-  fprintf(f,"mkdir -p $RPM_BUILD_ROOT%%{_defaultdocdir}/HTML/%%{name}\n");
+  fprintf(f,"mkdir -p $RPM_BUILD_ROOT%%{_defaultdocdir}/%%{name}-%%{version}\n");
 
   fprintf(f,"#\n");
   fprintf(f,"# Loop through the languages\n");
@@ -336,13 +335,13 @@ void makeSpecFile( void )
   fprintf(f,"cat /dev/null > html.lang\n");
   fprintf(f,"for LANGDIR in document/* ; do\n");
   fprintf(f,"  #\n");
-  fprintf(f,"  # First, the html in /usr/share/doc/HTML, then descend\n");
+  fprintf(f,"  # First, the html in /usr/share/doc/%%{name}-%%{version}, then descend\n");
   fprintf(f,"  # through any subdirectories, installing everything found.\n");
   fprintf(f,"  #\n");
   fprintf(f,"  # Language to process\n");
   fprintf(f,"  LANG=${LANGDIR#document/}\n");
   fprintf(f,"  # Target for the html\n");
-  fprintf(f,"  NOTETARG=$RPM_BUILD_ROOT%%{_defaultdocdir}/HTML/%%{name}/${LANG}\n");
+  fprintf(f,"  NOTETARG=$RPM_BUILD_ROOT%%{_defaultdocdir}/%%{name}-%%{version}/${LANG}\n");
   fprintf(f,"  # Place where html files are\n");
   fprintf(f,"  SRCBASE=${LANGDIR}\n");
   strcpy(szDir,szPubDir);
@@ -353,7 +352,7 @@ void makeSpecFile( void )
   fprintf(f,"#\n");
   fprintf(f,"# index.html\n");
   fprintf(f,"#\n");
-  fprintf(f,"install -m 644 index.html $RPM_BUILD_ROOT%%{_defaultdocdir}/HTML/%%{name}\n");
+  fprintf(f,"install -m 644 index.html $RPM_BUILD_ROOT%%{_defaultdocdir}/%%{name}-%%{version}\n");
   fprintf(f,"#\n");
   fprintf(f,"# Now the desktop files\n");
   fprintf(f,"#\n");
@@ -366,7 +365,7 @@ void makeSpecFile( void )
   //fprintf(f,"SRCBASE=tmp/${LANG}/xml\n");
   fprintf(f,"\n");
   fprintf(f,"#%%find_lang %%{name} --with-gnome --all-name\n");
-  fprintf(f,"#for F in $RPM_BUILD_ROOT%%{_defaultdocdir}/HTML/index-*.html ; do\n");
+  fprintf(f,"#for F in $RPM_BUILD_ROOT%%{_defaultdocdir}/%%{name}-%%{version}/index-*.html ; do\n");
   fprintf(f,"#  L=`echo ${F} | %%{__sed} 's/.*\\/index-\\(.*\\)\\.html$/\\1/'`\n");
   fprintf(f,"#  echo \"%%%%lang(${L}) ${F#$RPM_BUILD_ROOT}\" >> html.lang\n");
   fprintf(f,"#done\n");
@@ -429,7 +428,7 @@ void makeSpecFile( void )
   fprintf(f,"\n");
   fprintf(f,"%%files\n");
   fprintf(f,"%%defattr(-,root,root,-)\n");
-  fprintf(f,"%%{_defaultdocdir}/HTML\n");
+  fprintf(f,"%%{_defaultdocdir}/%%{name}-%%{version}\n");
   fprintf(f,"%%{_datadir}/applications/%s.desktop\n",szBasename);
   fprintf(f,"%%{_datadir}/applications/%sX.desktop\n",szBasename);
   fprintf(f,"%%{_datadir}/applications/kde4/%s.desktop\n",szBasename);


More information about the docs-commits mailing list