MBA に Merverick をクリーンインストールしたので環境構築(Emacsインストールまで)

# MBA に Merverick をクリーンインストールしたので環境構築(Emacsインストールまで)

## これまでのお話

 * [MBAにMervericks 入れて環境構築し直したので手順(Fink入れるまで)](http://qiita.com/s-age/items/37a1b628e0ff4f876d44)

## システム設定とか

 * iTerm の設定で option キーの動作を ```+Esc``` に変更
 * C-f で menutab が開いて邪魔だったのでホットキーを無効化

## おもむろに search する

 * serach ない？

```
$ fink search emacs
Fink 0.36.1

Usage: fink [options] command [package...]
       fink install pkg1 [pkg2 ...]

Common commands:
  install      - install/update the named packages
  remove       - remove the named packages
  purge        - same as remove but also removes all configuration files
  update       - update the named packages
  selfupdate   - upgrade fink to the lastest release
  update-all   - update all installed packages
  configure    - rerun the configuration process
  list         - list available packages, optionally filtering by name, see 'fink list --help' for more options
  apropos      - list packages matching a search keyword
  describe     - display a detailed description of the named packages
  index        - force rebuild of package cache
  validate     - performs various checks on .info and .deb files
  scanpackages - rescans the list of binary packages on the system
  cleanup      - reclaims disk space used by temporary or obsolete files
  show-deps    - list run-time and compile-time package dependencies

Common options:
  -h, --help            - Display this help text.
  -q, --quiet           - causes fink to be less verbose, opposite of --verbose
  -V, --version         - display version information
  -v, --verbose         - causes fink to be more verbose, opposite of --quiet
  -y, --yes             - assume default answer for all interactive questions
  -b, --use-binary-dist - download pre-compiled packages from the binary distribution if available
  --no-use-binary-dist  - Opposite of use-binary-dist

See the fink(8) manual page for a complete list of commands and options.
Visit http://www.finkproject.org for further information.
```

 * list で代用かなー

```
$ fink list emacs
Information about 295 packages read in 1 seconds.
```

 * ちゃうねん。。ほしい情報はそれとちゃうねん！
 * つか、パッケージ数少なくないか？

```
$ fink list | wc -l
     295
```

 * お、おう。。
 * そうだ！updateしよう(謎)

```
$ sudo fink selfupdate

Fink has the capability to run the cvs commands as a normal user. That has some advantages - it uses that user's CVS settings files and allows
the package descriptions to be edited and updated without becoming root. Please specify the user login name that should be used: [s-age]

For Fink developers only: Enter your SourceForge login name to set up full CVS access. Other users, just press return to set up anonymous
read-only access. [anonymous]

Checking to see if we can use hard links to merge the existing tree. Please ignore errors on the next few lines.
Now logging into the CVS server. When CVS asks you for a password, just press return (i.e. the password is empty).
/usr/bin/su s-age -c 'cvs -d":pserver:anonymous@fink.cvs.sourceforge.net:/cvsroot/fink" login'
Logging in to :pserver:anonymous@fink.cvs.sourceforge.net:2401/cvsroot/fink
CVS password:
cvs login: authorization failed: server fink.cvs.sourceforge.net rejected access to /cvsroot/fink for user anonymous
### execution of /usr/bin/su failed, exit code 1
Failed: Logging into the CVS server for anonymous read-only access failed.
```

 * Enter 3回押せばおk
 * ちょいちょい、エラー出て設定変える？って聞かれたのですべてデフォルトに設定し直す
 * 改めて list

```
$ fink list emacs
Scanning package description files..........
Information about 8133 packages read in 0 seconds.
     emacs23                       23.4-2                 Flexible real-time text editor
     emacs23-app                   23.4-2                 Flexible real-time text editor
     emacs23-nox                   23.4-2                 Flexible real-time text editor
     emacsen                                              [virtual package]
     emacsen-common                1.4.15-5               Common facilities for all emacsen
     pari-gp-xemacs                2.3.5-12               Number theory (calculator and C-library)
     xemacs                        1:21.4.22-4            Highly customizable text editor
     xemacs-base-pkg                                      [virtual package]
     xemacs-efs-pkg                                       [virtual package]
     xemacs-sumo-pkg               20090217-1             All xemacs packages together
```

 * 出たー！

## よしよし、Emacs入れよう

 * とりあえず、毎回、curlのオプションつけるの面倒なので

```
$ sudo fink install wget
```

 * すごい勢いでログが流れるw何これこわいwww
 * とりあえず、出力が終わったのでmanしてみる

```
$ man wget
```

 * man 表示されるの確認しておkおkはいったとなる
 * emacs24 落としてくる

```
$ cd ~/Download
$ wget http://ftp.jaist.ac.jp/pub/GNU/emacs/emacs-24.3.tar.gz
--2014-04-06 13:57:45--  http://ftp.jaist.ac.jp/pub/GNU/emacs/emacs-24.3.tar.gz
ftp.jaist.ac.jp をDNSに問いあわせています... 150.65.7.130, 2001:df0:2ed:feed::feed
ftp.jaist.ac.jp|150.65.7.130|:80 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 52543898 (50M) [application/x-gzip]
`emacs-24.3.tar.gz' に保存中

100%[========================================================================================================>] 52,543,898  4.54MB/s 時間 12s

2014-04-06 13:57:58 (4.18 MB/s) - `emacs-24.3.tar.gz' へ保存完了 [52543898/52543898]
```

 * ビルドする

```
$ tar xvf emacs-24.3.tar.gz
$ cd emacs-24.3
$ find `pwd` -type f -name '*config*'
/Users/s-age/Downloads/emacs-24.3/admin/build-configs
/Users/s-age/Downloads/emacs-24.3/build-aux/config.guess
/Users/s-age/Downloads/emacs-24.3/build-aux/config.sub
/Users/s-age/Downloads/emacs-24.3/config.bat
/Users/s-age/Downloads/emacs-24.3/configure
/Users/s-age/Downloads/emacs-24.3/configure.ac
/Users/s-age/Downloads/emacs-24.3/lisp/epg-config.el
/Users/s-age/Downloads/emacs-24.3/lisp/epg-config.elc
/Users/s-age/Downloads/emacs-24.3/nt/config.nt
/Users/s-age/Downloads/emacs-24.3/nt/configure.bat
/Users/s-age/Downloads/emacs-24.3/src/config.in
$ ./configure --with-jpeg=no --with-gif=no --with-tiff=no
$ make
$ sudo make install
$ emacs-24.3
```

 * 起動したのでM-x version

```
GNU Emacs 24.3.1 (x86_64-apple-darwin13.1.0, X toolkit, Xaw3d scroll bars) of 2014-04-06 on MBA.local
```

 * el-get 入れる
  * [el-get](https://github.com/dimitri/el-get)
 * scratch でも張り付けて C-x C-e するだけ

```
(url-retrieve
 "https://raw.github.com/dimitri/el-get/master/el-get-install.el"
 (lambda (s)
   (goto-char (point-max))
   (eval-print-last-sexp)))
```

 * M-x el-get-install して必要なもの入れて、.emacs いじる
 * fink? wget入れましたよ？