1#!/bin/sh 2# 3# This script makes a Apple Mac OS X docset for PETSc see ./makeall 4# 5# 6cd ${PETSC_DIR} 7rm -rf PETSc.docset 8mkdir PETSc.docset 9mkdir PETSc.docset/Contents 10mkdir PETSc.docset/Contents/Resources 11mkdir PETSc.docset/Contents/Resources/Documents 12cat <<EOF > PETSc.docset/Contents/Info.plist 13<?xml version="1.0" encoding="UTF-8"?> 14<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> 15<plist version="1.0"> 16<dict> 17 <key>CFBundleName</key> 18 <string>PETSc Documentation</string> 19 <key>CFBundleIdentifier</key> 20 <string>gov.anl.mcs.PETSc.docset</string> 21 <key>DocSetPublisherIdentifier</key> 22 <string>gov.anl.mcs.PETSc.documentation</string> 23 <key>DocSetPublisherName</key> 24 <string>PETSc</string> 25</dict> 26</plist> 27EOF 28 29cat <<EOF > PETSc.docset/Contents/Resources/Nodes.xml 30<?xml version="1.0" encoding="UTF-8"?> 31<DocSetNodes version="1.0"> 32 <TOC> 33 <Node type="file"> 34 <Name>All PETSc manual pages</Name> 35 <Path>manualpages</Path> 36 <File>singleindex.html</File> 37 <Subnodes> 38 <Node type="folder"> 39 <Name>ODE Integrators -- TS</Name> 40 <Path>manualpages/TS</Path> 41 <File>index.html</File> 42 </Node> 43 <Node type="folder"> 44 <Name>Nonlinear solvers -- SNES</Name> 45 <Path>manualpages/SNES</Path> 46 <File>index.html</File> 47 </Node> 48 <Node type="folder"> 49 <Name>Krylov solvers -- KSP</Name> 50 <Path>manualpages/KSP</Path> 51 <File>index.html</File> 52 </Node> 53 <Node type="folder"> 54 <Name>Preconditioners -- PC</Name> 55 <Path>manualpages/PC</Path> 56 <File>index.html</File> 57 </Node> 58 <Node type="folder"> 59 <Name>Semi-Lagrange solver</Name> 60 <Path>manualpages/SemiLagrange</Path> 61 <File>index.html</File> 62 </Node> 63 <Node type="folder"> 64 <Name>Mesh management -- DM</Name> 65 <Path>manualpages/DM</Path> 66 <File>index.html</File> 67 </Node> 68 <Node type="folder"> 69 <Name>Matrices -- Mat</Name> 70 <Path>manualpages/Mat</Path> 71 <File>index.html</File> 72 </Node> 73 <Node type="folder"> 74 <Name>Matrix-free operators -- MatFD</Name> 75 <Path>manualpages/MatFD</Path> 76 <File>index.html</File> 77 </Node> 78 <Node type="folder"> 79 <Name>Matrix orderings -- MatOrdering</Name> 80 <Path>manualpages/MatOrderings</Path> 81 <File>index.html</File> 82 </Node> 83 <Node type="folder"> 84 <Name>Vectors -- Vec</Name> 85 <Path>manualpages/Vec</Path> 86 <File>index.html</File> 87 </Node> 88 <Node type="folder"> 89 <Name>Indexing -- IS</Name> 90 <Path>manualpages/IS</Path> 91 <File>index.html</File> 92 </Node> 93 <Node type="folder"> 94 <Name>Numbering/Reordering -- AO</Name> 95 <Path>manualpages/AO</Path> 96 <File>index.html</File> 97 </Node> 98 <Node type="folder"> 99 <Name>Viewers -- PetscViewer</Name> 100 <Path>manualpages/Viewer</Path> 101 <File>index.html</File> 102 </Node> 103 <Node type="folder"> 104 <Name>Profiling -- PetscLog</Name> 105 <Path>manualpages/Profiling</Path> 106 <File>index.html</File> 107 </Node> 108 <Node type="folder"> 109 <Name>Utilities -- Sys</Name> 110 <Path>manualpages/Sys</Path> 111 <File>index.html</File> 112 </Node> 113 <Node type="folder"> 114 <Name>Thread parallelism -- PetscThreadComm</Name> 115 <Path>manualpages/PetscThreadComm</Path> 116 <File>index.html</File> 117 </Node> 118 <Node type="folder"> 119 <Name>Low-level communication -- PetscSF</Name> 120 <Path>manualpages/PetscSF</Path> 121 <File>index.html</File> 122 </Node> 123 <Node type="folder"> 124 <Name>Graphics -- PetscDraw</Name> 125 <Path>manualpages/Draw</Path> 126 <File>index.html</File> 127 </Node> 128 <Node type="folder"> 129 <Name>PF</Name> 130 <Path>manualpages/PF</Path> 131 <File>index.html</File> 132 </Node> 133 </Subnodes> 134 </Node> 135 </TOC> 136</DocSetNodes> 137EOF 138 139cat <<EOF > PETSc.docset/Contents/Resources/Tokens.xml 140<?xml version="1.0" encoding="UTF-8"?> 141<Tokens version="1.0"> 142EOF 143 144cd ${LOC}/docs 145for i in manualpages/*/*.html; do 146 symbol=`echo $i | sed s?manualpages/[A-Za-z]*/??g | sed s?.html??g` 147 if [ ${symbol} != "index" ]; then 148 echo \<Token\> \<TokenIdentifier\>//apple_ref/c/func/${symbol}\</TokenIdentifier\>\<Path\>${i}\</Path\>\</Token\> >> ${PETSC_DIR}/PETSc.docset/Contents/Resources/Tokens.xml 149 fi; 150done 151 152cd ${PETSC_DIR} 153 154cat <<EOF >> PETSc.docset/Contents/Resources/Tokens.xml 155</Tokens> 156EOF 157 158cp -r ${LOC}/docs/manualpages PETSc.docset/Contents/Resources/Documents 159 160/Applications/Xcode.app/Contents/Developer/usr/bin/docsetutil index -debug -verbose PETSc.docset 161 162 163