パッケージをバックアップしMacPortsを再インストールする

動作確認環境


MacPorts packageをバックアップ

% touch ~/MacPorts.txt
% port installed > ~/MacPorts.txt


現在のMacPortsを削除

% sudo rm -rf /opt/local
% sudo rm -rf /Applications/MacPorts
% sudo rm -rf /Library/LaunchDaemons/org.macports.*
% sudo rm -rf ~/.macports


MacPortsの最新版インストール

OS Versionに合わせてインストール


Xcodeのライセンス認証

% xcode-select --install
% sudo xcodebuild -license


MacPortsのアップデート

% sudo port -E selfupdate

注:30分ほど、時間が掛かります。


バックアップしたpackageの再インストール

ファイル内の行頭の文字と(active)を置き換えで削除しておく。

vim macports.txt

:%s/ (active)//gc


私はDropboxへ入れています。

% sudo port install $(cat ~/Dropbox/env/macports/macports.txt)


インストールすれば元通りです。

現状のインストールされているpackageはこちら。

ant-contrib @1.0b3_0
apache-ant @1.9.6_0
apache2 @2.2.31_0+preforkmpm
apr @1.5.2_1
apr-util @1.5.4_0
autoconf @2.69_5
automake @1.15_1
beecrypt @4.2.1_5
bison @3.0.4_1
bison-runtime @3.0.4_0
bzip2 @1.0.6_0
cmake @3.3.0_0
curl @7.43.0_1+ssl
curl-ca-bundle @7.43.0_1
cyrus-sasl2 @2.1.26_4+kerberos
db46 @4.6.21_10
db48 @4.8.30_4
db_select @0.1_3
djvulibre @3.5.27_0
expat @2.1.0_0
fftw-3 @3.3.4_1
fontconfig @2.11.1_0
freetype @2.6_0
gdbm @1.11_1
gettext @0.19.5_0
ghostscript @9.16_1+x11
glib2 @2.44.1_1
gnome-common @3.14.0_0
gnupg2 @2.0.28_0
gpg-agent @2.0.28_0+pinentry_mac
gpgme @1.5.5_0
gsed @4.2.2_0
icu @55.1_0
ilmbase @1.0.2_0
ImageMagick @6.9.0-0_1+x11
jbig2dec @0.11_2
jbigkit @2.1_0
jpeg @9a_1
kerberos5 @1.13.2_0
lcms2 @2.7_0
libarchive @3.1.2_1
libassuan @2.2.1_0
libcomerr @1.42.13_0
libedit @20140620-3.1_0
libffi @3.2.1_0
libgcrypt @1.6.3_0
libgpg-error @1.19_0
libiconv @1.14_0
libidn @1.31_0
libksba @1.3.3_0
libmagic @5.24_0
libmcrypt @2.5.8_1
libpaper @1.1.24_0
libpng @1.6.18_0
libproxy @0.4.11_5+python27
libtool @2.4.6_1
libusb @1.0.19_0
libusb-compat @0.1.5_0
libxml2 @2.9.2_2
libxslt @1.1.28_1
lzo2 @2.09_0
m4 @1.4.17_0
mhash @0.9.9.9_0
mysql56 @5.6.25_1
mysql56-server @5.6.25_0
mysql_select @0.1.2_2
ncurses @5.9_2
neon @0.30.0_0
nosetests_select @0.1_0
openexr @1.7.0_0
openjpeg @2.1.0_0
openldap @2.4.40_1
openssh @6.9p1_1+kerberos5+xauth
openssl @1.0.2d_0
ossp-uuid @1.6.2_3+perl5_16
p5.16-cpan-meta @2.150.5_0
p5.16-cpan-meta-requirements @2.133.0_0
p5.16-cpan-meta-yaml @0.16.0_0
p5.16-encode-locale @1.50.0_0
p5.16-file-listing @6.40.0_1
p5.16-file-slurp-tiny @0.4.0_0
p5.16-getopt-long @2.470.0_0
p5.16-html-form @6.30.0_1
p5.16-html-parser @3.710.0_1
p5.16-html-tagset @3.200.0_4
p5.16-http-cookies @6.10.0_1
p5.16-http-daemon @6.10.0_1
p5.16-http-date @6.20.0_1
p5.16-http-message @6.100.0_0
p5.16-http-negotiate @6.10.0_1
p5.16-inc-latest @0.500.0_0
p5.16-io-html @1.1.0_0
p5.16-io-socket-ssl @2.16.0_0
p5.16-libwww-perl @6.130.0_0+ssl
p5.16-lwp-mediatypes @6.20.0_1
p5.16-lwp-protocol-https @6.60.0_1
p5.16-mime-base64 @3.150.0_0
p5.16-module-build @0.421.400_0
p5.16-module-metadata @1.0.27_0
p5.16-mozilla-ca @20141217_0
p5.16-net-http @6.90.0_0
p5.16-net-libidn @0.120.0_4
p5.16-net-ssleay @1.700.0_0
p5.16-parse-cpan-meta @1.441.700_0
p5.16-pathtools @3.470.0_1
p5.16-perl-ostype @1.8.0_0
p5.16-pod-escapes @1.70.0_0
p5.16-pod-simple @3.300.0_0
p5.16-podlators @2.5.3_1
p5.16-scalar-list-utils @1.420.0_0
p5.16-sub-uplevel @0.250.0_0
p5.16-test-exception @0.400.0_0
p5.16-test-nowarnings @1.40.0_1
p5.16-test-simple @1.1.14_0
p5.16-test-warn @0.300.0_1
p5.16-tree-dag_node @1.270.0_0
p5.16-uri @1.680.0_0
p5.16-version @0.991.200_0
p5.16-www-robotrules @6.20.0_1
p5.16-xml-parser @2.440.0_0
pcre @8.37_0
pear-Archive_Tar @1.3.13_0
pear-Console_Getopt @1.3.1_0
pear-PEAR @1.9.4_0
pear-Structures_Graph @1.0.4_0
pear-XML_Util @1.2.1_0
perl5 @5.16.3_0+perl5_16
perl5.16 @5.16.3_1
php55
php55-apache2handler
php55-curl
php55-gd
php55-imagick
php55-intl
php55-mbstring
php55-mcrypt
php55-mysql
php55-openssl
php55-pear
php55-postgresql
php55-xdebug
php55-zip
php_select @1.0_0
phpmyadmin @4.4.12_0+php54
pinentry-mac @0.9.4_0
pkgconfig @0.28_0
popt @1.16_0
postgresql93 @9.3.9_0
postgresql93-server @9.3.9_0
postgresql94 @9.4.4_0
postgresql_select @0.2_0
pth @2.0.7_0
py27-curl @7.19.0_1
py27-iniparse @0.4_0
py27-libxml2 @2.9.2_0
py27-pygpgme @0.3_0
py27-setuptools @18.0.1_0
py27-urlgrabber @3.10.1_0
py27-yum-metadata-parser @1.1.4_1
python2_select @0.0_1
python27 @2.7.10_2
python_select @0.3_5
readline @6.3.003_0
serf1 @1.3.4_0
sqlite3 @3.8.10.2_0
subversion @1.9.0_0
tcp_wrappers @20_2
tiff @4.0.4_1
urw-fonts @1.0.7pre44_0
vala @0.28.0_0
webp @0.4.3_0
xauth @1.0.9_1
xorg-kbproto @1.0.6_0
xorg-libice @1.0.9_0
xorg-libpthread-stubs @0.3_0
xorg-libsm @1.2.1_0
xorg-libX11 @1.6.3_0
xorg-libXau @1.0.8_0
xorg-libxcb @1.11_1+python27
xorg-libXdmcp @1.1.2_0
xorg-libXext @1.3.3_0
xorg-libXmu @1.1.2_0
xorg-libXt @1.1.4_0
xorg-xcb-proto @1.11_1+python27
xorg-xextproto @7.3.0_0
xorg-xproto @7.0.27_1
xz @5.2.1_0
zlib @1.2.8_0

念のため、インストール時のログを残しておく。

--->  Activating pinentry-mac @0.9.4_0

If you previously didn't have pinentry or gpg-agent installed  and pinentry-mac has been installed as a
dependency of gpg-agent,  you don't need to do anything to use pinentry-mac.

If you want to switch to the GTK2, ncurses or Qt4 based pinentry  program, please install pinentry with the
correct use flags and  follow the instructions below substituting the pinentry-mac program  path with
/opt/local/bin/pinentry.


If you previously had pinentry and gpg-agent installed and would  like to switch to pinentry-mac, you will have
to set  it as your pinentry program in $HOME/.gnupg/gpg-agent.conf.

Add the following line to the mentioned file:
pinentry-program /Applications/MacPorts/pinentry-mac.app/Contents/MacOS/pinentry-mac


Be sure to comment previous "pinentry-program" lines, for example:

pinentry-program SAMPLE

becomes

#pinentry-program SAMPLE


Afterwards, run
killall -HUP gpg-agent

or simply log out and back in again.


--->  Activating gpg-agent @2.0.28_0+pinentry_mac

A startup item has been installed that will aid in starting gpg-agent with launchd. It is disabled by default.
Execute the following command to launch gpg-agent at user login:

launchctl load -w /Library/LaunchAgents/org.macports.gpg-agent.plist

To actually start gpg-agent, log out and back in.


--->  Installing mysql56 @5.6.25_1
The mysql56 client has been installed.
To install the mysql56 server, install the mysql56-server port.
--->  Activating mysql56 @5.6.25_1

On activation if no /opt/local/etc/mysql56/my.cnf file exists one
will be created which loads
/opt/local/etc/mysql56/macports-default.cnf.

If a /opt/local/etc/mysql56/my.cnf file exists MacPorts does not
touch it and any changes you make to /opt/local/etc/mysql56/my.cnf
will be preserved (e.g., during port upgrades, deactivations or
activations). /opt/local/etc/mysql56/my.cnf is a good place to
customize your mysql56 installation.

Any changes made to /opt/local/etc/mysql56/macports-default.cnf
will be lost during port upgrades, deactivations or activations so you
are advised to not make changes here. Currently
/opt/local/etc/mysql56/macports-default.cnf contains only one
directive; to disable networking. With disabled networking it is
possible to install and have running all the MacPorts mysql ports
simultaneously.


--->  Activating mysql56-server @5.6.25_0

If this is a new install you might want to run:

$ sudo -u _mysql /opt/local/lib/mysql56/bin/mysql_install_db


--->  Creating launchd control script
###########################################################
# A startup item has been generated that will aid in
# starting openssh with launchd. It is disabled
# by default. Execute the following command to start it,
# and to cause it to launch at startup:
#
# sudo port load openssh
###########################################################


--->  Activating php55 @5.5.28_1+libedit

To customize php55, copy /opt/local/etc/php55/php.ini-development (if this is a development server) or
/opt/local/etc/php55/php.ini-production (if this is a production server) to /opt/local/etc/php55/php.ini and
then make changes.


--->  Staging php55-apache2handler into destroot
Warning: php55-apache2handler installs files outside the common directory structure.


--->  Activating php55-apache2handler @5.5.28_0

If this is your first install, you need to enable php55-apache2handler in your web server.

To enable php55-apache2handler, run:

    cd /opt/local/apache2/modules
    sudo /opt/local/apache2/bin/apxs -a -e -n php5 mod_php55.so


--->  Activating php55-mysql @5.5.28_0+mysqlnd

To use mysqlnd with a local MySQL server, edit /opt/local/etc/php55/php.ini and set mysql.default_socket,
mysqli.default_socket and pdo_mysql.default_socket to the path to your MySQL server's socket file.

For mysql5, use /opt/local/var/run/mysql5/mysqld.sock
For mysql51, use /opt/local/var/run/mysql51/mysqld.sock
For mysql55, use /opt/local/var/run/mysql55/mysqld.sock
For mysql56, use /opt/local/var/run/mysql56/mysqld.sock
For mariadb, use /opt/local/var/run/mariadb/mysqld.sock
For percona, use /opt/local/var/run/percona/mysqld.sock


--->  Activating postgresql94 @9.4.4_0

To use the postgresql server, install the postgresql94-server port


--->  Activating php55-xdebug @2.3.3_0

You can get a list of the available configuration settings for xdebug with the following command:

    php55 --ri xdebug

For more information and details about configuration settings, see http://www.xdebug.org/docs/


--->  Activating postgresql93-server @9.3.9_0

To create a database instance, after install do
 sudo mkdir -p /opt/local/var/db/postgresql93/defaultdb
 sudo chown postgres:postgres /opt/local/var/db/postgresql93/defaultdb
 sudo su postgres -c '/opt/local/lib/postgresql93/bin/initdb -D /opt/local/var/db/postgresql93/defaultdb'