IT練習ノート

IT関連で調べたこと(実際は嵌ったこと)を書いています。

cabelを使ってgithubにあるパッケージをインストール

練習してみました。

step.1 ダウンロードする

[work04]$ wget https://hackage.haskell.org/package/ppm-2009.5.13/ppm-2009.5.13.tar.gz
--2014-04-21 11:13:51--  https://hackage.haskell.org/package/ppm-2009.5.13/ppm-2009.5.13.tar.gz
hackage.haskell.org (hackage.haskell.org) をDNSに問いあわせています... 88.198.224.242
hackage.haskell.org (hackage.haskell.org)|88.198.224.242|:443 に接続しています... 接続しました。
HTTP による接続要求を送信しました、応答を待っています... 200 OK
長さ: 特定できません [application/x-gzip]
`ppm-2009.5.13.tar.gz' に保存中

    [ <=>                                                                                                                                                               ] 2,012       --.-K/s 時間 0s      

2014-04-21 11:13:52 (11.9 MB/s) - `ppm-2009.5.13.tar.gz' へ保存終了 [2012]

step.2 ダウンロードファイルの確認

[work04]$ ls -al
drwxrwxr-x  2 test-user test-user   4096  4月 21 11:13 .
drwx------ 16 test-user test-user   4096  4月 21 11:11 ..
-rw-rw-r--  1 test-user test-user   2012  5月 12  2009 ppm-2009.5.13.tar.gz

step.3 解凍する必要なし。(tarがあると考えずに解凍してしまうよくない癖)

[work04]$ tar jxf ppm-2009.5.13.tar.gz 
bzip2: (stdin) is not a bzip2 file.
tar: Child returned status 2
tar: Error is not recoverable: exiting now

step.4 インストール

[work04]$ cabal install  ppm-2009.5.13.tar.gz 
Warning: The package list for 'hackage.haskell.org' is 29 days old.
Run 'cabal update' to get the latest list of available packages.
Resolving dependencies...
Configuring ppm-2009.5.13...
Building ppm-2009.5.13...
Preprocessing library ppm-2009.5.13...
[1 of 1] Compiling Codec.Image.PPM  ( src/Codec/Image/PPM.hs, dist/build/Codec/Image/PPM.o )
In-place registering ppm-2009.5.13...
Installing library in
/home/test-user/.cabal/lib/x86_64-linux-ghc-7.6.3/ppm-2009.5.13
Registering ppm-2009.5.13...
Installed ppm-2009.5.13

step.5 確認する(もともとパッケージがあったみたいですが。。)

[work04]$ cabal list | grep PPM
Warning: The package list for 'hackage.haskell.org' is 29 days old.
Run 'cabal update' to get the latest list of available packages.
* AC-PPM
    Synopsis: Trivial package for writing PPM images.
    Synopsis: Loading PBM, PGM, PPM image files
    Synopsis: a tiny PPM image generator
[work04]$ 

cabalの情報が古いけど放置。(^^;;