Publicizing MacPorts [installation]

Bjarne D Mathiesen macintosh at mathiesen.info
Sat May 22 13:17:57 UTC 2021



Artem Loenko via macports-dev wrote:
> INSTALLATION
> 
> The current process is described well[1], but it is almost impossible to
> automate it. For a tool that supposes to be a CLI to manage everything,
> this is a disadvantage for me. Yes, I can install MacPorts from the
> command-line with something like this in my Makefile:
> 
...

My own installation script looks something like this :

#!/usr/bin/env bash

prefix=$(1:-'/opt/local')
version=${2:-'2.7.0'}

if [ ! -e MacPorts-${version}.tar.gz ]
then
    curl -L -O --url
"https://github.com/macports/macports-base/releases/download/v${version}/MacPorts-${version}.tar.gz"
fi

rm  -rf  ./MacPorts-${version}
tar -zxf   MacPorts-${version}.tar.gz 2>/dev/null \
|| { echo "error expanding MacPorts-${version}.tar.gz" ; exit }

cd MacPorts-${version}
CC=/usr/bin/cc ./configure \
     --prefix=/opt/local \
     --with-install-user=root \
     --with-install-group=admin \
     --with-directory-mode=0755 \
     --enable-readline \
&& make SELFUPDATING=1 \
&& make install SELFUPDATING=1 \
|| { echo "error compiling MacPorts-${version}" ; exit }

# update MacPorts itself
${prefix}/bin/port -dN selfupdate

# let's get bash, zsh & nano
${prefix}/bin/port -N install bash  && echo "${prefix}/bin/bash" >>
/etc/shells
${prefix}/bin/port -N install zsh   && echo "${prefix}/bin/zsh"  >>
/etc/shells
${prefix}/bin/port -N install nano

# cleanup
cd ..
rm  -rf  ./MacPorts-${version}

(this is actuallly part of a bigger script system I (desperately) try to
maintain at https://trac.macports.org/wiki/howto/AdvancedDailyAdm )

-- 
Bjarne D Mathiesen
Korsør ; Danmark ; Europa
-----------------------------------------------------------------------
denne besked er skrevet i et totalt M$-frit miljø
OpenCore + macOS 10.15.7 Catalina
MacPro 2010 ; 2 x 3,46 GHz 6-Core Intel Xeon ; 256 GB 1333 MHz DDR3 ECC
ATI Radeon RX 590 8 GB


More information about the macports-dev mailing list