]> granicus.if.org Git - python/commitdiff
- Issue #11079: The /Applications/Python x.x folder created by the Mac
authorNed Deily <nad@acm.org>
Mon, 7 Feb 2011 16:48:28 +0000 (16:48 +0000)
committerNed Deily <nad@acm.org>
Mon, 7 Feb 2011 16:48:28 +0000 (16:48 +0000)
OS X installers now includes a link to the installed documentation
plus another in the framework share/doc directory.

Mac/BuildScript/scripts/postflight.documentation

index 9f5918ed78d089bddd3e6f32f52ea45d44ff9766..30d2ee527ba045c1b638ffc1793314e96887a359 100755 (executable)
@@ -1,11 +1,32 @@
 #!/bin/sh
 
 PYVER="@PYVER@"
+FWK="/Library/Frameworks/Python.framework/Versions/${PYVER}"
+FWK_DOCDIR_SUBPATH="Resources/English.lproj/Documentation"
+FWK_DOCDIR="${FWK}/${FWK_DOCDIR_SUBPATH}"
+APPDIR="/Applications/Python ${PYVER}"
+DEV_DOCDIR="/Developer/Documentation"
+SHARE_DIR="${FWK}/share"
+SHARE_DOCDIR="${SHARE_DIR}/doc/python${PYVER}"
+SHARE_DOCDIR_TO_FWK="../../.."
 
-if [ -d /Developer/Documentation ]; then
-       if [ ! -d /Developer/Documentation/Python ]; then
-               mkdir -p /Developer/Documentation/Python
-       fi
+# make link in /Developer/Documentation/ for Xcode users
+if [ -d "${DEV_DOCDIR}" ]; then
+    if [ ! -d "${DEV_DOCDIR}/Python" ]; then
+        mkdir -p "${DEV_DOCDIR}/Python"
+    fi
+    ln -fhs "${FWK_DOCDIR}" "${DEV_DOCDIR}/Python/Reference Documentation ${PYVER}"
+fi
+
+# make link in /Applications/Python m.n/ for Finder users
+if [ -d "${APPDIR}" ]; then
+    ln -fhs "${FWK_DOCDIR}/index.html" "${APPDIR}/Python Documentation.html"
+fi
 
-       ln -fhs /Library/Frameworks/Python.framework/Versions/${PYVER}/Resources/English.lproj/Documentation "/Developer/Documentation/Python/Reference Documentation @PYVER@"
+# make share/doc link in framework for command line users
+if [ -d "${SHARE_DIR}" ]; then
+    mkdir -p "${SHARE_DOCDIR}"
+    # make relative link to html doc directory
+    ln -s "${SHARE_DOCDIR_TO_FWK}/${FWK_DOCDIR_SUBPATH}" "${SHARE_DOCDIR}/html"
 fi
+