[petsc] 01/02: make header docs arch-independent

Drew Parsons dparsons at moszumanska.debian.org
Mon Nov 28 11:20:36 UTC 2016


This is an automated email from the git hooks/post-receive script.

dparsons pushed a commit to tag debian/3.7.4+dfsg1-5
in repository petsc.

commit 1415f90cd4699f6a5eea34c2e270ed73b7780769
Author: Drew Parsons <dparsons at debian.org>
Date:   Mon Nov 28 18:04:17 2016 +0800

    make header docs arch-independent
    
    A PETSc install provides html documentation for header files in the
    petsc include directory.
    
    These html docs link to the general documentation for each class and
    function, but also to the specific header files.
    
    The header html files were installed by default in the header
    directory, which is arch-dependent.  So to make the doc package
    generic (arch-indep, Multiarch: foreign), place these files under
    /usr/share/doc.
    
    Then adjust the reference to the actual header file by adding the
    pathname, using the preferred alternative include path
    /usr/include/petsc/
---
 debian/rules | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/debian/rules b/debian/rules
index 4b3dbed..a9b999d 100755
--- a/debian/rules
+++ b/debian/rules
@@ -261,9 +261,17 @@ override_dh_install:
 
 override_dh_installdocs:
 	dh_installdocs
-	dh_install -p$(PETSC_DOC_PACKAGE) --sourcedir $(PACKAGE_DEBUG_INSTALL_BASEDIR) --autodest $(PETSC_DIR_DEBUG_PREFIX)/include/*html
-	dh_install -p$(PETSC_DOC_PACKAGE) --sourcedir $(PACKAGE_DEBUG_INSTALL_BASEDIR) --autodest $(PETSC_DIR_DEBUG_PREFIX)/include/petsc/*/*html
-
+	# dh_install can't install .html while preserving directory structure
+	# so first install all include files to docs...
+	dh_install --verbose -p$(PETSC_DOC_PACKAGE) --sourcedir $(PACKAGE_DEBUG_INSTALL_BASEDIR)  $(PETSC_DIR_DEBUG_PREFIX)/include usr/share/doc/$(PETSC_DOC_PACKAGE)
+	# then remove non-html files
+	find ./debian/$(PETSC_DOC_PACKAGE)/usr/share/doc/$(PETSC_DOC_PACKAGE)/include/ -type f -not -name "*.html" -delete
+	# make header docs "generic" (pointing to headers in preferred alternative in /usr/include/petsc)
+	for hdoc in `find ./debian/$(PETSC_DOC_PACKAGE)/usr/share/doc/$(PETSC_DOC_PACKAGE)/include/ -name "*.html"`; do  \
+	  h=`echo $${hdoc} | xargs basename | sed "s/.html//"`; \
+	  hdir=`echo $${hdoc} | xargs dirname | sed "s|^.*include||"`; \
+	  sed "s|href=\"$${h}\"|href=\"/usr/include/petsc$${hdir}/$${h}\"|" -i $${hdoc};  \
+	done
 
 # dh_installchangelogs can't handle a directory of changelog files, so skip them here
 override_dh_installchangelogs:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/petsc.git



More information about the debian-science-commits mailing list