Changes between Version 2 and Version 3 of howto/AdvancedDailyAdm


Ignore:
Timestamp:
Apr 5, 2021, 10:51:18 PM (4 years ago)
Author:
BjarneDMat
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • howto/AdvancedDailyAdm

    v2 v3  
    1616== The Scripts ==
    1717
     18=== Script 0: '''Default Values''' ===
     19{{{
     20declare prefix='/opt/local'
     21declare version='2.6.4'
     22}}}
     23
    1824=== Script 1: '''Installation''' ===
    1925
    2026{{{
    21 #!/bin/bash
     27#!/usr/bin/env bash
    2228
    2329################################################################################
    2430# copyright Bjarne D Mathiesen
    25 #           København ; Danmark ; Europa
     31#           Korsør ; Danmark ; Europa
    2632#           macintosh .at. mathiesen .dot. info
    2733# date      04/07-2007
     
    3238#           18/06-2011  added default values for the parameters
    3339#                       updated path values for XCode4
    34 #
    35 # this script is released under the BSD license
     40#           05/03-2017  added update to actions
     41#           31/01-2018  added checkpaths & fixpaths
     42#                       updated default values for the parameters
     43#           02/03-2021  removed  fixpaths
     44#                       reworked setpaths
     45#                       added fixCLT
     46#
     47# this script is released under the OSS GPL v3 license
    3648# the author welcomes feedback and improvements
    3749#
     50(   cd  $( dirname ${0} )
     51
     52source ./portDefaults
    3853
    3954usage() {
    4055cat <<EOT
    4156purpose : to automate the whole install process
    42 \${1} : action                 [ install (default) , paths ]
    43 \${2} : install prefix         ( default /macports )
    44 \${3} : macports base version  ( default 1.9.2 )
     57\${1} : action                 [ update (default) , install , setpaths , checkpaths , select , fixCLT ]
     58\${2} : macports base version  ( default ${version} ) only for install
    4559EOT
    4660}
    4761
    48 declare action=${1:-"install"}
    49 declare prefix=${2:-"/macports"}
    50 declare version=${3:-"1.9.2"}
     62declare action=${1:-"update"}
     63[ ! -z ${2} ] && declare version=${2}
    5164
    5265case ${action} in
     66
     67########################
     68# https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt
     69('fixCLT')
     70touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
     71softwareupdate -ia
     72rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
     73
     74;;
     75########################
     76#
     77('select')
     78while read -u 9 name selected options
     79do
     80    options=( $( echo ${options} ) )
     81    port select --set "${name}" ${options[@]: -2:1}
     82done 9< <( port -q select --summary )
     83port select --summary
     84
     85;;
     86########################
     87# update installed ports
     88('update')
     89port -dN selfupdate
     90port outdated
     91port clean --work outdated
     92port -cuNp upgrade outdated
     93port -pN clean --work installed
     94# port -pN reclaim
     95
     96;;
    5397########################
    5498# setup the system paths
    55 'paths')
     99('setpaths')
    56100
    57101mkdir -p  /etc/paths.d
     
    60104touch     /etc/paths
    61105
    62 echo "${prefix}/bin"        >  /etc/paths.d/000macports
    63 echo "${prefix}/sbin"       >> /etc/paths.d/000macports
    64 
    65 echo "/Developer/usr/bin"   >  /etc/paths.d/888developer
    66 echo "/Developer/usr/sbin"  >> /etc/paths.d/888developer
     106echo "${prefix}/bin"        >  /etc/paths
     107echo "${prefix}/sbin"       >> /etc/paths
     108
     109echo "/Applications/Xcode.app/Contents/Developer/usr/bin"   >  /etc/paths.d/888developer
    67110
    68111mkdir -p  /etc/manpaths.d
     
    72115
    73116echo "${prefix}/share/man"  > /etc/manpaths.d/000macports
    74 echo "/Developer/usr/share/man"     >  /etc/manpaths.d/888developer
    75 echo "/Developer/usr/X11/share/man" >> /etc/manpaths.d/888developer
    76 
    77 # path_helper is buggy under 10.5
    78 #cp -npv /usr/libexec/path_helper /usr/libexec/path_helper.orig
    79 #cp   -v path_helper /usr/libexec/
     117#echo "/Developer/usr/share/man"     >  /etc/manpaths.d/888developer
     118#echo "/Developer/usr/X11/share/man" >> /etc/manpaths.d/888developer
     119
     120;;
     121########################
     122# check the system paths
     123('checkpaths')
     124/usr/libexec/path_helper
    80125
    81126;;
    82127##################
    83128# install macports
    84 'install')
     129('install')
    85130
    86131if [ ! -e MacPorts-${version}.tar.gz ]
    87132then
    88     curl -O --url "http://distfiles.macports.org/MacPorts/MacPorts-${version}.tar.gz"
     133    curl -O --url "https://distfiles.macports.org/MacPorts/MacPorts-${version}.tar.gz"
    89134fi
    90135
     
    93138
    94139cd MacPorts-${version}
    95 ./configure LDFLAGS=-L/Developer/SDKs/MacOSX10.6.sdk/usr/X11/lib --prefix=${prefix}
     140#patch -p0 </Volumes/Bjarne/WebServer/MacPorts/newPorts/pathces/mp-base-no-progress-if-stdout-no-tty.patch
     141#./configure LDFLAGS=-L/Developer/SDKs/MacOSX10.6.sdk/usr/X11/lib --prefix=${prefix}
     142./configure --prefix=${prefix}
    96143make
    97144make install
    98145
    99146# update MacPorts itself
    100 ${prefix}/bin/port -d selfupdate
    101 
    102 # let's get bash
    103 ${prefix}/bin/port install bash
     147${prefix}/bin/port -dN selfupdate
     148
     149# let's get bash, zsh & nano
     150${prefix}/bin/port -N install bash zsh nano
     151
     152# cleanup
     153rm  -rf  ./MacPorts-${version}
    104154
    105155;;
    106156# default
    107 *)
     157(*)
    108158usage
    109159esac
     160
     161) ; wait
    110162}}}
    111163