|
1 | 1 | #!/bin/sh |
2 | 2 |
|
3 | 3 | PYVER="@PYVER@" |
| 4 | +FWK="/Library/Frameworks/Python.framework/Versions/${PYVER}" |
| 5 | +FWK_DOCDIR_SUBPATH="Resources/English.lproj/Documentation" |
| 6 | +FWK_DOCDIR="${FWK}/${FWK_DOCDIR_SUBPATH}" |
| 7 | +APPDIR="/Applications/Python ${PYVER}" |
| 8 | +DEV_DOCDIR="/Developer/Documentation" |
| 9 | +SHARE_DIR="${FWK}/share" |
| 10 | +SHARE_DOCDIR="${SHARE_DIR}/doc/python${PYVER}" |
| 11 | +SHARE_DOCDIR_TO_FWK="../../.." |
4 | 12 |
|
5 | | -if [ -d /Developer/Documentation ]; then |
6 | | - if [ ! -d /Developer/Documentation/Python ]; then |
7 | | - mkdir -p /Developer/Documentation/Python |
8 | | - fi |
| 13 | +# make link in /Developer/Documentation/ for Xcode users |
| 14 | +if [ -d "${DEV_DOCDIR}" ]; then |
| 15 | + if [ ! -d "${DEV_DOCDIR}/Python" ]; then |
| 16 | + mkdir -p "${DEV_DOCDIR}/Python" |
| 17 | + fi |
| 18 | + ln -fhs "${FWK_DOCDIR}" "${DEV_DOCDIR}/Python/Reference Documentation ${PYVER}" |
| 19 | +fi |
| 20 | + |
| 21 | +# make link in /Applications/Python m.n/ for Finder users |
| 22 | +if [ -d "${APPDIR}" ]; then |
| 23 | + ln -fhs "${FWK_DOCDIR}/index.html" "${APPDIR}/Python Documentation.html" |
| 24 | +fi |
9 | 25 |
|
10 | | - ln -fhs /Library/Frameworks/Python.framework/Versions/${PYVER}/Resources/English.lproj/Documentation "/Developer/Documentation/Python/Reference Documentation @PYVER@" |
| 26 | +# make share/doc link in framework for command line users |
| 27 | +if [ -d "${SHARE_DIR}" ]; then |
| 28 | + mkdir -p "${SHARE_DOCDIR}" |
| 29 | + # make relative link to html doc directory |
| 30 | + ln -s "${SHARE_DOCDIR_TO_FWK}/${FWK_DOCDIR_SUBPATH}" "${SHARE_DOCDIR}/html" |
11 | 31 | fi |
| 32 | + |
0 commit comments